Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data UTXOW era
-
data
UtxowPredicateFailure
era
- = InvalidWitnessesUTXOW ![ VKey ' Witness ( Crypto era)]
- | MissingVKeyWitnessesUTXOW !( WitHashes ( Crypto era))
- | MissingScriptWitnessesUTXOW !( Set ( ScriptHash ( Crypto era)))
- | ScriptWitnessNotValidatingUTXOW !( Set ( ScriptHash ( Crypto era)))
- | UtxoFailure ( PredicateFailure ( EraRule "UTXO" era))
- | MIRInsufficientGenesisSigsUTXOW ( Set ( KeyHash ' Witness ( Crypto era)))
- | MissingTxBodyMetadataHash !( AuxiliaryDataHash ( Crypto era))
- | MissingTxMetadata !( AuxiliaryDataHash ( Crypto era))
- | ConflictingMetadataHash !( AuxiliaryDataHash ( Crypto era)) !( AuxiliaryDataHash ( Crypto era))
- | InvalidMetadata
- | ExtraneousScriptWitnessesUTXOW !( Set ( ScriptHash ( Crypto era)))
- newtype UtxowEvent era = UtxoEvent ( Event ( EraRule "UTXO" era))
- type family PredicateFailure a
- 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)
- type ShelleyStyleWitnessNeeds era = ( HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "addrWits" ( Tx era) ( Set ( WitVKey ' Witness ( Crypto era))), HasField "bootWits" ( Tx era) ( Set ( BootstrapWitness ( Crypto era))), HasField "update" ( TxBody era) ( StrictMaybe ( Update era)), HasField "_protocolVersion" ( PParams era) ProtVer , ValidateAuxiliaryData era ( Crypto era), ValidateScript era, DSignable ( Crypto era) ( Hash ( Crypto era) EraIndependentTxBody ))
- validateFailedScripts :: forall era. ValidateScript era => Tx era -> Test ( UtxowPredicateFailure era)
- validateMissingScripts :: forall era. HasField "_protocolVersion" ( PParams era) ProtVer => PParams era -> Set ( ScriptHash ( Crypto era)) -> Set ( ScriptHash ( Crypto era)) -> Test ( UtxowPredicateFailure era)
- 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)
- validateMetadata :: forall era. ( Era era, HasField "_protocolVersion" ( PParams era) ProtVer , ValidateAuxiliaryData era ( Crypto era)) => PParams era -> Tx era -> Test ( UtxowPredicateFailure era)
- 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)
- validateNeededWitnesses :: ( UTxO era -> Tx era -> GenDelegs ( Crypto era) -> WitHashes ( Crypto era)) -> GenDelegs ( Crypto era) -> UTxO era -> Tx era -> WitHashes ( Crypto era) -> Test ( UtxowPredicateFailure era)
Documentation
Instances
data UtxowPredicateFailure era Source #
InvalidWitnessesUTXOW ![ VKey ' Witness ( Crypto era)] | |
MissingVKeyWitnessesUTXOW !( WitHashes ( Crypto era)) | |
MissingScriptWitnessesUTXOW !( Set ( ScriptHash ( Crypto era))) | |
ScriptWitnessNotValidatingUTXOW !( Set ( ScriptHash ( Crypto era))) | |
UtxoFailure ( PredicateFailure ( EraRule "UTXO" era)) | |
MIRInsufficientGenesisSigsUTXOW ( Set ( KeyHash ' Witness ( Crypto era))) | |
MissingTxBodyMetadataHash !( AuxiliaryDataHash ( Crypto era)) | |
MissingTxMetadata !( AuxiliaryDataHash ( Crypto era)) | |
ConflictingMetadataHash !( AuxiliaryDataHash ( Crypto era)) !( AuxiliaryDataHash ( Crypto era)) | |
InvalidMetadata | |
ExtraneousScriptWitnessesUTXOW !( Set ( ScriptHash ( Crypto era))) |
Instances
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
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.
type ShelleyStyleWitnessNeeds era = ( HasField "certs" ( TxBody era) ( StrictSeq ( DCert ( Crypto era))), HasField "inputs" ( TxBody era) ( Set ( TxIn ( Crypto era))), HasField "wdrls" ( TxBody era) ( Wdrl ( Crypto era)), HasField "addrWits" ( Tx era) ( Set ( WitVKey ' Witness ( Crypto era))), HasField "bootWits" ( Tx era) ( Set ( BootstrapWitness ( Crypto era))), HasField "update" ( TxBody era) ( StrictMaybe ( Update era)), HasField "_protocolVersion" ( PParams era) ProtVer , ValidateAuxiliaryData era ( Crypto era), ValidateScript era, DSignable ( Crypto era) ( Hash ( Crypto era) EraIndependentTxBody )) Source #
Individual validation steps
validateFailedScripts :: forall era. ValidateScript era => Tx era -> Test ( UtxowPredicateFailure era) Source #
validateMissingScripts :: forall era. HasField "_protocolVersion" ( PParams era) ProtVer => PParams era -> Set ( ScriptHash ( Crypto era)) -> Set ( ScriptHash ( Crypto era)) -> Test ( UtxowPredicateFailure era) Source #
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