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 authored and silky committed Jan 13, 2025

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent 3041144 commit 98bbecf
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
@@ -89,7 +89,6 @@ import HydraNode (
send,
waitFor,
waitForAllMatch,
waitForAllNoMatch,
waitForNodesConnected,
waitMatch,
withHydraCluster,
@@ -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
@@ -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

0 comments on commit 98bbecf

Please sign in to comment.