Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- validateTx ∷ MonadError TxValidationError m ⇒ Environment → UTxO → Annotated Tx ByteString → m ()
- validateTxAux ∷ MonadError TxValidationError m ⇒ Environment → UTxO → ATxAux ByteString → m ()
- updateUTxO ∷ (MonadError UTxOValidationError m, MonadReader ValidationMode m) ⇒ Environment → UTxO → [ATxAux ByteString] → m UTxO
- updateUTxOTxWitness ∷ (MonadError UTxOValidationError m, MonadReader ValidationMode m) ⇒ Environment → UTxO → ATxAux ByteString → m UTxO
- updateUTxOTx ∷ (MonadError UTxOValidationError m, MonadReader ValidationMode m) ⇒ Environment → UTxO → Annotated Tx ByteString → m UTxO
- data TxValidationError
- = TxValidationLovelaceError Text LovelaceError
- | TxValidationFeeTooSmall Tx Lovelace Lovelace
- | TxValidationWitnessWrongSignature TxInWitness ProtocolMagicId TxSigData
- | TxValidationWitnessWrongKey TxInWitness Address
- | TxValidationMissingInput TxIn
- | TxValidationNetworkMagicMismatch NetworkMagic NetworkMagic
- | TxValidationTxTooLarge Natural Natural
- | TxValidationUnknownAddressAttributes
- | TxValidationUnknownAttributes
- data Environment = Environment {}
- data UTxOValidationError
Documentation
validateTx ∷ MonadError TxValidationError m ⇒ Environment → UTxO → Annotated Tx ByteString → m () Source #
Validate that:
- All
TxIn
s are in domain ofUtxo
These are the conditions of the UTxO inference rule in the spec.
validateTxAux ∷ MonadError TxValidationError m ⇒ Environment → UTxO → ATxAux ByteString → m () Source #
Validate that:
- The fee for a transaction is not less than the minimum fee.
- The size of the transaction is below the maximum size.
- 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
Instances
Show TxValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation | |
FromCBOR TxValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation | |
ToCBOR TxValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation toCBOR ∷ TxValidationError → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy TxValidationError → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [TxValidationError] → Size Source # | |
DecCBOR TxValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation | |
EncCBOR TxValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation encCBOR ∷ TxValidationError → Encoding Source # encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy TxValidationError → Size Source # encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [TxValidationError] → Size Source # | |
Eq TxValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation |
data Environment Source #
Instances
Show Environment Source # | |
Defined in Cardano.Chain.UTxO.Validation | |
Eq Environment Source # | |
Defined in Cardano.Chain.UTxO.Validation (==) ∷ Environment → Environment → Bool Source # (/=) ∷ Environment → Environment → Bool Source # |
data UTxOValidationError Source #
Instances
Show UTxOValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation | |
FromCBOR UTxOValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation | |
ToCBOR UTxOValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation toCBOR ∷ UTxOValidationError → Encoding Source # encodedSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy UTxOValidationError → Size Source # encodedListSizeExpr ∷ (∀ t. ToCBOR t ⇒ Proxy t → Size) → Proxy [UTxOValidationError] → Size Source # | |
DecCBOR UTxOValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation | |
EncCBOR UTxOValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation encCBOR ∷ UTxOValidationError → Encoding Source # encodedSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy UTxOValidationError → Size Source # encodedListSizeExpr ∷ (∀ t. EncCBOR t ⇒ Proxy t → Size) → Proxy [UTxOValidationError] → Size Source # | |
Eq UTxOValidationError Source # | |
Defined in Cardano.Chain.UTxO.Validation |