cardano-ledger-shelley-ma-test-1.4.0.3: Shelley ledger with multiasset and time lock support.
Safe HaskellNone
LanguageHaskell2010

Test.Cardano.Ledger.AllegraEraGen

Synopsis

Documentation

someLeaf ∷ AllegraEraScript era ⇒ KeyHash 'Witness → NativeScript era Source #

Generate some Leaf Timelock (i.e. a Signature or TimeStart or TimeExpire).

Because we don't know how these "leaf scripts" will be situated in larger scripts (e.g. the script generated here might form part of a RequireAll or RequireMOf script) we must make sure that all timelocks generated here are valid for all slots.

To achieve this we arrange the timelock scripts like so: RequireAnyOf [ RequireAllOf [RequireTimeExpire k, RequireSignature x], RequireAllOf [RequireTimeStart k, RequireSignature x] ] where k is arbitrary. This means that regardless of slot, there will be a valid sub-branch of script.

genValidityInterval ∷ SlotNo → Gen ValidityInterval Source #

Generates a trivial validity interval that is valid for the current slot.

Note: the validity interval must be a subset of all timelock script intervals that apply to the transaction. This depends on which generated scripts are actually required to validate the transaction (which is itself not always deterministic, e.g. 'RequireMOf n scripts').

A more sophisticated generator would compute which set of scripts would validate the transaction, and from that compute a minimal ValidityInterval that fits into all timelock slot ranges.

Orphan instances

EraGen AllegraEra Source # 
Instance details

Methods

genGenesisValue ∷ GenEnv c AllegraEra → Gen (Value AllegraEra) Source #

genEraTwoPhase3Arg ∷ [TwoPhase3ArgInfo AllegraEra] Source #

genEraTwoPhase2Arg ∷ [TwoPhase2ArgInfo AllegraEra] Source #

genEraTxBody ∷ GenEnv c AllegraEra → UTxO AllegraEra → PParams AllegraEra → SlotNo → Set TxIn → StrictSeq (TxOut AllegraEra) → StrictSeq (TxCert AllegraEra) → Withdrawals → Coin → StrictMaybe (Update AllegraEra) → StrictMaybe TxAuxDataHash → Gen (TxBody 'TopTx AllegraEra, [Script AllegraEra]) Source #

genEraAuxiliaryData ∷ Constants → Gen (StrictMaybe (TxAuxData AllegraEra)) Source #

updateEraTxBody ∷ UTxO AllegraEra → PParams AllegraEra → TxWits AllegraEra → TxBody 'TopTx AllegraEra → Coin → Set TxIn → TxOut AllegraEra → TxBody 'TopTx AllegraEra Source #

addInputs ∷ TxBody 'TopTx AllegraEra → Set TxIn → TxBody 'TopTx AllegraEra Source #

genEraPParamsUpdate ∷ Constants → PParams AllegraEra → Gen (PParamsUpdate AllegraEra) Source #

genEraPParams ∷ Constants → Gen (PParams AllegraEra) Source #

genEraTxWits ∷ (UTxO AllegraEra, TxBody 'TopTx AllegraEra, ScriptInfo AllegraEra) → Set (WitVKey 'Witness) → Map ScriptHash (Script AllegraEra) → TxWits AllegraEra Source #

genEraGoodTxOut ∷ TxOut AllegraEra → Bool Source #

constructTx ∷ TxBody 'TopTx AllegraEra → TxWits AllegraEra → StrictMaybe (TxAuxData AllegraEra) → Tx 'TopTx AllegraEra Source #

genEraScriptCost ∷ PParams AllegraEra → Script AllegraEra → Coin Source #

genEraDone ∷ UTxO AllegraEra → PParams AllegraEra → Tx 'TopTx AllegraEra → Gen (Tx 'TopTx AllegraEra) Source #

genEraTweakBlock ∷ PParams AllegraEra → Seq (Tx 'TopTx AllegraEra) → Gen (Seq (Tx 'TopTx AllegraEra)) Source #

hasFailedScripts ∷ Tx 'TopTx AllegraEra → Bool Source #

feeOrCollateral ∷ Tx 'TopTx AllegraEra → UTxO AllegraEra → Coin Source #

MinGenTxout AllegraEra Source # 
Instance details

ScriptClass AllegraEra Source # 
Instance details