ouroboros-network-0.10.1.0: A networking layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Ouroboros.Network.MockNode

Synopsis

Documentation

tests :: TestTree Source #

partitionProbe :: [(NodeId, a)] -> Map NodeId [a] Source #

test_blockGenerator :: forall m. (MonadDelay m, MonadFork m, MonadSTM m, MonadTime m, MonadTimer m) => Chain Block -> DiffTime -> m Property Source #

Block generator should generate blocks in the correct slot time.

prop_blockGenerator_ST :: TestBlockChain -> Positive Micro -> Property Source #

prop_blockGenerator_IO :: TestBlockChain -> Positive Int -> Property Source #

coreToRelaySim Source #

Arguments

:: (MonadDelay m, MonadFork m, MonadSTM m, MonadSay m, MonadThrow m, MonadTime m, MonadTimer m) 
=> Bool

two way subscription

-> Chain Block 
-> DiffTime

slot duration

-> DiffTime

core transport delay

-> DiffTime

relay transport delay

-> Probe m (NodeId, Chain Block) 
-> m () 

data TestNodeSim Source #

Constructors

TestNodeSim 

Fields

coreToRelaySim2 Source #

Arguments

:: (MonadDelay m, MonadSTM m, MonadFork m, MonadThrow m, MonadSay m, MonadTime m, MonadTimer m) 
=> Chain Block 
-> DiffTime

slot length

-> DiffTime

core transport delay

-> DiffTime

relay transport delay

-> Probe m (NodeId, Chain Block) 
-> m () 

connectGraphG :: Graph -> Gen Graph Source #

networkGraphSim Source #

Arguments

:: forall m. (MonadDelay m, MonadSTM m, MonadFork m, MonadThrow m, MonadSay m, MonadTime m, MonadTimer m) 
=> TestNetworkGraph 
-> DiffTime

slot duration

-> DiffTime

core transport delay

-> DiffTime

relay transport delay

-> Probe m (NodeId, Chain Block) 
-> m () 

arbitraryAcyclicGraph :: Gen Int -> Gen Int -> Float -> Gen Graph Source #

type Probe m x = StrictTVar m [x] Source #

Where returning results directly is not convenient, we can build up a trace of events we want to observe, and can do probe output from multiple threads.

withProbe :: MonadSTM m => (Probe m x -> m ()) -> m [x] Source #

probeOutput :: MonadSTM m => Probe m x -> x -> m () Source #