Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- genRsTxAndModel ∷ ∀ era. Reflect era ⇒ Proof era → Int → SlotNo → GenRS era (Tx era)
- genRsTxSeq ∷ ∀ era. Reflect era ⇒ Proof era → Int → Int → [(StrictSeq (Tx era), SlotNo)] → SlotNo → GenRS era (Vector (StrictSeq (Tx era), SlotNo))
- genTxSeq ∷ ∀ era. Reflect era ⇒ Proof era → GenSize → Int → GenRS era () → Gen (Vector (StrictSeq (Tx era), SlotNo), GenState era)
- runTest ∷ IO ()
- initialMockChainState ∷ Reflect era ⇒ Proof era → GenState era → MockChainState era
- makeEpochState ∷ Reflect era ⇒ GenState era → LedgerState era → EpochState era
- snaps ∷ EraTxOut era ⇒ LedgerState era → SnapShots
- pcSmallUTxO ∷ EraTx era ⇒ Proof era → MUtxo era → [Tx era] → PDoc
- raiseMockError ∷ ∀ era. Reflect era ⇒ Word64 → SlotNo → EpochState era → NonEmpty (MockChainFailure era) → [Tx era] → GenState era → String
- badScripts ∷ Proof era → [MockChainFailure era] → Set ScriptHash
- showBlock ∷ ∀ era. Reflect era ⇒ MUtxo era → [Tx era] → PDoc
- shortTxOut ∷ EraTxOut era ⇒ Proof era → TxOut era → PDoc
- smartTxBody ∷ Reflect era ⇒ Proof era → MUtxo era → TxBody era → PDoc
- data Gen1 era = Gen1 (Vector (StrictSeq (Tx era), SlotNo)) (GenState era)
- mapProportion ∷ EpochNo → Word64 → Int → Map k Int → Gen k
- chooseIssuer ∷ EpochNo → Word64 → Int → PoolDistr → Gen (KeyHash 'StakePool)
- genTrace ∷ ∀ era. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → Int → GenSize → GenRS era () → Gen (Trace (MOCKCHAIN era))
- traceProp ∷ ∀ era prop. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → Int → GenSize → (MockChainState era → MockChainState era → prop) → Gen prop
- forEachEpochTrace ∷ ∀ era prop. (Testable prop, Reflect era) ⇒ Proof era → Int → GenSize → (Trace (MOCKCHAIN era) → prop) → Gen Property
- forAllTraceFromInitState ∷ ∀ sts traceGenEnv prop. (HasTrace sts traceGenEnv, Testable prop, Show (Environment sts)) ⇒ BaseEnv sts → Word64 → traceGenEnv → Maybe (IRC sts → Gen (Either (NonEmpty (PredicateFailure sts)) (State sts))) → (Trace sts → prop) → Property
- testPropMax ∷ Testable prop ⇒ Int → String → prop → TestTree
- chainTest ∷ ∀ era. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era), Eq (StashedAVVMAddresses era)) ⇒ Proof era → Int → GenSize → TestTree
- testTraces ∷ Int → TestTree
- multiEpochTest ∷ (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → Int → GenSize → TestTree
- main ∷ IO ()
- data TT where
- theVector ∷ IORef TT
- showVector ∷ (∀ era. Proof era → [Tx era] → SlotNo → PDoc) → IO ()
- main3 ∷ IO ()
- main2 ∷ IO ()
- displayStableInfo ∷ IO ()
Documentation
genRsTxAndModel ∷ ∀ era. Reflect era ⇒ Proof era → Int → SlotNo → GenRS 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 → Int → Int → [(StrictSeq (Tx era), SlotNo)] → SlotNo → GenRS era (Vector (StrictSeq (Tx era), SlotNo)) Source #
Generate a Vector of (StrictSeq (Tx era)) representing a (Vector Block)
genTxSeq ∷ ∀ era. Reflect era ⇒ Proof era → GenSize → Int → GenRS era () → Gen (Vector (StrictSeq (Tx era), SlotNo), GenState era) Source #
Generate a Vector of Blocks, and an initial LedgerState
initialMockChainState ∷ Reflect era ⇒ Proof era → GenState era → MockChainState era Source #
makeEpochState ∷ Reflect era ⇒ GenState era → LedgerState era → EpochState era Source #
pcSmallUTxO ∷ EraTx 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 ⇒ Word64 → SlotNo → EpochState era → NonEmpty (MockChainFailure era) → [Tx era] → GenState era → String Source #
badScripts ∷ Proof era → [MockChainFailure era] → Set ScriptHash Source #
Instances
(STS (MOCKCHAIN era), Reflect era) ⇒ HasTrace (MOCKCHAIN era) (Gen1 era) Source # | |
Defined in Test.Cardano.Ledger.Generic.Trace interpretSTS ∷ HasCallStack ⇒ BaseEnv (MOCKCHAIN era) → BaseM (MOCKCHAIN era) a → a Source # envGen ∷ Gen1 era → Gen (Environment (MOCKCHAIN era)) Source # sigGen ∷ Gen1 era → Environment (MOCKCHAIN era) → State (MOCKCHAIN era) → Gen (Signal (MOCKCHAIN era)) Source # shrinkSignal ∷ Signal (MOCKCHAIN era) → [Signal (MOCKCHAIN era)] Source # |
genTrace ∷ ∀ era. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → Int → GenSize → GenRS era () → Gen (Trace (MOCKCHAIN era)) Source #
traceProp ∷ ∀ era prop. (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → Int → GenSize → (MockChainState era → MockChainState era → prop) → Gen prop Source #
forEachEpochTrace ∷ ∀ era prop. (Testable prop, Reflect era) ⇒ Proof era → Int → GenSize → (Trace (MOCKCHAIN era) → prop) → Gen Property Source #
forAllTraceFromInitState Source #
∷ ∀ 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.
testPropMax ∷ Testable prop ⇒ Int → String → 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 → Int → GenSize → TestTree Source #
testTraces ∷ Int → TestTree Source #
multiEpochTest ∷ (Reflect era, HasTrace (MOCKCHAIN era) (Gen1 era)) ⇒ Proof era → Int → GenSize → TestTree Source #
Show that Ada is preserved across multiple Epochs
displayStableInfo ∷ IO () Source #
display information about stable fields if the only action is to initStableFields