cardano-ledger-core-1.22.0.0: Core components of Cardano ledgers from the Shelley release on.
Safe HaskellNone
LanguageHaskell2010

Test.Cardano.Ledger.Era

Synopsis

Documentation

class (EraBlockBody era, EraCertState era, EraGov era, EraStake era, EraUTxO era, EraAccounts era, EraGenesis era, Arbitrary (Tx 'TopTx era), Arbitrary (TxBody 'TopTx era), Arbitrary (TxWits era), Arbitrary (TxOut era), Arbitrary (TxAuxData era), Arbitrary (NativeScript era), Arbitrary (Script era), Arbitrary (PParamsHKD Identity era), Arbitrary (PParamsHKD StrictMaybe era), Arbitrary (TxCert era), Arbitrary (Value era), Arbitrary (CompactForm (Value era)), Arbitrary (CertState era), Arbitrary (GovState era), Arbitrary (InstantStake era), Arbitrary (Accounts era), Arbitrary (AccountState era), ToExpr (Tx 'TopTx era), ToExpr (TxBody 'TopTx era), ToExpr (TxWits era), ToExpr (TxOut era), ToExpr (TxAuxData era), ToExpr (NativeScript era), ToExpr (Script era), ToExpr (PParamsHKD Identity era), ToExpr (PParamsHKD StrictMaybe era), ToExpr (TxCert era), ToExpr (Value era), ToExpr (CompactForm (Value era)), ToExpr (CertState era), ToExpr (GovState era), ToExpr (InstantStake era), ToExpr (Accounts era), ToExpr (AccountState era), DecCBOR (Script era), DecCBOR (NativeScript era), DecCBOR (TxAuxData era), DecCBOR (TxWits era), DecCBOR (TxBody 'TopTx era), DecCBOR (Tx 'TopTx era), Eq (TranslationContext era), Show (TranslationContext era), Typeable (TranslationContext era), ToJSON (TranslationContext era), FromJSON (TranslationContext era), Arbitrary (TranslationContext era), UnliftRules era (EraRulesWithFailures era)) ⇒ EraTest era where Source #

Associated Types

type EraRulesWithFailures era ∷ [Symbol] Source #

All Ledger rules with predicate failures

Methods

zeroCostModels ∷ CostModels Source #

mkTestAccountState ∷ Maybe Ptr → CompactForm Coin → Maybe (KeyHash 'StakePool) → Maybe DRep → AccountState era Source #

This is a helper function that allows for creation of an AccountState in era agnostic fashion. There is no equivalent function outside of testing since arguments required for creation of AccountState varies between eras and we can get away with such function in testing because we allow for such function to be partial.

accountsFromAccountsMap ∷ Map (Credential 'Staking) (AccountState era) → Accounts era Source #

mkEraFullPath ∷ FilePath → IO FilePath Source #

Get the full path for the era directory. An use case for this is for saving golden files in a golden test directory for each era.

exampleTx ∷ Tx 'TopTx era Source #

Example transaction that needs to be provided for each era. Doesn't need to be valid, but all possible fields must be set to some example value.

examplePParams ∷ PParams era Source #

Example PParams used for testing. All possible fields must be set.

examplePParamsUpdate ∷ PParamsUpdate era Source #

Example PParamsUpdate used for testing. All possible fields must be set.

class EraTest era ⇒ EraSpec era where Source #

Methods

eraImpSpec ∷ Proxy era → Spec Source #

All of Imp spec that is applicable to this era

ledgerEraTestMain Source #

Arguments

∷ EraSpec era 
⇒ Spec

Tests that are specific to this era, if any.

→ IO () 

This is the main entry point for every era's test suite. It contains all tests that must be supplied by each era through EraSpec type class and then some through the extra argument

registerTestAccount ∷ (HasCallStack, EraTest era) ⇒ Credential 'Staking → Maybe Ptr → CompactForm Coin → Maybe (KeyHash 'StakePool) → Maybe DRep → Accounts era → Accounts era Source #

This is a helper function that uses mkTestAccountState to register an account.