Skip to content

Commit

Permalink
Change some forAllQ to forAllNonVariableQ
Browse files Browse the repository at this point in the history
No idea why, but this seems to shrink less and not invalidating a
precondition on one of the model tests.
  • Loading branch information
ch1bo committed Feb 14, 2024
1 parent 54bfd82 commit 4bacf35
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hydra-node/test/Hydra/ModelSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,19 @@ prop_checkHeadOpensIfAllPartiesCommit =

headOpensIfAllPartiesCommit :: DL WorldState ()
headOpensIfAllPartiesCommit = do
_ <- seedTheWorld
_ <- initHead
seedTheWorld
initHead
everybodyCommit
void $ eventually' ObserveHeadIsOpen
eventually' ObserveHeadIsOpen
where
eventually' a = action (Wait 1000) >> action a
seedTheWorld = forAllQ (withGenQ genSeed (const [])) >>= action
eventually' a = action (Wait 1000) >> action_ a

seedTheWorld = forAllNonVariableQ (withGenQ genSeed (const [])) >>= action_

initHead = do
WorldState{hydraParties} <- getModelStateDL
forAllQ (withGenQ (genInit hydraParties) (const [])) >>= action
forAllQ (withGenQ (genInit hydraParties) (const [])) >>= action_

everybodyCommit = do
WorldState{hydraParties} <- getModelStateDL
forM_ hydraParties $ \party ->
Expand Down

0 comments on commit 4bacf35

Please sign in to comment.