Skip to content

Commit

Permalink
Check how many signatures it received
Browse files Browse the repository at this point in the history
  • Loading branch information
noonio committed Jan 10, 2025
1 parent dba1b72 commit 8c29638
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions hydra-cluster/src/Hydra/Cluster/Scenarios.hs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ import HydraNode (
send,
waitFor,
waitForAllMatch,
waitForAllNoMatch,
waitForNodesConnected,
waitMatch,
withHydraCluster,
Expand Down Expand Up @@ -191,10 +190,6 @@ oneOfNNodesCanDropForAWhile tracer workDir cardanoNode hydraScriptsTxId = do
tx <- mkTransferTx testNetworkId utxo aliceCardanoSk aliceCardanoVk
send n1 $ input "NewTx" ["transaction" .= tx]

-- Check that remaining parties do not see it confirmed ...
waitForAllNoMatch (200 * blockTime) [n1, n2] $ \v -> do
guard $ v ^? key "tag" == Just "SnapshotConfirmed"

-- Carol reconnects, and then the snapshot can be confirmed
withHydraNode hydraTracer carolChainConfig workDir 3 carolSk [aliceVk, bobVk] [1, 2, 3] $ \n3 -> do
-- Note: We can't use `waitForAlMatch` here as it expects them to
Expand All @@ -204,6 +199,9 @@ oneOfNNodesCanDropForAWhile tracer workDir cardanoNode hydraScriptsTxId = do
waitMatch (200 * blockTime) n $ \v -> do
guard $ v ^? key "tag" == Just "SnapshotConfirmed"
guard $ v ^? key "snapshot" . key "number" == Just (toJSON (2 :: Integer))
-- Just check that everyone signed it.
let sigs = v ^.. key "signatures" . key "multiSignature" . values
guard $ length sigs == 3
where
RunningNode{nodeSocket, networkId, blockTime} = cardanoNode
hydraTracer = contramap FromHydraNode tracer
Expand Down

0 comments on commit 8c29638

Please sign in to comment.