consensus-diffusion-test
Safe HaskellNone
LanguageHaskell2010

Test.Consensus.Genesis.Setup

Synopsis

Documentation

castHeaderHashChainHash (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.

honestImmutableTipGetHeader 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'Testable prop ⇒ SchedulerConfigGenesisTestFull 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.

selectedHonestChainGetHeader 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.