cardano-ledger-shelley-1.12.2.1: Shelley Ledger Executable Model
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Ledger.Shelley.Rules.Utxow

Synopsis

Documentation

data ShelleyUTXOW era Source #

Instances

Instances details
(EraTx era, EraUTxO era, ShelleyEraTxBody era, ScriptsNeeded era ~ ShelleyScriptsNeeded era, DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), Embed (EraRule "UTXO" era) (ShelleyUTXOW era), Environment (EraRule "UTXO" era) ~ UtxoEnv era, State (EraRule "UTXO" era) ~ UTxOState era, Signal (EraRule "UTXO" era) ~ Tx era, EraRule "UTXOW" era ~ ShelleyUTXOW era, InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure era, DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), EraGov era) ⇒ STS (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

(Era era, STS (ShelleyUTXO era), PredicateFailure (EraRule "UTXO" era) ~ ShelleyUtxoPredFailure era, Event (EraRule "UTXO" era) ~ UtxoEvent era) ⇒ Embed (ShelleyUTXO era) (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

(STS (ShelleyUTXOW era), PredicateFailure (EraRule "UTXOW" era) ~ ShelleyUtxowPredFailure era, Event (EraRule "UTXOW" era) ~ Event (ShelleyUTXOW era)) ⇒ Embed (ShelleyUTXOW era) (ShelleyLEDGER era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

type BaseM (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Environment (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Event (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type PredicateFailure (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Signal (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

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

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type State (ShelleyUTXOW era) = UTxOState era

data ShelleyUtxowPredFailure era Source #

Instances

Instances details
InjectRuleFailure "BBODY" ShelleyUtxowPredFailure (ShelleyEra c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Bbody

InjectRuleFailure "LEDGER" ShelleyUtxowPredFailure (ShelleyEra c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

InjectRuleFailure "LEDGERS" ShelleyUtxowPredFailure (ShelleyEra c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledgers

InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure (ShelleyEra c) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

Generic (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

Associated Types

type Rep (ShelleyUtxowPredFailure era) ∷ TypeType Source #

(Show (PredicateFailure (EraRule "UTXO" era)), Era era) ⇒ Show (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

(Era era, DecCBOR (PredicateFailure (EraRule "UTXO" era)), Typeable (Script era), Typeable (TxAuxData era)) ⇒ DecCBOR (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

(Era era, Typeable (Script era), Typeable (TxAuxData era), EncCBOR (PredicateFailure (EraRule "UTXO" era))) ⇒ EncCBOR (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

(NFData (PredicateFailure (EraRule "UTXO" era)), NFData (VerKeyDSIGN (DSIGN (EraCrypto era))), Era era) ⇒ NFData (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

Methods

rnfShelleyUtxowPredFailure era → () Source #

(Eq (PredicateFailure (EraRule "UTXO" era)), Era era) ⇒ Eq (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

(NoThunks (PredicateFailure (EraRule "UTXO" era)), Era era) ⇒ NoThunks (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Rep (ShelleyUtxowPredFailure era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Rep (ShelleyUtxowPredFailure era) = D1 ('MetaData "ShelleyUtxowPredFailure" "Cardano.Ledger.Shelley.Rules.Utxow" "cardano-ledger-shelley-1.12.2.1-inplace" 'False) (((C1 ('MetaCons "InvalidWitnessesUTXOW" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [VKey 'Witness (EraCrypto era)])) :+: C1 ('MetaCons "MissingVKeyWitnessesUTXOW" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (KeyHash 'Witness (EraCrypto era)))))) :+: (C1 ('MetaCons "MissingScriptWitnessesUTXOW" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (ScriptHash (EraCrypto era))))) :+: (C1 ('MetaCons "ScriptWitnessNotValidatingUTXOW" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (ScriptHash (EraCrypto era))))) :+: C1 ('MetaCons "UtxoFailure" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (PredicateFailure (EraRule "UTXO" era))))))) :+: ((C1 ('MetaCons "MIRInsufficientGenesisSigsUTXOW" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set (KeyHash 'Witness (EraCrypto era))))) :+: (C1 ('MetaCons "MissingTxBodyMetadataHash" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AuxiliaryDataHash (EraCrypto era)))) :+: C1 ('MetaCons "MissingTxMetadata" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AuxiliaryDataHash (EraCrypto era)))))) :+: (C1 ('MetaCons "ConflictingMetadataHash" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AuxiliaryDataHash (EraCrypto era))) :*: S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (AuxiliaryDataHash (EraCrypto era)))) :+: (C1 ('MetaCons "InvalidMetadata" 'PrefixI 'False) (U1TypeType) :+: C1 ('MetaCons "ExtraneousScriptWitnessesUTXOW" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Set (ScriptHash (EraCrypto era)))))))))

newtype ShelleyUtxowEvent era Source #

Constructors

UtxoEvent (Event (EraRule "UTXO" era)) 

Instances

Instances details
Generic (ShelleyUtxowEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

Associated Types

type Rep (ShelleyUtxowEvent era) ∷ TypeType Source #

NFData (Event (EraRule "UTXO" era)) ⇒ NFData (ShelleyUtxowEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

Methods

rnfShelleyUtxowEvent era → () Source #

Eq (Event (EraRule "UTXO" era)) ⇒ Eq (ShelleyUtxowEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Rep (ShelleyUtxowEvent era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Rep (ShelleyUtxowEvent era) = D1 ('MetaData "ShelleyUtxowEvent" "Cardano.Ledger.Shelley.Rules.Utxow" "cardano-ledger-shelley-1.12.2.1-inplace" 'True) (C1 ('MetaCons "UtxoEvent" 'PrefixI 'False) (S1 ('MetaSel ('NothingMaybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Event (EraRule "UTXO" era)))))

type family PredicateFailure a Source #

Descriptive type for the possible failures which might cause a transition to fail.

As a convention, PredicateFailures which are "structural" (meaning that they are not "throwable" in practice, and are used to pass control from one transition rule to another) are prefixed with S_.

Structural PredicateFailures represent conditions between rules where the disjunction of all rules' preconditions is equal to True. That is, either one rule will throw a structural PredicateFailure and the other will succeed, or vice-versa.

Instances

Instances details
type PredicateFailure (ShelleyBBODY era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Bbody

type PredicateFailure (ShelleyDELEG era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Deleg

type PredicateFailure (ShelleyDELEGS era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Delegs

type PredicateFailure (ShelleyDELPL era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Delpl

type PredicateFailure (ShelleyEPOCH era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Epoch

type PredicateFailure (ShelleyLEDGER era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

type PredicateFailure (ShelleyLEDGERS era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledgers

type PredicateFailure (ShelleyMIR era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Mir

type PredicateFailure (ShelleyNEWEPOCH era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.NewEpoch

type PredicateFailure (ShelleyNEWPP era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Newpp

type PredicateFailure (ShelleyPOOL era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Pool

type PredicateFailure (ShelleyPOOLREAP era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.PoolReap

type PredicateFailure (ShelleyPPUP era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ppup

type PredicateFailure (ShelleyRUPD era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Rupd

type PredicateFailure (ShelleySNAP era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Snap

type PredicateFailure (ShelleyTICK era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Tick

type PredicateFailure (ShelleyTICKF era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Tick

type PredicateFailure (ShelleyUPEC era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Upec

type PredicateFailure (ShelleyUTXO era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxo

type PredicateFailure (ShelleyUTXOW era) Source # 
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type PredicateFailure (STUB e st si f m) 
Instance details

Defined in Control.State.Transition.Extended

type PredicateFailure (STUB e st si f m) = f

transitionRulesUTXOW ∷ ∀ era. (EraUTxO era, ShelleyEraTxBody era, ScriptsNeeded era ~ ShelleyScriptsNeeded era, BaseM (EraRule "UTXOW" era) ~ ShelleyBase, Embed (EraRule "UTXO" era) (EraRule "UTXOW" era), Environment (EraRule "UTXO" era) ~ UtxoEnv era, State (EraRule "UTXO" era) ~ UTxOState era, Signal (EraRule "UTXO" era) ~ Tx era, Environment (EraRule "UTXOW" era) ~ UtxoEnv era, State (EraRule "UTXOW" era) ~ UTxOState era, Signal (EraRule "UTXOW" era) ~ Tx era, InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure era, STS (EraRule "UTXOW" era), DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody)) ⇒ TransitionRule (EraRule "UTXOW" era) Source #

A generic Utxow witnessing function designed to be used across many Eras. Note the embed argument lifts from the simple Shelley (ShelleyUtxowPredFailure) to the PredicateFailure (type family) of the context of where it is called.

shelleyWitsVKeyNeeded ∷ ∀ era. (EraTx era, ShelleyEraTxBody era) ⇒ UTxO era → TxBody era → GenDelegs (EraCrypto era) → Set (KeyHash 'Witness (EraCrypto era)) Source #

Deprecated: Use getShelleyWitsVKeyNeeded instead

witsVKeyNeededGov ∷ ∀ era. ShelleyEraTxBody era ⇒ TxBody era → GenDelegs (EraCrypto era) → Set (KeyHash 'Witness (EraCrypto era)) Source #

Deprecated: As unnecessary. Use getWitsVKeyNeeded instead

Collect the set of hashes of keys that needs to sign a given transaction. This set consists of the txin owners, certificate authors, and withdrawal reward accounts.

witsVKeyNeededNoGov ∷ ∀ era. EraTx era ⇒ UTxO era → TxBody era → Set (KeyHash 'Witness (EraCrypto era)) Source #

Deprecated: Use getShelleyWitsVKeyNeededNoGov instead

Individual validation steps

validateVerifiedWits ∷ (EraTx era, DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody)) ⇒ Tx era → Test (ShelleyUtxowPredFailure era) Source #

Determine if the UTxO witnesses in a given transaction are correct.

validateMetadataEraTx era ⇒ PParams era → Tx era → Test (ShelleyUtxowPredFailure era) Source #

check metadata hash ((adh = ◇) ∧ (ad= ◇)) ∨ (adh = hashAD ad)

validateMIRInsufficientGenesisSigs ∷ (EraTx era, ShelleyEraTxBody era) ⇒ GenDelegs (EraCrypto era) → Word64Set (KeyHash 'Witness (EraCrypto era)) → Tx era → Test (ShelleyUtxowPredFailure era) Source #

check genesis keys signatures for instantaneous rewards certificates

genSig := { hashKey gkey | gkey ∈ dom(genDelegs)} ∩ witsKeyHashes { c ∈ txcerts txb ∩ TxCert_mir} ≠ ∅ ⇒ |genSig| ≥ Quorum

validateNeededWitnesses Source #

Arguments

EraUTxO era 
Set (KeyHash 'Witness (EraCrypto era))

Provided witness

CertState era 
UTxO era 
TxBody era 
Test (ShelleyUtxowPredFailure era) 

Verify that we provide at least all of the required witnesses

witsVKeyNeeded utxo tx ⊆ witsKeyHashes

propWitsMaybe (Update era) → GenDelegs (EraCrypto era) → Set (KeyHash 'Witness (EraCrypto era)) Source #

Deprecated: This will become an internal function in the future. Submit an issue if you still need it.

Calculate the set of hash keys of the required witnesses for update proposals.

Orphan instances

InjectRuleFailure "UTXOW" ShelleyPpupPredFailure (ShelleyEra c) Source # 
Instance details

InjectRuleFailure "UTXOW" ShelleyUtxoPredFailure (ShelleyEra c) Source # 
Instance details

(EraTx era, EraUTxO era, ShelleyEraTxBody era, ScriptsNeeded era ~ ShelleyScriptsNeeded era, DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), Embed (EraRule "UTXO" era) (ShelleyUTXOW era), Environment (EraRule "UTXO" era) ~ UtxoEnv era, State (EraRule "UTXO" era) ~ UTxOState era, Signal (EraRule "UTXO" era) ~ Tx era, EraRule "UTXOW" era ~ ShelleyUTXOW era, InjectRuleFailure "UTXOW" ShelleyUtxowPredFailure era, DSignable (EraCrypto era) (Hash (EraCrypto era) EraIndependentTxBody), EraGov era) ⇒ STS (ShelleyUTXOW era) Source # 
Instance details

(Era era, STS (ShelleyUTXO era), PredicateFailure (EraRule "UTXO" era) ~ ShelleyUtxoPredFailure era, Event (EraRule "UTXO" era) ~ UtxoEvent era) ⇒ Embed (ShelleyUTXO era) (ShelleyUTXOW era) Source # 
Instance details