cardano-ledger-shelley-0.1.0.0
Safe Haskell None
Language Haskell2010

Cardano.Ledger.Shelley.Rules.Utxow

Synopsis

Documentation

data UTXOW era Source #

Instances

Instances details
( Era era, Tx era ~ Tx era, DSignable ( Crypto era) ( Hash ( Crypto era) EraIndependentTxBody ), HasField "_protocolVersion" ( PParams era) ProtVer , Embed ( EraRule "UTXO" era) ( UTXOW era), Environment ( EraRule "UTXO" era) ~ UtxoEnv era, State ( EraRule "UTXO" era) ~ UTxOState era, Signal ( EraRule "UTXO" era) ~ Tx era, ShelleyStyleWitnessNeeds era) => STS ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

( Era era, STS ( UTXO era), PredicateFailure ( EraRule "UTXO" era) ~ UtxoPredicateFailure era, Event ( EraRule "UTXO" era) ~ UtxoEvent era) => Embed ( UTXO era) ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

( Era era, STS ( UTXOW era), PredicateFailure ( EraRule "UTXOW" era) ~ UtxowPredicateFailure era, Event ( EraRule "UTXOW" era) ~ Event ( UTXOW era)) => Embed ( UTXOW era) ( LEDGER era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

type PredicateFailure ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Event ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type BaseM ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Environment ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Signal ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

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

Defined in Cardano.Ledger.Shelley.Rules.Utxow

data UtxowPredicateFailure era Source #

Instances

Instances details
( Eq ( PredicateFailure ( EraRule "UTXO" era)), Era era) => Eq ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

( Show ( PredicateFailure ( EraRule "UTXO" era)), Era era) => Show ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

Generic ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

( Era era, Typeable ( Script era), Typeable ( AuxiliaryData era), ToCBOR ( PredicateFailure ( EraRule "UTXO" era))) => ToCBOR ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

( Era era, FromCBOR ( PredicateFailure ( EraRule "UTXO" era)), Typeable ( Script era), Typeable ( AuxiliaryData era)) => FromCBOR ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

( NoThunks ( PredicateFailure ( EraRule "UTXO" era)), Era era) => NoThunks ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

PredicateFailure ( EraRule "UTXO" era) ~ UtxoPredicateFailure era => Inject ( UtxoPredicateFailure era) ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

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

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Rep ( UtxowPredicateFailure era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type Rep ( UtxowPredicateFailure era) = D1 (' MetaData "UtxowPredicateFailure" "Cardano.Ledger.Shelley.Rules.Utxow" "cardano-ledger-shelley-0.1.0.0-4LNBTpyKcsy6EW18a3tTt2" ' False ) ((( C1 (' MetaCons "InvalidWitnessesUTXOW" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 [ VKey ' Witness ( Crypto era)])) :+: C1 (' MetaCons "MissingVKeyWitnessesUTXOW" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( WitHashes ( Crypto era))))) :+: ( C1 (' MetaCons "MissingScriptWitnessesUTXOW" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Set ( ScriptHash ( Crypto era))))) :+: ( C1 (' MetaCons "ScriptWitnessNotValidatingUTXOW" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Set ( ScriptHash ( Crypto era))))) :+: C1 (' MetaCons "UtxoFailure" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( PredicateFailure ( EraRule "UTXO" era))))))) :+: (( C1 (' MetaCons "MIRInsufficientGenesisSigsUTXOW" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Set ( KeyHash ' Witness ( Crypto era))))) :+: ( C1 (' MetaCons "MissingTxBodyMetadataHash" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( AuxiliaryDataHash ( Crypto era)))) :+: C1 (' MetaCons "MissingTxMetadata" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( AuxiliaryDataHash ( Crypto era)))))) :+: ( C1 (' MetaCons "ConflictingMetadataHash" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( AuxiliaryDataHash ( Crypto era))) :*: S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( AuxiliaryDataHash ( Crypto era)))) :+: ( C1 (' MetaCons "InvalidMetadata" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "ExtraneousScriptWitnessesUTXOW" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' SourceStrict ' DecidedStrict ) ( Rec0 ( Set ( ScriptHash ( Crypto era)))))))))

newtype UtxowEvent era Source #

Constructors

UtxoEvent ( 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, PredicateFailure s 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 PredicateFailure s 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 ( SNAP era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Snap

type PredicateFailure ( RUPD era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Rupd

type PredicateFailure ( PPUP era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ppup

type PredicateFailure ( UTXO era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxo

type PredicateFailure ( UTXOW era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Utxow

type PredicateFailure ( POOLREAP era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.PoolReap

type PredicateFailure ( POOL era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Pool

type PredicateFailure ( NEWPP era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Newpp

type PredicateFailure ( UPEC era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Upec

type PredicateFailure ( MIR era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Mir

type PredicateFailure ( EPOCH era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Epoch

type PredicateFailure ( DELEG era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Deleg

type PredicateFailure ( DELPL era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Delpl

type PredicateFailure ( DELEGS era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Delegs

type PredicateFailure ( LEDGER era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledger

type PredicateFailure ( LEDGERS era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Ledgers

type PredicateFailure ( BBODY era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Bbody

type PredicateFailure ( NEWEPOCH era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.NewEpoch

type PredicateFailure ( TICKF era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Tick

type PredicateFailure ( TICK era) Source #
Instance details

Defined in Cardano.Ledger.Shelley.Rules.Tick

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 :: forall era utxow. ( Era era, BaseM (utxow era) ~ ShelleyBase , Embed ( EraRule "UTXO" era) (utxow era), Environment ( EraRule "UTXO" era) ~ UtxoEnv era, State ( EraRule "UTXO" era) ~ UTxOState era, Signal ( EraRule "UTXO" era) ~ Tx era, Environment (utxow era) ~ UtxoEnv era, State (utxow era) ~ UTxOState era, Signal (utxow era) ~ Tx era, PredicateFailure (utxow era) ~ UtxowPredicateFailure era, STS (utxow era), ShelleyStyleWitnessNeeds era) => TransitionRule (utxow era) Source #

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

Individual validation steps

validateVerifiedWits :: forall era. ( Era era, HasField "addrWits" ( Tx era) ( Set ( WitVKey ' Witness ( Crypto era))), HasField "bootWits" ( Tx era) ( Set ( BootstrapWitness ( Crypto era))), DSignable ( Crypto era) ( Hash ( Crypto era) EraIndependentTxBody )) => Tx era -> Test ( UtxowPredicateFailure era) Source #

Given a ledger state, determine if the UTxO witnesses in a given transaction are correct.

validateMetadata :: forall era. ( Era era, HasField "_protocolVersion" ( PParams era) ProtVer , ValidateAuxiliaryData era ( Crypto era)) => PParams era -> Tx era -> Test ( UtxowPredicateFailure era) Source #

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

validateMIRInsufficientGenesisSigs :: ( HasField "body" ( Tx era) ( TxBody era), HasField "certs" ( TxBody era) ( StrictSeq ( DCert crypto))) => GenDelegs ( Crypto era) -> Word64 -> WitHashes ( Crypto era) -> Tx era -> Test ( UtxowPredicateFailure era) Source #

check genesis keys signatures for instantaneous rewards certificates

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