cardano-ledger-test-9.9.9.9: Testing harness, tests and benchmarks for Shelley style cardano ledgers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Cardano.Ledger.Generic.Trace

Synopsis

Documentation

genRsTxAndModel ∷ ∀ era. Reflect era ⇒ Proof era → IntSlotNoGenRS era (Tx era) Source #

Generate a Tx and an internal Model of the state after the tx has been applied. That model can be used to generate the next Tx

genRsTxSeq ∷ ∀ era. Reflect era ⇒ Proof era → IntInt → [(StrictSeq (Tx era), SlotNo)] → SlotNoGenRS era (Vector (StrictSeq (Tx era), SlotNo)) Source #

Generate a Vector of (StrictSeq (Tx era)) representing a (Vector Block)

genTxSeq ∷ ∀ era. Reflect era ⇒ Proof era → GenSizeIntGenRS era () → Gen (Vector (StrictSeq (Tx era), SlotNo), GenState era) Source #

Generate a Vector of Blocks, and an initial LedgerState

makeEpochStateReflect era ⇒ GenState era → LedgerState era → EpochState era Source #

pcSmallUTxOEraTx era ⇒ Proof era → MUtxo era → [Tx era] → PDoc Source #

Turn a UTxO into a smaller UTxO, with only entries mentioned in the inputs of txs , then pretty print it.

raiseMockError ∷ ∀ era. Reflect era ⇒ Word64SlotNoEpochState era → NonEmpty (MockChainFailure era) → [Tx era] → GenState era → String Source #

showBlock ∷ ∀ era. Reflect era ⇒ MUtxo era → [Tx era] → PDoc Source #

shortTxOutEraTxOut era ⇒ Proof era → TxOut era → PDoc Source #

smartTxBodyReflect era ⇒ Proof era → MUtxo era → TxBody era → PDoc Source #

data Gen1 era Source #

Constructors

Gen1 (Vector (StrictSeq (Tx era), SlotNo)) (GenState era) 

Instances

Instances details
(STS (MOCKCHAIN era), Reflect era) ⇒ HasTrace (MOCKCHAIN era) (Gen1 era) Source # 
Instance details

Defined in Test.Cardano.Ledger.Generic.Trace

Associated Types

type BaseEnv (MOCKCHAIN era) Source #

Methods

interpretSTSHasCallStackBaseEnv (MOCKCHAIN era) → BaseM (MOCKCHAIN era) a → a Source #

envGenGen1 era → Gen (Environment (MOCKCHAIN era)) Source #

sigGenGen1 era → Environment (MOCKCHAIN era) → State (MOCKCHAIN era) → Gen (Signal (MOCKCHAIN era)) Source #

shrinkSignalSignal (MOCKCHAIN era) → [Signal (MOCKCHAIN era)] Source #

mapProportionEpochNoWord64IntMap k IntGen k Source #

genTrace ∷ ∀ era. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → IntGenSizeGenRS era () → Gen (Trace (MOCKCHAIN era)) Source #

traceProp ∷ ∀ era prop. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → IntGenSize → (MockChainState era → MockChainState era → prop) → Gen prop Source #

forEachEpochTrace ∷ ∀ era prop. (Testable prop, Reflect era) ⇒ Proof era → IntGenSize → (Trace (MOCKCHAIN era) → prop) → Gen Property Source #

forAllTraceFromInitState Source #

Arguments

∷ ∀ sts traceGenEnv prop. (HasTrace sts traceGenEnv, Testable prop, Show (Environment sts)) 
BaseEnv sts 
Word64

Maximum trace length.

→ traceGenEnv 
Maybe (IRC sts → Gen (Either (NonEmpty (PredicateFailure sts)) (State sts)))

Optional generator of STS initial state

→ (Trace sts → prop) 
Property 

Check a property on the sts traces.

Takes an optional generator for initial state of the STS.

testPropMaxTestable prop ⇒ IntString → prop → TestTree Source #

We are making smoke tests, testing for smoke rather than fire. Under the assumption that shorter tests have advantages like not getting turned off because the tests take too long. A glaring failure is likely to be caught in n tests, rather than the standard '100'

chainTest ∷ ∀ era. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era), Eq (StashedAVVMAddresses era)) ⇒ Proof era → IntGenSizeTestTree Source #

multiEpochTest ∷ (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → IntGenSizeTestTree Source #

Show that Ada is preserved across multiple Epochs

mainIO () Source #

data TT where Source #

Constructors

TTProof era → [(StrictSeq (Tx era), SlotNo)] → TT 

showVector ∷ (∀ era. Proof era → [Tx era] → SlotNoPDoc) → IO () Source #

main3IO () Source #

main2IO () Source #

displayStableInfoIO () Source #

display information about stable fields if the only action is to initStableFields