cardano-ledger-babbage-0.1.0.0: TODO
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Babbage.Rules.Utxo

Synopsis

Documentation

data BabbageUTXO era Source #

Instances

Instances details
( ValidateScript era, Era era, ValidateScript era, ConcreteBabbage era, Tx era ~ ValidatedTx era, Witnesses era ~ TxWitness era, Embed ( EraRule "UTXOS" era) ( BabbageUTXO era), Environment ( EraRule "UTXOS" era) ~ UtxoEnv era, State ( EraRule "UTXOS" era) ~ UTxOState era, Signal ( EraRule "UTXOS" era) ~ Tx era, Inject ( PredicateFailure ( EraRule "PPUP" era)) ( PredicateFailure ( EraRule "UTXOS" era)), PredicateFailure ( EraRule "UTXO" era) ~ BabbageUtxoPred era, ExtendedUTxO era) => STS ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

( Era era, STS ( BabbageUTXOS era), PredicateFailure ( EraRule "UTXOS" era) ~ UtxosPredicateFailure era, Event ( EraRule "UTXOS" era) ~ Event ( BabbageUTXOS era)) => Embed ( BabbageUTXOS era) ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

( Era era, STS ( BabbageUTXO era), PredicateFailure ( EraRule "UTXO" era) ~ BabbageUtxoPred era, Event ( EraRule "UTXO" era) ~ UtxoEvent era, BaseM ( BabbageUTXOW era) ~ ShelleyBase , PredicateFailure ( BabbageUTXOW era) ~ BabbageUtxowPred era, Event ( BabbageUTXOW era) ~ AlonzoEvent era) => Embed ( BabbageUTXO era) ( BabbageUTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxow

type State ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type Event ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type PredicateFailure ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type BaseM ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type Environment ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type Signal ( BabbageUTXO era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

data BabbageUtxoPred era Source #

Predicate failure for the Babbage Era

Constructors

FromAlonzoUtxoFail !( UtxoPredicateFailure era)
IncorrectTotalCollateralField

The collateral is not equivalent to the total collateral asserted by the transaction

Fields

  • ! Coin

    collateral provided

  • ! Coin

    collateral amount declared in transaction body

BabbageOutputTooSmallUTxO ![( TxOut era, Coin )]

list of supplied transaction outputs that are too small, together with the minimum value for the given output.

Instances

Instances details
( Era era, Eq ( UtxoPredicateFailure era), Eq ( PredicateFailure ( EraRule "UTXO" era)), Eq ( TxOut era), Eq ( Script era)) => Eq ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

( Era era, Show ( UtxoPredicateFailure era), Show ( PredicateFailure ( EraRule "UTXO" era)), Show ( TxOut era), Show ( Script era)) => Show ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

( Era era, Typeable era, ToCBOR ( TxOut era), ToCBOR ( Value era), ToCBOR ( PredicateFailure ( EraRule "UTXOS" era)), ToCBOR ( PredicateFailure ( EraRule "UTXO" era)), ToCBOR ( Script era), Typeable ( AuxiliaryData era)) => ToCBOR ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

( Era era, Typeable era, FromCBOR ( TxOut era), FromCBOR ( Value era), FromCBOR ( PredicateFailure ( EraRule "UTXOS" era)), FromCBOR ( PredicateFailure ( EraRule "UTXO" era)), Typeable ( Script era), Typeable ( AuxiliaryData era)) => FromCBOR ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

NoThunks ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

Inject ( UtxoPredicateFailure era) ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

Inject ( PredicateFailure ( EraRule "PPUP" era)) ( PredicateFailure ( EraRule "UTXOS" era)) => Inject ( UtxoPredicateFailure era) ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

Inject ( PredicateFailure ( EraRule "PPUP" era)) ( PredicateFailure ( EraRule "UTXOS" era)) => Inject ( UtxoPredicateFailure era) ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

Inject ( BabbageUtxoPred era) ( BabbageUtxoPred era) Source #
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

feesOK :: forall era. ( Era era, Tx era ~ ValidatedTx era, TxBody era ~ TxBody era, TxOut era ~ TxOut era, HasField "collateral" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "_minfeeA" ( PParams era) Natural , HasField "_minfeeB" ( PParams era) Natural , HasField "_collateralPercentage" ( PParams era) Natural , HasField "collateralReturn" ( TxBody era) ( StrictMaybe ( TxOut era)), HasField "_prices" ( PParams era) Prices , HasField "txrdmrs" ( Witnesses era) ( Redeemers era), HasField "totalCollateral" ( TxBody era) ( StrictMaybe Coin )) => PParams era -> Tx era -> UTxO era -> Test ( BabbageUtxoPred era) Source #

feesOK is a predicate with several parts. Some parts only apply in special circumstances. 1) The fee paid is >= the minimum fee 2) If the total ExUnits are 0 in both Memory and Steps, no further part needs to be checked. 3) The collateral consists only of VKey addresses 4) The collateral inputs do not contain any non-ADA part 5) The collateral is sufficient to cover the appropriate percentage of the fee marked in the transaction 6) The collateral is equivalent to total collateral asserted by the transaction 7) There is at least one collateral input

feesOK can differ from Era to Era, as new notions of fees arise. This is the Babbage version See: Figure 2: Functions related to fees and collateral, in the Babbage specification In the spec feesOK is a boolean function. Because wee need to handle predicate failures in the implementaion, it is coded as a Test. Which is a validation. This version is generic in that it can be lifted to any PredicateFailure type that embeds BabbageUtxoPred era. This makes it possibly useful in future Eras.

utxoTransition :: forall era. ( Era era, ValidateScript era, ConcreteBabbage era, STS ( BabbageUTXO era), Embed ( EraRule "UTXOS" era) ( BabbageUTXO era), Environment ( EraRule "UTXOS" era) ~ UtxoEnv era, State ( EraRule "UTXOS" era) ~ UTxOState era, Signal ( EraRule "UTXOS" era) ~ Tx era, Inject ( PredicateFailure ( EraRule "PPUP" era)) ( PredicateFailure ( EraRule "UTXOS" era)), ExtendedUTxO era) => TransitionRule ( BabbageUTXO era) Source #

The UTxO transition rule for the Babbage eras.