@@ -21,12 +21,13 @@ module Hydra.Chain.Direct.TxTraceSpec where
21
21
import Hydra.Prelude hiding (Any , State , label , show )
22
22
import Test.Hydra.Prelude
23
23
24
- import Cardano.Api.UTxO (UTxO )
24
+ import Cardano.Api.UTxO (UTxO , totalLovelace )
25
25
import Cardano.Api.UTxO qualified as UTxO
26
26
import Data.List (nub , (\\) )
27
27
import Data.Map.Strict qualified as Map
28
28
import Data.Time.Clock.POSIX (posixSecondsToUTCTime )
29
29
import Hydra.Cardano.Api (
30
+ Coin (.. ),
30
31
CtxUTxO ,
31
32
PaymentKey ,
32
33
SlotNo (.. ),
@@ -72,7 +73,7 @@ import Test.Hydra.Tx.Gen (
72
73
genUTxO1 ,
73
74
genVerificationKey ,
74
75
)
75
- import Test.Hydra.Tx.Mutation (addParticipationTokens )
76
+ import Test.Hydra.Tx.Mutation (addParticipationTokens , randomBetween )
76
77
import Test.QuickCheck (Confidence (.. ), Property , Smart (.. ), Testable , checkCoverage , checkCoverageWith , cover , elements , frequency , ioProperty )
77
78
import Test.QuickCheck.Monadic (monadic )
78
79
import Test.QuickCheck.StateModel (
@@ -817,6 +818,7 @@ newDepositTx _ utxoToDeposit = do
817
818
let validBefore = SlotNo 0
818
819
deadline <- liftIO getCurrentTime
819
820
let depositUTxO = realWorldModelUTxO utxoToDeposit
821
+ amount <- liftIO $ randomBetween 1_000_000 (unCoin $ totalLovelace depositUTxO)
820
822
let blueprint = CommitBlueprintTx {blueprintTx = txSpendingUTxO depositUTxO, lookupUTxO = depositUTxO}
821
823
pure $
822
824
Right $
@@ -826,7 +828,7 @@ newDepositTx _ utxoToDeposit = do
826
828
blueprint
827
829
validBefore
828
830
deadline
829
- Nothing
831
+ ( Just $ Coin amount)
830
832
831
833
-- | Creates a increment transaction using given utxo and given snapshot.
832
834
newIncrementTx :: Actor -> ConfirmedSnapshot Tx -> AppM (Either IncrementTxError Tx )
0 commit comments