Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data PropGeneralArgs blk = PropGeneralArgs {
- pgaBlockProperty ∷ blk → Property
- pgaCountTxs ∷ blk → Word64
- pgaExpectedCannotForge ∷ SlotNo → NodeId → WrapCannotForge blk → Bool
- pgaFirstBlockNo ∷ BlockNo
- pgaFixedMaxForkLength ∷ Maybe NumBlocks
- pgaFixedSchedule ∷ Maybe LeaderSchedule
- pgaSecurityParam ∷ SecurityParam
- pgaTestConfig ∷ TestConfig
- pgaTestConfigB ∷ TestConfigB blk
- calcFinalIntersectionDepth ∷ ∀ blk. HasHeader blk ⇒ PropGeneralArgs blk → TestOutput blk → NumBlocks
- prop_general ∷ ∀ blk. (Condense blk, Condense (HeaderHash blk), Eq blk, RunNode blk) ⇒ PropGeneralArgs blk → TestOutput blk → Property
- prop_general_semisync ∷ ∀ blk. (Condense blk, Condense (HeaderHash blk), Eq blk, RunNode blk) ⇒ PropGeneralArgs blk → TestOutput blk → Property
- prop_inSync ∷ ∀ blk. HasHeader blk ⇒ TestOutput blk → Property
- runTestNetwork ∷ ∀ blk. (RunNode blk, TxGen blk, TracingConstraints blk, HasCallStack) ⇒ TestConfig → TestConfigB blk → (∀ m. IOLike m ⇒ TestConfigMB m blk) → TestOutput blk
- data TestConfig = TestConfig {}
- data TestConfigB blk = TestConfigB {}
- data TestConfigMB m blk = TestConfigMB {
- nodeInfo ∷ CoreNodeId → TestNodeInitialization m blk
- mkRekeyM ∷ Maybe (m (RekeyM m blk))
- truncateNodeJoinPlan ∷ NodeJoinPlan → NumCoreNodes → (NumSlots, NumSlots) → NodeJoinPlan
- truncateNodeRestarts ∷ NodeRestarts → NumSlots → NodeRestarts
- truncateNodeTopology ∷ NodeTopology → NumCoreNodes → NodeTopology
- noExpectedCannotForges ∷ SlotNo → NodeId → WrapCannotForge blk → Bool
- data ForgeEbbEnv blk = ForgeEbbEnv {
- forgeEBB ∷ TopLevelConfig blk → SlotNo → BlockNo → ChainHash blk → blk
- data TestOutput blk = TestOutput {
- testOutputNodes ∷ Map NodeId (NodeOutput blk)
- testOutputTipBlockNos ∷ Map SlotNo (Map NodeId (WithOrigin BlockNo))
- noCalcMessageDelay ∷ CalcMessageDelay blk
- plainTestNodeInitialization ∷ ProtocolInfo blk → m [BlockForging m blk] → TestNodeInitialization m blk
Documentation
data PropGeneralArgs blk Source #
PropGeneralArgs | |
|
calcFinalIntersectionDepth ∷ ∀ blk. HasHeader blk ⇒ PropGeneralArgs blk → TestOutput blk → NumBlocks Source #
What was the most number of signed blocks needed to be dropped from a final chain in order to reach the final chains' common prefix?
NOTE: This count excludes EBBs.
prop_general ∷ ∀ blk. (Condense blk, Condense (HeaderHash blk), Eq blk, RunNode blk) ⇒ PropGeneralArgs blk → TestOutput blk → Property Source #
prop_general_semisync ∷ ∀ blk. (Condense blk, Condense (HeaderHash blk), Eq blk, RunNode blk) ⇒ PropGeneralArgs blk → TestOutput blk → Property Source #
Like prop_general
but instead assuming semi-synchrony
For now, this simply disables a few Property
s that depend on synchrony.
prop_inSync ∷ ∀ blk. HasHeader blk ⇒ TestOutput blk → Property Source #
All final chains have the same block number
runTestNetwork ∷ ∀ blk. (RunNode blk, TxGen blk, TracingConstraints blk, HasCallStack) ⇒ TestConfig → TestConfigB blk → (∀ m. IOLike m ⇒ TestConfigMB m blk) → TestOutput blk Source #
Thin wrapper around runThreadNetwork
TestConfig
data TestConfig Source #
Test configuration that does not depend on the block
The primary motivation for separating this type from TestConfigB
and
TestConfigMB
is so that the instance
can be
reused by multiple tests using different Arbitrary
TestConfig
blk
s: as of yet, no block
(each of which realizes a ledger-protocol combination) influences the
validity of these data.
TestConfig | |
|
Instances
Arbitrary TestConfig Source # | |
Defined in Test.ThreadNet.General arbitrary ∷ Gen TestConfig Source # shrink ∷ TestConfig → [TestConfig] Source # | |
Show TestConfig Source # | |
Defined in Test.ThreadNet.General |
data TestConfigB blk Source #
Test configuration that depends on the block (incl the ledger and/or protocol) but not on the monad
Some fields do not explicitly involve the blk
type, but their semantics
(at least their validity) does depend on the semantics of the underlying
ledger and/or protocol. For example, nodeJoinPlan
is here instead of in
TestConfig
because different blocks can withstand different degrees of
absence/lateness. And epochSize
is here because eg the Byron ledger
assumes a fixed epoch size of 10k
. And so on.
TestConfigB | |
|
Instances
(Show (TxGenExtra blk), Show (BlockNodeToNodeVersion blk)) ⇒ Show (TestConfigB blk) Source # | |
Defined in Test.ThreadNet.General showsPrec ∷ Int → TestConfigB blk → ShowS # show ∷ TestConfigB blk → String # showList ∷ [TestConfigB blk] → ShowS # |
data TestConfigMB m blk Source #
Test configuration that depends on the block and the monad
The primary motivation for separating this type from TestConfigB
is so
that TestConfigB
can occur in contexts (such as in PropGeneralArgs
) for
which the m
parameter is irrelevant and hence unknown.
TestConfigMB | |
|
Expected CannotForge
noExpectedCannotForges ∷ SlotNo → NodeId → WrapCannotForge blk → Bool Source #
Expect no CannotForge
s
Re-exports
data ForgeEbbEnv blk Source #
How to forge an EBB
ForgeEbbEnv | |
|
Instances
Show (ForgeEbbEnv blk) Source # | |
Defined in Test.ThreadNet.Network showsPrec ∷ Int → ForgeEbbEnv blk → ShowS # show ∷ ForgeEbbEnv blk → String # showList ∷ [ForgeEbbEnv blk] → ShowS # |
data TestOutput blk Source #
TestOutput | |
|
plainTestNodeInitialization ∷ ProtocolInfo blk → m [BlockForging m blk] → TestNodeInitialization m blk Source #