| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Test.Consensus.Genesis.Setup
Synopsis
- module Test.Consensus.Genesis.Setup.GenChains
- castHeaderHash ∷ ChainHash (Header blk) → ChainHash blk
- forAllGenesisTest ∷ ∀ blk prop. (Testable prop, Condense (StateView blk), CondenseList (NodeState blk), ShowProxy blk, ShowProxy (Header blk), ConfigSupportsNode blk, LedgerSupportsProtocol blk, SerialiseDiskConstraints blk, BlockSupportsDiffusionPipelining blk, InspectLedger blk, HasHardForkHistory blk, ConvertRawHash blk, CanUpgradeLedgerTables (LedgerState blk), HasPointScheduleTestParams blk, Eq (Header blk), Eq blk, Terse blk, Condense (NodeState blk)) ⇒ Gen (GenesisTestFull blk) → SchedulerConfig → (GenesisTestFull blk → StateView blk → [GenesisTestFull blk]) → (GenesisTestFull blk → StateView blk → prop) → Property
- honestImmutableTip ∷ GetHeader blk ⇒ GenesisTestFull blk → StateView blk → Bool
- runGenesisTest ∷ (Condense (StateView blk), CondenseList (NodeState blk), ShowProxy blk, ShowProxy (Header blk), ConfigSupportsNode blk, LedgerSupportsProtocol blk, SerialiseDiskConstraints blk, BlockSupportsDiffusionPipelining blk, InspectLedger blk, HasHardForkHistory blk, ConvertRawHash blk, CanUpgradeLedgerTables (LedgerState blk), HasPointScheduleTestParams blk, Eq (Header blk), Eq blk, Terse blk, Condense (NodeState blk)) ⇒ ProtocolInfoArgs blk → SchedulerConfig → GenesisTestFull blk → RunGenesisTestResult blk
- runGenesisTest' ∷ Testable prop ⇒ SchedulerConfig → GenesisTestFull TestBlock → (StateView TestBlock → prop) → Property
- selectedHonestChain ∷ GetHeader blk ⇒ GenesisTestFull blk → StateView blk → Bool
Documentation
castHeaderHash ∷ ChainHash (Header blk) → ChainHash blk Source #
The svSelectedChain produces an 'AnchoredFragment (Header blk)';
this function casts this type's hash to its instance, so that it can be used
for lookups on a BlockTree.
forAllGenesisTest ∷ ∀ blk prop. (Testable prop, Condense (StateView blk), CondenseList (NodeState blk), ShowProxy blk, ShowProxy (Header blk), ConfigSupportsNode blk, LedgerSupportsProtocol blk, SerialiseDiskConstraints blk, BlockSupportsDiffusionPipelining blk, InspectLedger blk, HasHardForkHistory blk, ConvertRawHash blk, CanUpgradeLedgerTables (LedgerState blk), HasPointScheduleTestParams blk, Eq (Header blk), Eq blk, Terse blk, Condense (NodeState blk)) ⇒ Gen (GenesisTestFull blk) → SchedulerConfig → (GenesisTestFull blk → StateView blk → [GenesisTestFull blk]) → (GenesisTestFull blk → StateView blk → prop) → Property Source #
All-in-one helper that generates a GenesisTest and a 'Peers
PeerSchedule', runs them with runGenesisTest, check whether the given
property holds on the resulting StateView.
honestImmutableTip ∷ GetHeader blk ⇒ GenesisTestFull blk → StateView blk → Bool Source #
Check if the immutable tip of the selected chain of a GenesisTest is honest.
In this setting, the immutable tip corresponds to the selected chain anchor
(see getCurrentChain) and
the honest chain is represented by the test BlockTree trunk.
runGenesisTest ∷ (Condense (StateView blk), CondenseList (NodeState blk), ShowProxy blk, ShowProxy (Header blk), ConfigSupportsNode blk, LedgerSupportsProtocol blk, SerialiseDiskConstraints blk, BlockSupportsDiffusionPipelining blk, InspectLedger blk, HasHardForkHistory blk, ConvertRawHash blk, CanUpgradeLedgerTables (LedgerState blk), HasPointScheduleTestParams blk, Eq (Header blk), Eq blk, Terse blk, Condense (NodeState blk)) ⇒ ProtocolInfoArgs blk → SchedulerConfig → GenesisTestFull blk → RunGenesisTestResult blk Source #
Runs the given GenesisTest and PointSchedule and evaluates the given
property on the final StateView.
runGenesisTest' ∷ Testable prop ⇒ SchedulerConfig → GenesisTestFull TestBlock → (StateView TestBlock → prop) → Property Source #
Variant of runGenesisTest that also takes a property on the final
StateView and returns a QuickCheck property. The trace is printed in case
of counter-example.
selectedHonestChain ∷ GetHeader blk ⇒ GenesisTestFull blk → StateView blk → Bool Source #
Check if the tip of the selected chain of a GenesisTest is honest.
In this setting, the honest chain corresponds to the test BlockTree trunk.