cardano-ledger-babbage-1.8.2.1: Cardano ledger introducing refrence scripts and inline datums
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Babbage.Rules.Utxo

Synopsis

Documentation

data BabbageUTXO era Source #

Instances

Instances details
(EraTx era, EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, Tx era ~ AlonzoTx era, EraRule "UTXO" era ~ BabbageUTXO era, InjectRuleFailure "UTXO" ShelleyUtxoPredFailure era, InjectRuleFailure "UTXO" AllegraUtxoPredFailure era, InjectRuleFailure "UTXO" AlonzoUtxoPredFailure era, InjectRuleFailure "UTXO" BabbageUtxoPredFailure 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) ⇒ STS (BabbageUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

Associated Types

type State (BabbageUTXO era) Source #

type Signal (BabbageUTXO era) Source #

type Environment (BabbageUTXO era) Source #

type BaseM (BabbageUTXO era) ∷ TypeType Source #

type Event (BabbageUTXO era) Source #

type PredicateFailure (BabbageUTXO era) Source #

(Era era, STS (BabbageUTXO era), PredicateFailure (EraRule "UTXO" era) ~ BabbageUtxoPredFailure era, Event (EraRule "UTXO" era) ~ AlonzoUtxoEvent era, BaseM (BabbageUTXOW era) ~ ShelleyBase, PredicateFailure (BabbageUTXOW era) ~ BabbageUtxowPredFailure era, Event (BabbageUTXOW era) ~ AlonzoUtxowEvent era) ⇒ Embed (BabbageUTXO era) (BabbageUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxow

(Era era, STS (BabbageUTXOS era), PredicateFailure (EraRule "UTXOS" era) ~ AlonzoUtxosPredFailure era, Event (EraRule "UTXOS" era) ~ Event (BabbageUTXOS era)) ⇒ Embed (BabbageUTXOS era) (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 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 Signal (BabbageUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type Signal (BabbageUTXO era) = AlonzoTx era
type State (BabbageUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type State (BabbageUTXO era) = UTxOState era

data BabbageUtxoPredFailure era Source #

Predicate failure for the Babbage Era

Constructors

AlonzoInBabbageUtxoPredFailure !(AlonzoUtxoPredFailure era) 
IncorrectTotalCollateralField

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

Fields

  • !DeltaCoin

    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.

BabbageNonDisjointRefInputs !(NonEmpty (TxIn (EraCrypto era)))

TxIns that appear in both inputs and reference inputs

Instances

Instances details
InjectRuleFailure "BBODY" BabbageUtxoPredFailure (BabbageEra c) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Bbody

InjectRuleFailure "LEDGER" BabbageUtxoPredFailure (BabbageEra c) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Ledger

InjectRuleFailure "LEDGERS" BabbageUtxoPredFailure (BabbageEra c) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Ledgers

InjectRuleFailure "UTXO" BabbageUtxoPredFailure (BabbageEra c) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

InjectRuleFailure "UTXOW" BabbageUtxoPredFailure (BabbageEra c) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxow

Generic (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

Associated Types

type Rep (BabbageUtxoPredFailure era) ∷ TypeType Source #

(Era era, Show (AlonzoUtxoPredFailure era), Show (PredicateFailure (EraRule "UTXO" era)), Show (TxOut era), Show (Script era), Show (TxIn (EraCrypto era))) ⇒ Show (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

(Era era, DecCBOR (TxOut era), DecCBOR (Value era), DecCBOR (PredicateFailure (EraRule "UTXOS" era)), DecCBOR (PredicateFailure (EraRule "UTXO" era)), Typeable (Script era), Typeable (TxAuxData era)) ⇒ DecCBOR (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

(Era era, EncCBOR (TxOut era), EncCBOR (Value era), EncCBOR (PredicateFailure (EraRule "UTXOS" era)), EncCBOR (PredicateFailure (EraRule "UTXO" era)), EncCBOR (Script era), EncCBOR (TxIn (EraCrypto era)), Typeable (TxAuxData era)) ⇒ EncCBOR (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

(Era era, NFData (Value era), NFData (TxOut era), NFData (PredicateFailure (EraRule "UTXOS" era))) ⇒ NFData (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

Methods

rnfBabbageUtxoPredFailure era → () Source #

(Era era, Eq (AlonzoUtxoPredFailure era), Eq (PredicateFailure (EraRule "UTXO" era)), Eq (TxOut era), Eq (Script era), Eq (TxIn (EraCrypto era))) ⇒ Eq (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

NoThunks (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type Rep (BabbageUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Babbage.Rules.Utxo

type Rep (BabbageUtxoPredFailure era) = D1 ('MetaData "BabbageUtxoPredFailure" "Cardano.Ledger.Babbage.Rules.Utxo" "cardano-ledger-babbage-1.8.2.1-inplace" 'False) ((C1 ('MetaCons "AlonzoInBabbageUtxoPredFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AlonzoUtxoPredFailure era))) :+: C1 ('MetaCons "IncorrectTotalCollateralField" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))) :+: (C1 ('MetaCons "BabbageOutputTooSmallUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(TxOut era, Coin)])) :+: C1 ('MetaCons "BabbageNonDisjointRefInputs" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (NonEmpty (TxIn (EraCrypto era)))))))

utxoTransition ∷ ∀ era. (EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, Tx era ~ AlonzoTx era, InjectRuleFailure "UTXO" ShelleyUtxoPredFailure era, InjectRuleFailure "UTXO" AllegraUtxoPredFailure era, InjectRuleFailure "UTXO" AlonzoUtxoPredFailure era, InjectRuleFailure "UTXO" BabbageUtxoPredFailure era, Environment (EraRule "UTXO" era) ~ UtxoEnv era, State (EraRule "UTXO" era) ~ UTxOState era, Signal (EraRule "UTXO" era) ~ AlonzoTx era, BaseM (EraRule "UTXO" era) ~ ShelleyBase, STS (EraRule "UTXO" era), Embed (EraRule "UTXOS" era) (EraRule "UTXO" era), Environment (EraRule "UTXOS" era) ~ UtxoEnv era, State (EraRule "UTXOS" era) ~ UTxOState era, Signal (EraRule "UTXOS" era) ~ Tx era) ⇒ TransitionRule (EraRule "UTXO" era) Source #

The UTxO transition rule for the Babbage eras.

feesOK ∷ ∀ era rule. (EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, InjectRuleFailure rule AlonzoUtxoPredFailure era, InjectRuleFailure rule BabbageUtxoPredFailure era) ⇒ PParams era → Tx era → UTxO era → Test (EraRuleFailure rule 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.

Orphan instances

InjectRuleFailure "UTXO" AllegraUtxoPredFailure (BabbageEra c) Source # 
Instance details

InjectRuleFailure "UTXO" AlonzoUtxoPredFailure (BabbageEra c) Source # 
Instance details

InjectRuleFailure "UTXO" AlonzoUtxosPredFailure (BabbageEra c) Source # 
Instance details

InjectRuleFailure "UTXO" ShelleyPpupPredFailure (BabbageEra c) Source # 
Instance details

InjectRuleFailure "UTXO" ShelleyUtxoPredFailure (BabbageEra c) Source # 
Instance details

(EraTx era, EraUTxO era, BabbageEraTxBody era, AlonzoEraTxWits era, Tx era ~ AlonzoTx era, EraRule "UTXO" era ~ BabbageUTXO era, InjectRuleFailure "UTXO" ShelleyUtxoPredFailure era, InjectRuleFailure "UTXO" AllegraUtxoPredFailure era, InjectRuleFailure "UTXO" AlonzoUtxoPredFailure era, InjectRuleFailure "UTXO" BabbageUtxoPredFailure 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) ⇒ STS (BabbageUTXO era) Source # 
Instance details

Associated Types

type State (BabbageUTXO era) Source #

type Signal (BabbageUTXO era) Source #

type Environment (BabbageUTXO era) Source #

type BaseM (BabbageUTXO era) ∷ TypeType Source #

type Event (BabbageUTXO era) Source #

type PredicateFailure (BabbageUTXO era) Source #

(Era era, STS (BabbageUTXOS era), PredicateFailure (EraRule "UTXOS" era) ~ AlonzoUtxosPredFailure era, Event (EraRule "UTXOS" era) ~ Event (BabbageUTXOS era)) ⇒ Embed (BabbageUTXOS era) (BabbageUTXO era) Source # 
Instance details