Skip to content

Commit 3acade8

Browse files
committed
TxTrace: initially start with some funds
1 parent f85d442 commit 3acade8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,12 @@ prop_traces =
160160
_ -> False
161161

162162
hasDecrement =
163-
any $
163+
all $
164164
\(_ := ActionWithPolarity{polarAction, polarity}) -> case polarAction of
165-
Decrement{snapshot} -> polarity == PosPolarity && sum (Map.elems (decommitUTxO snapshot)) > 0
165+
Decrement{snapshot} -> polarity == PosPolarity && sum (Map.elems (decommitUTxO snapshot)) < initialAmount
166166
_ -> False
167167

168+
168169
prop_runActions :: Actions Model -> Property
169170
prop_runActions actions =
170171
monadic runAppMProperty $ do
@@ -238,6 +239,9 @@ data TxResult = TxResult
238239
}
239240
deriving (Eq, Show)
240241

242+
initialAmount :: Natural
243+
initialAmount = 10
244+
241245
instance StateModel Model where
242246
data Action Model a where
243247
Decrement :: {actor :: Actor, snapshot :: ModelSnapshot} -> Action Model TxResult
@@ -253,7 +257,7 @@ instance StateModel Model where
253257
{ headState = Open
254258
, latestSnapshot = 0
255259
, alreadyContested = []
256-
, utxoInHead = fromList [(A, 0)]
260+
, utxoInHead = fromList [(A, initialAmount)]
257261
}
258262

259263
arbitraryAction :: VarContext -> Model -> Gen (Any (Action Model))

0 commit comments

Comments
 (0)