Skip to content

Commit

Permalink
add advanceAllChains_
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Dec 17, 2024
1 parent 8c85cbd commit df44bfd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions test/unit/Chainweb/Test/Pact5/CutFixture.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module Chainweb.Test.Pact5.CutFixture
, fixtureMempools
, fixturePactQueues
, advanceAllChains
, advanceAllChains_
, withTestCutDb
)
where
Expand Down Expand Up @@ -146,6 +147,13 @@ advanceAllChains v Fixture{..} = do

return (finalCut, onChains perChainCommandResults)

advanceAllChains_
:: HasCallStack
=> ChainwebVersion
-> Fixture
-> IO ()
advanceAllChains_ v f = void $ advanceAllChains v f

withTestCutDb :: (Logger logger)
=> logger
-> ChainwebVersion
Expand Down
6 changes: 3 additions & 3 deletions test/unit/Chainweb/Test/Pact5/RemotePactTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pollingConfirmationDepthTest baseRdb = runResourceT $ do
pollingWithDepth v cid clientEnv rks (Just (ConfirmationDepth 0)) >>= \response -> do
assertEqual "there are no command results at depth 0" response HashMap.empty

_ <- CutFixture.advanceAllChains v (fixture ^. cutFixture)
CutFixture.advanceAllChains_ v (fixture ^. cutFixture)

pollingWithDepth v cid clientEnv rks Nothing >>= \response -> do
assertEqual "results are visible at depth 0" 2 (HashMap.size response)
Expand All @@ -180,7 +180,7 @@ pollingConfirmationDepthTest baseRdb = runResourceT $ do
pollingWithDepth v cid clientEnv rks (Just (ConfirmationDepth 1)) >>= \response -> do
assertEqual "results are not visible at depth 1" 0 (HashMap.size response)

_ <- CutFixture.advanceAllChains v (fixture ^. cutFixture)
CutFixture.advanceAllChains_ v (fixture ^. cutFixture)

pollingWithDepth v cid clientEnv rks Nothing >>= \response -> do
assertEqual "results are visible at depth 0" 2 (HashMap.size response)
Expand All @@ -191,7 +191,7 @@ pollingConfirmationDepthTest baseRdb = runResourceT $ do
pollingWithDepth v cid clientEnv rks (Just (ConfirmationDepth 2)) >>= \response -> do
assertEqual "results are not visible at depth 2" 0 (HashMap.size response)

_ <- CutFixture.advanceAllChains v (fixture ^. cutFixture)
CutFixture.advanceAllChains_ v (fixture ^. cutFixture)

pollingWithDepth v cid clientEnv rks Nothing >>= \response -> do
assertEqual "results are visible at depth 0" 2 (HashMap.size response)
Expand Down

0 comments on commit df44bfd

Please sign in to comment.