Skip to content

Commit c4091aa

Browse files
committed
Refactor the test a bit to be more simple
Signed-off-by: Sasha Bogicevic <[email protected]>
1 parent 9619c93 commit c4091aa

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

hydra-cluster/src/Hydra/Cluster/Scenarios.hs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,9 +1335,7 @@ canDepositPartially tracer workDir blockTime backend hydraScriptsTxId =
13351335
(requestCommitTx' n1 commitUTxO (Just 6_000_000) <&> toJSON)
13361336
`shouldThrow` expectErrorStatus 400 (Just "AmountTooLow")
13371337

1338-
commitUTxO2 <- seedFromFaucet backend walletVk 5_000_000 (contramap FromFaucet tracer)
13391338
let expectedCommit = fst $ capUTxO commitUTxO 2_000_000
1340-
let expectedCommit2 = fst $ capUTxO commitUTxO2 3_000_000
13411339

13421340
depositTransaction <- requestCommitTx' n2 commitUTxO (Just 2_000_000)
13431341

@@ -1351,18 +1349,9 @@ canDepositPartially tracer workDir blockTime backend hydraScriptsTxId =
13511349
output "CommitFinalized" ["headId" .= headId, "depositTxId" .= getTxId (getTxBody tx)]
13521350

13531351
getSnapshotUTxO n1 `shouldReturn` expectedCommit
1354-
1355-
depositTransaction' <- requestCommitTx' n1 commitUTxO2 (Just 3_000_000)
1356-
let tx' = signTx walletSk depositTransaction'
1357-
1358-
Backend.submitTransaction backend tx'
1359-
1360-
waitFor hydraTracer (2 * realToFrac depositPeriod) [n1, n2] $
1361-
output "CommitApproved" ["headId" .= headId, "utxoToCommit" .= expectedCommit2]
1362-
waitFor hydraTracer (20 * blockTime) [n1, n2] $
1363-
output "CommitFinalized" ["headId" .= headId, "depositTxId" .= getTxId (getTxBody tx')]
1364-
1365-
getSnapshotUTxO n1 `shouldReturn` expectedCommit <> expectedCommit2
1352+
-- check that user balance balance contains the change from the commit tx
1353+
(balance <$> Backend.queryUTxOFor backend QueryTip walletVk)
1354+
`shouldReturn` lovelaceToValue 3_000_000
13661355

13671356
send n2 $ input "Close" []
13681357

@@ -1379,7 +1368,7 @@ canDepositPartially tracer workDir blockTime backend hydraScriptsTxId =
13791368

13801369
-- Assert final wallet balance
13811370
(balance <$> Backend.queryUTxOFor backend QueryTip walletVk)
1382-
`shouldReturn` balance (commitUTxO <> commitUTxO2)
1371+
`shouldReturn` balance commitUTxO
13831372
where
13841373
hydraTracer = contramap FromHydraNode tracer
13851374

0 commit comments

Comments
 (0)