Skip to content

Commit

Permalink
Discard decrements that attempts to take more value than it is in the…
Browse files Browse the repository at this point in the history
… head

We changed the decommitSnapshot that interprets the model into the real world to
expose the TxBodyOutputNegative Bug.
Because its an invalid action we dont want to deal with it, so we decided to discard it.
  • Loading branch information
ffakenz committed May 24, 2024
1 parent 45cc7e4 commit 6ae8b5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,9 @@ instance StateModel Model where
-- it tried to perform).
validFailingAction :: Model -> Action Model a -> Bool
validFailingAction Model{headState, latestSnapshot, alreadyContested, utxoInHead} = \case
-- Decrement{} ->
-- headState == Open
Decrement{snapshot} ->
headState == Open
&& decommitUTxO snapshot `Set.isSubsetOf` utxoInHead
-- Close{snapshot} ->
-- headState == Open
-- && snapshotNumber snapshot < latestSnapshot
Expand Down Expand Up @@ -508,7 +509,7 @@ decommitSnapshot :: ModelSnapshot -> (Snapshot Tx, MultiSignature (Snapshot Tx))
decommitSnapshot ms =
(snapshot, signatures)
where
(utxo, toDecommit) = generateUTxOFromModelSnapshot ms{snapshotUTxO = mempty}
(utxo, toDecommit) = generateUTxOFromModelSnapshot ms
snapshot =
Snapshot
{ headId = mkHeadId Fixture.testPolicyId
Expand Down

0 comments on commit 6ae8b5d

Please sign in to comment.