cardano-ledger-shelley-ma-test-1.2.2.4: Shelley ledger with multiasset and time lock support.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.AllegraEraGen

Synopsis

Documentation

someLeaf ∷ ∀ era. (AllegraEraScript era, NativeScript era ~ Timelock era) ⇒ KeyHash 'Witness (EraCrypto era) → 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.

genValidityIntervalSlotNoGen 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

Crypto c ⇒ EraGen (AllegraEra c) Source # 
Instance details

Methods

genGenesisValueGenEnv (AllegraEra c) → Gen (Value (AllegraEra c)) Source #

genEraTwoPhase3Arg ∷ [TwoPhase3ArgInfo (AllegraEra c)] Source #

genEraTwoPhase2Arg ∷ [TwoPhase2ArgInfo (AllegraEra c)] Source #

genEraTxBodyGenEnv (AllegraEra c) → UTxO (AllegraEra c) → PParams (AllegraEra c) → SlotNoSet (TxIn (EraCrypto (AllegraEra c))) → StrictSeq (TxOut (AllegraEra c)) → StrictSeq (TxCert (AllegraEra c)) → Withdrawals (EraCrypto (AllegraEra c)) → CoinStrictMaybe (Update (AllegraEra c)) → StrictMaybe (AuxiliaryDataHash (EraCrypto (AllegraEra c))) → Gen (TxBody (AllegraEra c), [Script (AllegraEra c)]) Source #

genEraAuxiliaryDataConstantsGen (StrictMaybe (TxAuxData (AllegraEra c))) Source #

updateEraTxBodyUTxO (AllegraEra c) → PParams (AllegraEra c) → TxWits (AllegraEra c) → TxBody (AllegraEra c) → CoinSet (TxIn (EraCrypto (AllegraEra c))) → TxOut (AllegraEra c) → TxBody (AllegraEra c) Source #

addInputsTxBody (AllegraEra c) → Set (TxIn (EraCrypto (AllegraEra c))) → TxBody (AllegraEra c) Source #

genEraPParamsUpdateConstantsPParams (AllegraEra c) → Gen (PParamsUpdate (AllegraEra c)) Source #

genEraPParamsConstantsGen (PParams (AllegraEra c)) Source #

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

genEraGoodTxOutTxOut (AllegraEra c) → Bool Source #

constructTxTxBody (AllegraEra c) → TxWits (AllegraEra c) → StrictMaybe (TxAuxData (AllegraEra c)) → Tx (AllegraEra c) Source #

genEraScriptCostPParams (AllegraEra c) → Script (AllegraEra c) → Coin Source #

genEraDoneUTxO (AllegraEra c) → PParams (AllegraEra c) → Tx (AllegraEra c) → Gen (Tx (AllegraEra c)) Source #

genEraTweakBlockPParams (AllegraEra c) → Seq (Tx (AllegraEra c)) → Gen (Seq (Tx (AllegraEra c))) Source #

hasFailedScriptsTx (AllegraEra c) → Bool Source #

feeOrCollateralTx (AllegraEra c) → UTxO (AllegraEra c) → Coin Source #

Crypto c ⇒ MinGenTxout (AllegraEra c) Source # 
Instance details

Crypto c ⇒ ScriptClass (AllegraEra c) Source # 
Instance details