consensus-test
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Consensus.PeerSimulator.StateDiagram

Description

A pretty-printer and tracer that shows the current peer simulator state in a block tree, highlighting the candidate fragments, selection, and forks in different colors, omitting uninteresting segments.

Synopsis

Documentation

peerSimStateDiagramSTMTracerIOLike m ⇒ Tracer m StringBlockTree TestBlockSTM m (AnchoredFragment (Header TestBlock)) → STM m (Map PeerId (AnchoredFragment (Header TestBlock))) → STM m (Map PeerId (Maybe (NodeState TestBlock))) → m (Tracer m ()) Source #

Construct a stateful tracer that prints the current peer simulator state in a block tree, highlighting the candidate fragments, selection, and forks in different colors, omitting uninteresting segments.

Since the tracer gets its input from concurrent state, it takes only a dummy () value as its argument.

peerSimStateDiagramSTMTracerDebugIOLike m ⇒ BlockTree TestBlockSTM m (AnchoredFragment (Header TestBlock)) → STM m (Map PeerId (AnchoredFragment (Header TestBlock))) → STM m (Map PeerId (Maybe (NodeState TestBlock))) → m (Tracer m ()) Source #

Construct a stateful tracer that prints the current peer simulator state in a block tree, highlighting the candidate fragments, selection, and forks in different colors, omitting uninteresting segments.

Since the tracer gets its input from concurrent state, it takes only a dummy () value as its argument.

This variant uses the global debug tracer.

peerSimStateDiagramTracerTracer m StringTracer m PeerSimState Source #

Construct a tracer that prints the current peer simulator state in a block tree, highlighting the candidate fragments, selection, and forks in different colors, omitting uninteresting segments.

peerSimStateDiagramWithRenderConfigPeerSimState → (String, Map PeerId Word64) Source #

Pretty-print the current peer simulator state in a block tree, highlighting the candidate fragments, selection, and forks in different colors, omitting uninteresting segments.