Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add advanceAllChains_ #2073

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading