Skip to content

Commit

Permalink
Clean up tracing of the next instruction from CSJ
Browse files Browse the repository at this point in the history
  • Loading branch information
facundominguez committed Apr 23, 2024
1 parent d260957 commit f6cfcff
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Ouroboros.Consensus.Genesis.Governor (DensityBounds (..),
import Ouroboros.Consensus.MiniProtocol.ChainSync.Client
(TraceChainSyncClientEvent (..))
import Ouroboros.Consensus.MiniProtocol.ChainSync.Client.Jumping
(JumpResult (..))
(Instruction (..), JumpResult (..))
import Ouroboros.Consensus.MiniProtocol.ChainSync.Client.State
(ChainSyncJumpingState (..), ChainSyncJumpingJumperState(..))
import Ouroboros.Consensus.Storage.ChainDB.API (LoE (..))
Expand Down Expand Up @@ -372,10 +372,16 @@ traceChainSyncClientEventTestBlockWith pid tracer = \case
TraceJumpingWaitingForNextInstruction ->
trace "Waiting for next instruction from the jumping governor"
TraceJumpingInstructionIs instr ->
trace $ "Received instruction: " ++ show instr
trace $ "Received instruction: " ++ showInstr instr
where
trace = traceUnitWith tracer ("ChainSyncClient " ++ condense pid)

showInstr :: Instruction TestBlock -> String
showInstr = \case
JumpTo fragment -> "JumpTo " ++ tersePoint (castPoint $ headPoint fragment)
RunNormally -> "RunNormally"
Restart -> "Restart"

traceChainSyncClientTerminationEventTestBlockWith ::
PeerId ->
Tracer m String ->
Expand Down

0 comments on commit f6cfcff

Please sign in to comment.