consensus-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Consensus.PeerSimulator.StateView

Synopsis

Documentation

data PeerSimulatorComponentResult blk Source #

data PeerSimulatorResult blk Source #

A record to associate an exception thrown by a thread running a component of the peer simulator with the peer that it was running for.

data StateView blk Source #

A state view is a partial view of the state of the whole peer simulator. This includes information about the part of the code that is being tested (for instance the fragment that is selected by the ChainDB) but also information about the mocked peers (for instance the exceptions raised in the mocked ChainSync server threads).

Constructors

StateView 

Fields

Instances

Instances details
Condense (StateView TestBlock) Source # 
Instance details

Defined in Test.Consensus.PeerSimulator.StateView

data StateViewTracers blk m Source #

State view tracers are a lightweight mechanism to record information that can later be used to produce a state view. This mechanism relies on contra-tracers which we already use in a pervasives way.

collectDisconnectedPeersStateView blk → [PeerId] Source #

Return the list of peer ids for all peers whose ChainSync thread or BlockFetch thread was terminated.

defaultStateViewTracersIOLike m ⇒ m (StateViewTracers blk m) Source #

Make default state view tracers. The tracers are all freshly initialised and contain no information.

exceptionsByComponentPeerSimulatorComponentStateView blk → [SomeException] Source #

Helper to get exceptions from a StateView.

snapshotStateViewIOLike m ⇒ StateViewTracers blk m → ChainDB m blk → m (StateView blk) Source #

Use the state view tracers as well as some extra information to produce a state view. This mostly consists in reading and storing the current state of the tracers.

stateViewTracersWithInitialIOLike m ⇒ [PeerSimulatorResult blk] → m (StateViewTracers blk m) Source #

Call defaultStateViewTracers and add the provided results.