@@ -128,7 +128,7 @@ instance StateModel Model where
128
128
case headState of
129
129
Open ->
130
130
oneof
131
- [ -- TODO : non-continuous snapshot numbers
131
+ [ -- NOTE : non-continuous snapshot numbers are allowed in this model
132
132
Some . ProduceSnapshots <$> arbitrary
133
133
, do
134
134
actor <- elements allActors
@@ -152,13 +152,11 @@ instance StateModel Model where
152
152
snapshotNumber <- elements snapshots
153
153
pure $ Some Contest {actor, snapshotNumber}
154
154
155
- -- TODO: shrinkAction to have small snapshots?
156
-
157
155
initialState =
158
156
Model
159
157
{ snapshots = []
160
158
, headState = Open
161
- , utxoV = mkVar 1 -- TODO: what does '1' mean here?
159
+ , utxoV = mkVar ( - 1 )
162
160
, alreadyContested = []
163
161
}
164
162
@@ -208,17 +206,13 @@ instance RunModel Model IO where
208
206
tx <- newCloseTx actor $ correctlySignedSnapshot snapshotNumber
209
207
validateTx openHeadUTxO tx
210
208
observeTxMatching openHeadUTxO tx $ \ case
211
- Tx. Close {} -> Just () -- TODO: check more things here (or in postcondition)?
209
+ Tx. Close {} -> Just ()
212
210
_ -> Nothing
213
211
pure $ adjustUTxO tx openHeadUTxO
214
212
Contest {actor, snapshotNumber} -> do
215
- -- NOTE: Should not happen anymore
216
- when (snapshotNumber == 0 ) $
217
- failure " Cannot contest initial snapshot"
218
213
let utxo = lookupVar utxoV
219
214
tx <- newContestTx utxo actor $ correctlySignedSnapshot snapshotNumber
220
215
validateTx utxo tx
221
-
222
216
observation@ Tx. ContestObservation {contesters} <-
223
217
observeTxMatching utxo tx $ \ case
224
218
Tx. Contest obs -> Just obs
@@ -231,7 +225,6 @@ instance RunModel Model IO where
231
225
, toString $ pShowNoColor observation
232
226
, " Transaction: " <> renderTxWithUTxO utxo tx
233
227
]
234
-
235
228
pure $ adjustUTxO tx utxo
236
229
Fanout -> pure ()
237
230
Stop -> pure ()
0 commit comments