Skip to content

Commit

Permalink
Make genTx sometimes generate transactions with zero outputs.
Browse files Browse the repository at this point in the history
It's perfectly valid for a transaction to have no outputs if all
incoming value is consumed in some other way (either through the fee, or
by burning tokens).
  • Loading branch information
jonathanknowles committed Sep 3, 2021
1 parent 9eb9b66 commit 9dda3c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/src/Cardano/Wallet/Primitive/Types/Tx/Gen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import Test.QuickCheck
, liftArbitrary2
, liftShrink
, liftShrink2
, listOf
, listOf1
, shrinkList
, shrinkMapBy
Expand Down Expand Up @@ -102,7 +103,7 @@ genTxWithoutId = TxWithoutId
<$> liftArbitrary genCoinPositive
<*> listOf1 (liftArbitrary2 genTxIn genCoinPositive)
<*> listOf1 (liftArbitrary2 genTxIn genCoinPositive)
<*> listOf1 genTxOut
<*> listOf genTxOut
<*> liftArbitrary genTxMetadata
<*> genMapWith genRewardAccount genCoinPositive

Expand Down

0 comments on commit 9dda3c6

Please sign in to comment.