Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- delegTraceFromBlock ∷ ∀ era. (ChainProperty era, ShelleyEraTxBody era, EraSegWits era) ⇒ ChainState era → Block (BHeader MockCrypto) era → (DelegEnv era, Trace (ShelleyDELEG era))
- forAllChainTrace ∷ ∀ era prop. (Testable prop, EraGen era, HasTrace (CHAIN era) (GenEnv era), EraGov era) ⇒ Word64 → Constants → (Trace (CHAIN era) → prop) → Property
- ledgerTraceFromBlock ∷ ∀ era ledger. (ChainProperty era, EraSegWits era, TestingLedger era ledger) ⇒ ChainState era → Block (BHeader MockCrypto) era → (ChainState era, Trace ledger)
- ledgerTraceFromBlockWithRestrictedUTxO ∷ ∀ era ledger. (ChainProperty era, EraSegWits era, TestingLedger era ledger) ⇒ ChainState era → Block (BHeader MockCrypto) era → (UTxO era, Trace ledger)
- chainSstWithTick ∷ ∀ era. ChainProperty era ⇒ Trace (CHAIN era) → [SourceSignalTarget (CHAIN era)]
- poolTraceFromBlock ∷ ∀ era. (ChainProperty era, ShelleyEraTxBody era, EraSegWits era) ⇒ ChainState era → Block (BHeader MockCrypto) era → (ChainState era, Trace (ShelleyPOOL era))
- type TestingLedger era ledger = (BaseM ledger ~ ReaderT Globals Identity, Environment ledger ~ LedgerEnv era, State ledger ~ LedgerState era, Signal ledger ~ Tx era, Embed (EraRule "DELEGS" era) ledger, Embed (EraRule "UTXOW" era) ledger, STS ledger)
- splitTrace ∷ (State s → State s → Bool) → Trace s → [Trace s]
- forEachEpochTrace ∷ ∀ era prop. (EraGen era, Testable prop, HasTrace (CHAIN era) (GenEnv era), EraGov era) ⇒ Int → Word64 → Constants → (Trace (CHAIN era) → prop) → Property
- traceLen ∷ Word64
- longTraceLen ∷ Word64
- shortChainTrace ∷ ∀ era. (EraGen era, HasTrace (CHAIN era) (GenEnv era), EraGov era) ⇒ Constants → (SourceSignalTarget (CHAIN era) → Property) → Property
Documentation
delegTraceFromBlock ∷ ∀ era. (ChainProperty era, ShelleyEraTxBody era, EraSegWits era) ⇒ ChainState era → Block (BHeader MockCrypto) era → (DelegEnv era, Trace (ShelleyDELEG era)) Source #
Reconstruct a DELEG trace from all the transaction certificates in a Block
forAllChainTrace ∷ ∀ era prop. (Testable prop, EraGen era, HasTrace (CHAIN era) (GenEnv era), EraGov era) ⇒ Word64 → Constants → (Trace (CHAIN era) → prop) → Property Source #
ledgerTraceFromBlock ∷ ∀ era ledger. (ChainProperty era, EraSegWits era, TestingLedger era ledger) ⇒ ChainState era → Block (BHeader MockCrypto) era → (ChainState era, Trace ledger) Source #
Reconstruct a LEDGER trace from the transactions in a Block and ChainState
ledgerTraceFromBlockWithRestrictedUTxO ∷ ∀ era ledger. (ChainProperty era, EraSegWits era, TestingLedger era ledger) ⇒ ChainState era → Block (BHeader MockCrypto) era → (UTxO era, Trace ledger) Source #
This function is nearly the same as ledgerTraceFromBlock, but it restricts the UTxO state to only those needed by the block. It also returns the unused UTxO for comparison later.
chainSstWithTick ∷ ∀ era. ChainProperty era ⇒ Trace (CHAIN era) → [SourceSignalTarget (CHAIN era)] Source #
Transform the [(source, signal, target)] of a CHAIN Trace by manually applying the Chain TICK Rule to each source and producing [(source, signal, target')].
This allows for testing properties on Chain traces while excluding the effects of Transactions and Certificates. For example we can check that pools that are due for retirement at an epoch transition, are indeed retired.
Had we not excluded the effects of Transactions/Certificates, we might have a pool that was correctly retired, but is again registered by a certificate in the block following the transition.
poolTraceFromBlock ∷ ∀ era. (ChainProperty era, ShelleyEraTxBody era, EraSegWits era) ⇒ ChainState era → Block (BHeader MockCrypto) era → (ChainState era, Trace (ShelleyPOOL era)) Source #
Reconstruct a POOL trace from the transactions in a Block and ChainState
type TestingLedger era ledger = (BaseM ledger ~ ReaderT Globals Identity, Environment ledger ~ LedgerEnv era, State ledger ~ LedgerState era, Signal ledger ~ Tx era, Embed (EraRule "DELEGS" era) ledger, Embed (EraRule "UTXOW" era) ledger, STS ledger) Source #
splitTrace ∷ (State s → State s → Bool) → Trace s → [Trace s] Source #
Split a Trace into several shorter traces. The leftmost Trace
(at the front of the list) might be ill-formed, depending on what p
does.