cardano-ledger-0.1.0.0: The blockchain layer of Cardano
Safe HaskellNone
LanguageHaskell2010

Cardano.Chain.UTxO.Validation

Synopsis

Documentation

validateTx :: MonadError TxValidationError m => Environment -> UTxO -> Annotated Tx ByteString -> m () Source #

Validate that:

  1. All TxIns are in domain of Utxo

These are the conditions of the UTxO inference rule in the spec.

validateTxAux :: MonadError TxValidationError m => Environment -> UTxO -> ATxAux ByteString -> m () Source #

Validate that:

  1. The fee for a transaction is not less than the minimum fee.
  2. The size of the transaction is below the maximum size.
  3. Output balance + fee = input balance

The transaction size must be calculated _including the witnesses_. As such this cannot be part of validateTx. We actually assume 3 by calculating the fee as output balance - input balance.

updateUTxO :: (MonadError UTxOValidationError m, MonadReader ValidationMode m) => Environment -> UTxO -> [ATxAux ByteString] -> m UTxO Source #

Update UTxO with a list of transactions

updateUTxOTxWitness :: (MonadError UTxOValidationError m, MonadReader ValidationMode m) => Environment -> UTxO -> ATxAux ByteString -> m UTxO Source #

Validate a transaction with a witness and use it to update the UTxO

updateUTxOTx :: (MonadError UTxOValidationError m, MonadReader ValidationMode m) => Environment -> UTxO -> Annotated Tx ByteString -> m UTxO Source #

Validate a transaction and use it to update the UTxO

data TxValidationError Source #

A representation of all the ways a transaction might be invalid