ouroboros-network:sim-tests-lib
Safe HaskellNone
LanguageHaskell2010

Test.Ouroboros.Network.MockNode

Synopsis

Documentation

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

Block generator should generate blocks in the correct slot time.

coreToRelaySim Source #

Arguments

:: (MonadDelay m, MonadFork m, MonadLabelledSTM m, MonadSay m, MonadThrow 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 () 

coreToRelaySim2 Source #

Arguments

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

slot length

-> DiffTime

core transport delay

-> DiffTime

relay transport delay

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

networkGraphSim Source #

Arguments

:: (MonadDelay m, MonadLabelledSTM m, MonadFork m, MonadThrow m, MonadSay m, MonadTimer m) 
=> TestNetworkGraph 
-> DiffTime

slot duration

-> DiffTime

core transport delay

-> DiffTime

relay transport delay

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

type Probe (m :: Type -> Type) 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 #