Skip to content

Commit

Permalink
Merge pull request #498 from input-output-hk/ensemble/implement-liven…
Browse files Browse the repository at this point in the history
…ess-in-DL

Implement liveness property in dynamic logic
  • Loading branch information
Arnaud Bailly authored Sep 28, 2022
2 parents bdbcb7a + cc45906 commit 2505515
Show file tree
Hide file tree
Showing 4 changed files with 292 additions and 271 deletions.
6 changes: 4 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,7 @@ allow-newer:
source-repository-package
type: git
location: https://github.com/input-output-hk/quickcheck-dynamic
tag: c272906361471d684440f76c297e29ab760f6a1e
--sha256: 1b9ppgavqad78a2z1zxv7v4jasjz6zz0mxkr0zx0bbcd0i00jajf
tag: 1.1.0
--sha256: 17cf58b36db5xpa0h4rbv62i7zdmknhmzz0g0znlb0mglfn7w2aj
subdir:
quickcheck-dynamic
14 changes: 14 additions & 0 deletions hydra-node/test/Hydra/BehaviorSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,20 @@ waitUntilMatch nodes predicate =

veryLong = 31557600000 -- 1000 years

-- | Wait for an output matching the predicate and extracting some value. This
-- will loop forever until a match has been found.
waitMatch ::
(MonadThrow m) =>
TestHydraNode tx m ->
(ServerOutput tx -> Maybe a) ->
m a
waitMatch node predicate =
go
where
go = do
next <- waitForNext node
maybe go pure (predicate next)

-- | A thin layer around 'HydraNode' to be able to 'waitFor'.
data TestHydraNode tx m = TestHydraNode
{ send :: ClientInput tx -> m ()
Expand Down
Loading

0 comments on commit 2505515

Please sign in to comment.