Skip to content

Commit 1b7e1f6

Browse files
committed
Small refactor of WalletSpec as suggested
1 parent 1decee4 commit 1b7e1f6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

hydra-node/test/Hydra/Chain/Direct/WalletSpec.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ prop_setsMinUTxOValue =
203203
forAllBlind (resize 0 genLedgerTx) $ \tx ->
204204
forAllBlind (reasonablySized $ genOutputsForInputs tx) $ \lookupUTxO ->
205205
forAllBlind (reasonablySized genUTxO) $ \walletUTxO ->
206-
-- Generate another txOut and make it deliberately "under-valued"
207-
forAll arbitrary $ \txOut -> do
208-
let txOutWithoutADA = txOut & coinTxOutL .~ mempty
206+
forAll genTxOutWithoutADA $ \txOutWithoutADA -> do
209207
let newTx = tx & bodyTxL . outputsTxBodyL <>~ StrictSeq.singleton txOutWithoutADA
210208
case coverFee_ Fixture.pparams Fixture.systemStart Fixture.epochInfo lookupUTxO walletUTxO newTx of
211209
Left err ->
@@ -215,6 +213,9 @@ prop_setsMinUTxOValue =
215213
let outs = toList $ balancedTx ^. bodyTxL . outputsTxBodyL
216214
not (any (\o -> o ^. coinTxOutL == mempty) outs)
217215
& counterexample ("No 0 ADA outputs expected:\n" <> show outs)
216+
where
217+
-- Generate a deliberately "under-valued" TxOut
218+
genTxOutWithoutADA = arbitrary <&> coinTxOutL .~ mempty
218219

219220
prop_balanceTransaction :: Property
220221
prop_balanceTransaction =

0 commit comments

Comments
 (0)