ouroboros-consensus-test-0.1.0.0: Tests of the consensus layer
Safe HaskellNone
LanguageHaskell2010

Test.ThreadNet.Network

Description

Setup network

Synopsis

Documentation

newtype CalcMessageDelay blk Source #

Compute the chain diffusion delay

This is the number of slots a MsgRollForward should arrive after the forge slot of the header it is carrying.

It may depend on the (sender, recipient), the current slot, and header.

Constructors

CalcMessageDelay ((CoreNodeId, CoreNodeId) → SlotNoHeader blk → NumSlots) 

Instances

Instances details
Show (CalcMessageDelay blk) Source #

This type occurs in records where most of the fields are data

Instance details

Defined in Test.ThreadNet.Network

data ForgeEbbEnv blk Source #

How to forge an EBB

Constructors

ForgeEbbEnv 

Fields

Instances

Instances details
Show (ForgeEbbEnv blk) Source # 
Instance details

Defined in Test.ThreadNet.Network

type RekeyM m blk Source #

Arguments

 = CoreNodeId 
ProtocolInfo m blk 
SlotNo

The slot in which the node is rekeying

→ (SlotNo → m EpochNo)

Which epoch the slot is in

→ m (TestNodeInitialization m blk)

tniProtocolInfo should include new delegation cert/operational key, and tniCrucialTxs should include the new delegation certificate transaction

How to rekey a node with a fresh operational key

When there is a NodeRekey scheduled in the NodeRestarts, the test node will restart and use tnaRekeyM to compute its new ProtocolInfo.

data TestNodeInitialization m blk Source #

Data used when starting/restarting a node

Constructors

TestNodeInitialization 

Fields

  • tniCrucialTxs ∷ [GenTx blk]

    these transactions are added immediately and repeatedly (whenever the ledgerTipSlot changes)

    In particular, a leading node's crucial transactions must (if valid) enter its mempool each slot before the node takes the mempool snapshot that determines which transactions will be included in the block it's about to forge.

  • tniProtocolInfoProtocolInfo m blk
     

runThreadNetwork ∷ ∀ m blk. (IOLike m, MonadTime m, MonadTimer m, RunNode blk, TxGen blk, TracingConstraints blk, HasCallStack) ⇒ SystemTime m → ThreadNetworkArgs m blk → m (TestOutput blk) Source #

Setup a network of core nodes, where each joins according to the node join plan and is interconnected according to the node topology

We run for the specified number of blocks, then return the final state of each node.

Tracers

Test Output

data NodeDBs db Source #

A vector with an element for each database of a node

The db type parameter is instantiated by this module at types for mock filesystems; either the MockFS type or reference cells thereof.

Constructors

NodeDBs 

Fields

Instances

Instances details
Functor NodeDBs Source # 
Instance details

Defined in Test.Util.ChainDB

Methods

fmap ∷ (a → b) → NodeDBs a → NodeDBs b Source #

(<$) ∷ a → NodeDBs b → NodeDBs a Source #

Foldable NodeDBs Source # 
Instance details

Defined in Test.Util.ChainDB

Methods

foldMonoid m ⇒ NodeDBs m → m Source #

foldMapMonoid m ⇒ (a → m) → NodeDBs a → m Source #

foldMap'Monoid m ⇒ (a → m) → NodeDBs a → m Source #

foldr ∷ (a → b → b) → b → NodeDBs a → b Source #

foldr' ∷ (a → b → b) → b → NodeDBs a → b Source #

foldl ∷ (b → a → b) → b → NodeDBs a → b Source #

foldl' ∷ (b → a → b) → b → NodeDBs a → b Source #

foldr1 ∷ (a → a → a) → NodeDBs a → a Source #

foldl1 ∷ (a → a → a) → NodeDBs a → a Source #

toListNodeDBs a → [a] Source #

nullNodeDBs a → Bool Source #

lengthNodeDBs a → Int Source #

elemEq a ⇒ a → NodeDBs a → Bool Source #

maximumOrd a ⇒ NodeDBs a → a Source #

minimumOrd a ⇒ NodeDBs a → a Source #

sumNum a ⇒ NodeDBs a → a Source #

productNum a ⇒ NodeDBs a → a Source #

Traversable NodeDBs Source # 
Instance details

Defined in Test.Util.ChainDB

Methods

traverseApplicative f ⇒ (a → f b) → NodeDBs a → f (NodeDBs b) Source #

sequenceAApplicative f ⇒ NodeDBs (f a) → f (NodeDBs a) Source #

mapMMonad m ⇒ (a → m b) → NodeDBs a → m (NodeDBs b) Source #

sequenceMonad m ⇒ NodeDBs (m a) → m (NodeDBs a) Source #