Skip to content

Commit

Permalink
Exercise more negative actions (by just trying all which don't fulfill
Browse files Browse the repository at this point in the history
the precondition)
  • Loading branch information
ch1bo committed May 23, 2024
1 parent bd66d18 commit cd29234
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -314,22 +314,22 @@ instance StateModel Model where
-- it tried to perform).
validFailingAction :: Model -> Action Model a -> Bool
validFailingAction Model{headState, latestSnapshot, alreadyContested, utxoInHead} = \case
Decrement{} ->
headState == Open
Close{snapshot} ->
headState == Open
&& snapshotNumber snapshot < latestSnapshot
Contest{actor, snapshot} ->
headState == Closed
&& ( snapshotNumber snapshot <= latestSnapshot
|| actor `elem` alreadyContested
)
Fanout{snapshot} ->
headState == Closed
&& ( snapshotNumber snapshot /= latestSnapshot
|| snapshotUTxO snapshot /= utxoInHead
)
_ -> False
-- Decrement{} ->
-- headState == Open
-- Close{snapshot} ->
-- headState == Open
-- && snapshotNumber snapshot < latestSnapshot
-- Contest{actor, snapshot} ->
-- headState == Closed
-- && ( snapshotNumber snapshot <= latestSnapshot
-- || actor `elem` alreadyContested
-- )
-- Fanout{snapshot} ->
-- headState == Closed
-- && ( snapshotNumber snapshot /= latestSnapshot
-- || snapshotUTxO snapshot /= utxoInHead
-- )
_ -> True

nextState :: Model -> Action Model a -> Var a -> Model
nextState m t _result =
Expand Down

0 comments on commit cd29234

Please sign in to comment.