Skip to content

Commit

Permalink
Remove unused function withCounterExample
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed Dec 8, 2024
1 parent a32e06e commit 3e2db61
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions hydra-node/test/Hydra/Chain/Direct/HandlersSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import Test.QuickCheck (
(===),
)
import Test.QuickCheck.Monadic (
PropertyM,
assert,
monadicIO,
monitor,
Expand Down Expand Up @@ -256,26 +255,6 @@ recordEventsHandler ctx cs getTimeHandle = do
-- 'Block' and can be de-/constructed easily.
data TestBlock = TestBlock BlockHeader [Tx]

withCounterExample :: [TestBlock] -> TVar IO ChainStateAt -> IO a -> PropertyM IO a
withCounterExample blocks headState step = do
stBefore <- run $ readTVarIO headState
a <- run step
stAfter <- run $ readTVarIO headState
a <$ do
monitor $
counterexample $
toString $
unlines
[ "Chain state at (before rollback): " <> show stBefore
, "Chain state at (after rollback): " <> show stAfter
, "Block sequence: \n"
<> unlines
( fmap
(" " <>)
[show (getChainPoint header) | TestBlock header _ <- blocks]
)
]

-- | Thin wrapper which generates a 'TestBlock' at some specific slot.
genBlockAt :: SlotNo -> [Tx] -> Gen TestBlock
genBlockAt sl txs = do
Expand Down

0 comments on commit 3e2db61

Please sign in to comment.