Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data PeerSimulatorComponent
- data PeerSimulatorComponentResult blk
- = SomeChainSyncClientResult (Either SomeException (ChainSyncClientResult, Maybe (ChainSyncResult blk)))
- | SomeChainSyncServerResult (Either SomeException (Maybe (ChainSyncResult blk)))
- | SomeBlockFetchClientResult (Either SomeException (Maybe (BlockFetchResult blk)))
- | SomeBlockFetchServerResult (Either SomeException (Maybe (BlockFetchResult blk)))
- data PeerSimulatorResult blk = PeerSimulatorResult {}
- data StateView blk = StateView {
- svSelectedChain ∷ AnchoredFragment (Header blk)
- svPeerSimulatorResults ∷ [PeerSimulatorResult blk]
- svTipBlock ∷ Maybe blk
- svTrace ∷ [TraceEvent blk]
- data StateViewTracers blk m = StateViewTracers {
- svtPeerSimulatorResultsTracer ∷ Tracer m (PeerSimulatorResult blk)
- svtGetPeerSimulatorResults ∷ m [PeerSimulatorResult blk]
- svtTraceTracer ∷ Tracer m (TraceEvent blk)
- svtGetTracerTrace ∷ m [TraceEvent blk]
- collectDisconnectedPeers ∷ StateView blk → [PeerId]
- defaultStateViewTracers ∷ IOLike m ⇒ m (StateViewTracers blk m)
- exceptionsByComponent ∷ PeerSimulatorComponent → StateView blk → [SomeException]
- pscrToException ∷ PeerSimulatorComponentResult blk → Maybe SomeException
- snapshotStateView ∷ IOLike m ⇒ StateViewTracers blk m → ChainDB m blk → m (StateView blk)
- stateViewTracersWithInitial ∷ IOLike m ⇒ [PeerSimulatorResult blk] → m (StateViewTracers blk m)
Documentation
data PeerSimulatorComponent Source #
Instances
data PeerSimulatorComponentResult blk Source #
SomeChainSyncClientResult (Either SomeException (ChainSyncClientResult, Maybe (ChainSyncResult blk))) | |
SomeChainSyncServerResult (Either SomeException (Maybe (ChainSyncResult blk))) | |
SomeBlockFetchClientResult (Either SomeException (Maybe (BlockFetchResult blk))) | |
SomeBlockFetchServerResult (Either SomeException (Maybe (BlockFetchResult blk))) |
Instances
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.
Instances
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).
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.
StateViewTracers | |
|
collectDisconnectedPeers ∷ StateView blk → [PeerId] Source #
Return the list of peer ids for all peers whose ChainSync thread or BlockFetch thread was terminated.
defaultStateViewTracers ∷ IOLike m ⇒ m (StateViewTracers blk m) Source #
Make default state view tracers. The tracers are all freshly initialised and contain no information.
exceptionsByComponent ∷ PeerSimulatorComponent → StateView blk → [SomeException] Source #
Helper to get exceptions from a StateView.
snapshotStateView ∷ IOLike 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.
stateViewTracersWithInitial ∷ IOLike m ⇒ [PeerSimulatorResult blk] → m (StateViewTracers blk m) Source #
Call defaultStateViewTracers
and add the provided results.