cardano-ledger-alonzo-1.10.0.1: Cardano ledger introducing Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Alonzo.Rules.Utxo

Synopsis

Documentation

data AlonzoUTXO era Source #

Instances

Instances details
(EraUTxO era, AlonzoEraTx era, Embed (EraRule "UTXOS" era) (AlonzoUTXO era), Environment (EraRule "UTXOS" era) ~ UtxoEnv era, State (EraRule "UTXOS" era) ~ UTxOState era, Signal (EraRule "UTXOS" era) ~ Tx era, EraRule "UTXO" era ~ AlonzoUTXO era, InjectRuleFailure "UTXO" ShelleyUtxoPredFailure era, InjectRuleFailure "UTXO" AlonzoUtxoPredFailure era, InjectRuleFailure "UTXO" AllegraUtxoPredFailure era, ProtVerAtMost era 8) ⇒ STS (AlonzoUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

Associated Types

type State (AlonzoUTXO era) Source #

type Signal (AlonzoUTXO era) Source #

type Environment (AlonzoUTXO era) Source #

type BaseM (AlonzoUTXO era) ∷ TypeType Source #

type Event (AlonzoUTXO era) Source #

type PredicateFailure (AlonzoUTXO era) Source #

(Era era, STS (AlonzoUTXO era), PredicateFailure (EraRule "UTXO" era) ~ AlonzoUtxoPredFailure era, Event (EraRule "UTXO" era) ~ AlonzoUtxoEvent era, BaseM (AlonzoUTXOW era) ~ ShelleyBase, PredicateFailure (AlonzoUTXOW era) ~ AlonzoUtxowPredFailure era, Event (AlonzoUTXOW era) ~ AlonzoUtxowEvent era) ⇒ Embed (AlonzoUTXO era) (AlonzoUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxow

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

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type BaseM (AlonzoUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Environment (AlonzoUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Environment (AlonzoUTXO era) = UtxoEnv era
type Event (AlonzoUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type PredicateFailure (AlonzoUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Signal (AlonzoUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Signal (AlonzoUTXO era) = Tx era
type State (AlonzoUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type State (AlonzoUTXO era) = UTxOState era

data AlonzoUtxoPredFailure era Source #

Constructors

BadInputsUTxO !(Set (TxIn (EraCrypto era)))

The bad transaction inputs

OutsideValidityIntervalUTxO 

Fields

MaxTxSizeUTxO 

Fields

InputSetEmptyUTxO 
FeeTooSmallUTxO 

Fields

  • !Coin

    the minimum fee for this transaction

  • !Coin

    the fee supplied in this transaction

ValueNotConservedUTxO 

Fields

  • !(Value era)

    the Coin consumed by this transaction

  • !(Value era)

    the Coin produced by this transaction

WrongNetwork

the set of addresses with incorrect network IDs

Fields

WrongNetworkWithdrawal 

Fields

OutputTooSmallUTxO ![TxOut era]

list of supplied transaction outputs that are too small

UtxosFailure (PredicateFailure (EraRule "UTXOS" era))

Subtransition Failures

OutputBootAddrAttrsTooBig ![TxOut era]

list of supplied bad transaction outputs

TriesToForgeADA 
OutputTooBigUTxO ![(Integer, Integer, TxOut era)]

list of supplied bad transaction output triples (actualSize,PParameterMaxValue,TxOut)

InsufficientCollateral 

Fields

  • !DeltaCoin

    balance computed

  • !Coin

    the required collateral for the given fee

ScriptsNotPaidUTxO !(UTxO era)

The UTxO entries which have the wrong kind of script

ExUnitsTooBigUTxO 

Fields

CollateralContainsNonADA !(Value era)

The inputs marked for use as fees contain non-ADA tokens

WrongNetworkInTxBody

Wrong Network ID in body

Fields

OutsideForecast !SlotNo

slot number outside consensus forecast range

TooManyCollateralInputs

There are too many collateral inputs

Fields

  • !Natural

    Max allowed collateral inputs

  • !Natural

    Number of collateral inputs

NoCollateralInputs 

Instances

Instances details
InjectRuleFailure "BBODY" AlonzoUtxoPredFailure (AlonzoEra c) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Bbody

InjectRuleFailure "LEDGER" AlonzoUtxoPredFailure (AlonzoEra c) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Ledger

InjectRuleFailure "LEDGERS" AlonzoUtxoPredFailure (AlonzoEra c) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Ledgers

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

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

InjectRuleFailure "UTXOW" AlonzoUtxoPredFailure (AlonzoEra c) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxow

Generic (AlonzoUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

Associated Types

type Rep (AlonzoUtxoPredFailure era) ∷ TypeType Source #

(Era era, Show (Value era), Show (TxOut era), Show (TxBody era), Show (PredicateFailure (EraRule "UTXOS" era))) ⇒ Show (AlonzoUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

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

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

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

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

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

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

Methods

rnfAlonzoUtxoPredFailure era → () Source #

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

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

(NoThunks (Value era), NoThunks (UTxO era), NoThunks (PredicateFailure (EraRule "UTXOS" era)), NoThunks (TxOut era)) ⇒ NoThunks (AlonzoUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Rep (AlonzoUtxoPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Rep (AlonzoUtxoPredFailure era) = D1 ('MetaData "AlonzoUtxoPredFailure" "Cardano.Ledger.Alonzo.Rules.Utxo" "cardano-ledger-alonzo-1.10.0.1-inplace" 'False) ((((C1 ('MetaCons "BadInputsUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (TxIn (EraCrypto era))))) :+: C1 ('MetaCons "OutsideValidityIntervalUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ValidityInterval) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo))) :+: (C1 ('MetaCons "MaxTxSizeUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer)) :+: (C1 ('MetaCons "InputSetEmptyUTxO" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "FeeTooSmallUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin))))) :+: ((C1 ('MetaCons "ValueNotConservedUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Value era)) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Value era))) :+: C1 ('MetaCons "WrongNetwork" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (Addr (EraCrypto era)))))) :+: (C1 ('MetaCons "WrongNetworkWithdrawal" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (RewardAccount (EraCrypto era))))) :+: (C1 ('MetaCons "OutputTooSmallUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [TxOut era])) :+: C1 ('MetaCons "UtxosFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PredicateFailure (EraRule "UTXOS" era)))))))) :+: (((C1 ('MetaCons "OutputBootAddrAttrsTooBig" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [TxOut era])) :+: C1 ('MetaCons "TriesToForgeADA" 'PrefixI 'False) (U1TypeType)) :+: (C1 ('MetaCons "OutputTooBigUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [(Integer, Integer, TxOut era)])) :+: (C1 ('MetaCons "InsufficientCollateral" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DeltaCoin) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Coin)) :+: C1 ('MetaCons "ScriptsNotPaidUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (UTxO era)))))) :+: ((C1 ('MetaCons "ExUnitsTooBigUTxO" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ExUnits) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ExUnits)) :+: (C1 ('MetaCons "CollateralContainsNonADA" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Value era))) :+: C1 ('MetaCons "WrongNetworkInTxBody" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Network)))) :+: (C1 ('MetaCons "OutsideForecast" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SlotNo)) :+: (C1 ('MetaCons "TooManyCollateralInputs" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural)) :+: C1 ('MetaCons "NoCollateralInputs" 'PrefixI 'False) (U1TypeType))))))

newtype AlonzoUtxoEvent era Source #

Constructors

UtxosEvent (Event (EraRule "UTXOS" era)) 

Instances

Instances details
Generic (AlonzoUtxoEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

Associated Types

type Rep (AlonzoUtxoEvent era) ∷ TypeType Source #

NFData (Event (EraRule "UTXOS" era)) ⇒ NFData (AlonzoUtxoEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

Methods

rnfAlonzoUtxoEvent era → () Source #

Eq (Event (EraRule "UTXOS" era)) ⇒ Eq (AlonzoUtxoEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Rep (AlonzoUtxoEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Alonzo.Rules.Utxo

type Rep (AlonzoUtxoEvent era) = D1 ('MetaData "AlonzoUtxoEvent" "Cardano.Ledger.Alonzo.Rules.Utxo" "cardano-ledger-alonzo-1.10.0.1-inplace" 'True) (C1 ('MetaCons "UtxosEvent" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Event (EraRule "UTXOS" era)))))

validateExUnitsTooBigUTxO ∷ (AlonzoEraTxWits era, EraTx era, AlonzoEraPParams era) ⇒ PParams era → Tx era → Test (AlonzoUtxoPredFailure era) Source #

Ensure that execution units to not exceed the maximum allowed maxTxExUnits parameter.

totExunits tx ≤ maxTxExUnits pp

validateOutputTooBigUTxO ∷ (EraTxOut era, AlonzoEraPParams era, Foldable f) ⇒ PParams era → f (TxOut era) → Test (AlonzoUtxoPredFailure era) Source #

Ensure that there are no TxOuts that have Value of size larger than MaxValSize. We use serialized length of Value because this Value size is being limited inside a serialized Tx.

∀ txout ∈ txouts txb, serSize (getValue txout) ≤ maxValSize pp

validateOutsideForecast Source #

Arguments

∷ (MaryEraTxBody era, AlonzoEraTxWits era, EraTx era) 
EpochInfo (Either a) 
SlotNo

Current slot number

SystemStart 
Tx era 
Test (AlonzoUtxoPredFailure era) 

If tx has non-native scripts, end of validity interval must translate to time

(_,i_f) := txvldt tx
◇ ∉ { txrdmrs tx, i_f } ⇒ epochInfoSlotToUTCTime epochInfo systemTime i_f ≠ ◇

validateTooManyCollateralInputsAlonzoEraTxBody era ⇒ PParams era → TxBody era → Test (AlonzoUtxoPredFailure era) Source #

Ensure that number of collaterals does not exceed the allowed maxCollInputs parameter.

‖collateral tx‖  ≤  maxCollInputs pp

validateWrongNetworkInTxBodyAlonzoEraTxBody era ⇒ NetworkTxBody era → Test (AlonzoUtxoPredFailure era) Source #

Ensure if NetworkId is present in the txbody it matches the global NetworkId

(txnetworkid txb = NetworkId) ∨ (txnetworkid txb = ◇)

vKeyLockedEraTxOut era ⇒ TxOut era → Bool Source #

Orphan instances

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

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

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

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

(EraUTxO era, AlonzoEraTx era, Embed (EraRule "UTXOS" era) (AlonzoUTXO era), Environment (EraRule "UTXOS" era) ~ UtxoEnv era, State (EraRule "UTXOS" era) ~ UTxOState era, Signal (EraRule "UTXOS" era) ~ Tx era, EraRule "UTXO" era ~ AlonzoUTXO era, InjectRuleFailure "UTXO" ShelleyUtxoPredFailure era, InjectRuleFailure "UTXO" AlonzoUtxoPredFailure era, InjectRuleFailure "UTXO" AllegraUtxoPredFailure era, ProtVerAtMost era 8) ⇒ STS (AlonzoUTXO era) Source # 
Instance details

Associated Types

type State (AlonzoUTXO era) Source #

type Signal (AlonzoUTXO era) Source #

type Environment (AlonzoUTXO era) Source #

type BaseM (AlonzoUTXO era) ∷ TypeType Source #

type Event (AlonzoUTXO era) Source #

type PredicateFailure (AlonzoUTXO era) Source #

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