ouroboros-consensus
Safe HaskellNone
LanguageHaskell2010

Test.Consensus.Genesis.Setup

Synopsis

Documentation

newtype AdjustTestCount Source #

A ConformanceTest field type for the adjustment of required number of test runs.

Constructors

AdjustTestCount (IntInt) 

newtype AdjustMaxSize Source #

A ConformanceTest field type for maximum test case size adjustment.

Constructors

AdjustMaxSize (IntInt) 

data ConformanceTest blk Source #

Contains all necessary data to run a GenesisTest. It is defined to reify the testing infrastructure for the conformance testgen executable.

Constructors

ConformanceTest 

Fields

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.

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.

mkConformanceTest Source #

Arguments

Testable prop 
String

Test description.

AdjustTestCount

Adjustment of the default number of required test runs.

AdjustMaxSize

Adjustment of the default maximum test size.

Gen (GenesisTestFull blk)

Test generator.

SchedulerConfig

Peer simulator scheduler configuration.

→ (GenesisTestFull blk → StateView blk → [GenesisTestFull blk])

Result inspecting shrinker.

→ (GenesisTestFull blk → StateView blk → prop)

Property on test result.

ConformanceTest blk 

runConformanceTest ∷ (Condense (StateView blk), CondenseList (NodeState blk), ShowProxy blk, ShowProxy (Header blk), ConfigSupportsNode blk, LedgerSupportsProtocol blk, LedgerSupportsPeras 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)) ⇒ ConformanceTest blk → TestTree Source #

All-in-one helper that generates a GenesisTest and a 'Peers PeerSchedule' from a ConformanceTest, runs them with runGenesisTest, and checks whether the given property holds on the resulting StateView.

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.