Skip to content

Commit

Permalink
Reset "balance" on SnapshotDone
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jul 27, 2021
1 parent ec21c5c commit 3e64582
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Hydra/Tail/Simulation.hs
Expand Up @@ -188,6 +188,13 @@ analyzeSimulation notify trace = do
, sl
)
)
(_threadLabel, Time _t, TraceClient (TraceClientSnapshotDone clientId)) ->
( \(!m, !sl) ->
pure
( Map.alter (updateBalance (const 0)) clientId m
, sl
)
)
(_threadLabel, _time, TraceClient (TraceClientWakeUp sl')) ->
( \(!m, !sl) ->
if sl' > sl
Expand Down Expand Up @@ -635,6 +642,7 @@ runClient tracer events serverId opts Client{multiplexer, identifier} = do
threadDelay settlementDelay_
sendTo multiplexer serverId SnapshotDone
pure st
traceWith tracer (TraceClientSnapshotDone identifier)
(nodeId, msg) ->
throwIO $ UnexpectedClientMsg nodeId msg
where
Expand Down Expand Up @@ -728,6 +736,7 @@ data TraceClient
| TraceClientWakeUp SlotNo
| TraceClientAck ClientId MockTx
| TraceClientNotify ClientId MockTx
| TraceClientSnapshotDone ClientId
deriving (Show)

--
Expand Down

0 comments on commit 3e64582

Please sign in to comment.