cardano-ledger-alonzo-test- Tests for Cardano ledger introducing Plutus Core
Safe HaskellSafe-Inferred



AlonzoEra instances for EraGen and ScriptClass



vKeyLockedAdaOnlyCrypto c ⇒ TxOut (AlonzoEra c) → Bool Source #

We are choosing new TxOut to pay fees, We want only Key locked addresss with Ada only values.

genAlonzoMintCrypto c ⇒ MultiAsset c → Gen (MultiAsset c, [AlonzoScript (AlonzoEra c)]) Source #

Gen a Mint value in the Alonzo Era, with a 10% chance that it includes an AlonzoScript

genPairGen a → Gen b → Gen (a, b) Source #

genSetOrd a ⇒ Gen a → Gen (Set a) Source #

okAsCollateral ∷ ∀ c. Mock c ⇒ UTxO (AlonzoEra c) → TxIn c → Bool Source #

genAlonzoPParamsUpdate ∷ ∀ c. Crypto c ⇒ ConstantsPParams (AlonzoEra c) → Gen (PParamsUpdate (AlonzoEra c)) Source #

Gen an Alonzo PParamsUpdate, by adding to a Shelley PParamsData

sumCollateral ∷ (EraTx era, AlonzoEraTxBody era) ⇒ Tx era → UTxO era → Coin Source #

storageCost ∷ ∀ era t. (EraPParams era, EncCBOR t) ⇒ IntegerPParams era → t → Coin Source #

getDataMap ∷ ∀ era. Era era ⇒ ScriptInfo era → Map (ScriptHash (EraCrypto era)) (Script era) → Map (DataHash (EraCrypto era)) (Data era) Source #

dataFromAddr ∷ ∀ c. Mock c ⇒ Addr c → StrictMaybe (DataHash c) Source #

If an Address is script address, we can find a potential data hash for it from genEraTwoPhase3Arg, which contains all known 3 arg plutus scripts in the tests set. If the script has is not in that map, then its data hash is SNothing.

dataMapFromTxOut ∷ ∀ c. Mock c ⇒ [TxOut (AlonzoEra c)] → TxDats (AlonzoEra c) → TxDats (AlonzoEra c) Source #

We can find the data associated with the data hashes in the TxOuts, since genEraTwoPhase3Arg, which contains all known 3 arg plutus scripts stores the data.

someLeaf ∷ ∀ era. (AllegraEraScript era, NativeScript era ~ Timelock era) ⇒ Proxy era → KeyHash 'Witness (EraCrypto era) → AlonzoScript era Source #

langsUsedAlonzoEraScript era ⇒ Map (ScriptHash (EraCrypto era)) (Script era) → Set Language Source #

given the "txscripts" field of the TxWits, compute the set of languages used in a transaction

Orphan instances

Mock c ⇒ EraGen (AlonzoEra c) Source # 
Instance details


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

genEraTwoPhase3Arg ∷ [TwoPhase3ArgInfo (AlonzoEra c)] Source #

genEraTwoPhase2Arg ∷ [TwoPhase2ArgInfo (AlonzoEra c)] Source #

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

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

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

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

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

genEraPParamsConstantsGen (PParams (AlonzoEra c)) Source #

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

genEraGoodTxOutTxOut (AlonzoEra c) → Bool Source #

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

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

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

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

hasFailedScriptsTx (AlonzoEra c) → Bool Source #

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

Mock c ⇒ MinGenTxout (AlonzoEra c) Source # 
Instance details

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