Skip to content

Commit

Permalink
TxTrace: If there is no utxo in the snapshot don't populate
Browse files Browse the repository at this point in the history
utxoToDecommit also
  • Loading branch information
v0d1ch committed May 22, 2024
1 parent 3204569 commit f58d335
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions hydra-node/test/Hydra/Chain/Direct/TxTraceSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,15 @@ decommitSnapshot :: ModelSnapshot -> (Snapshot Tx, MultiSignature (Snapshot Tx))
decommitSnapshot ms =
(snapshot, signatures)
where
utxo = generateUTxOFromModelSnapshot ms{decommitUTxO = mempty}
toDecommit = generateUTxOFromModelSnapshot ms{snapshotUTxO = mempty}
snapshot =
Snapshot
{ headId = mkHeadId Fixture.testPolicyId
, number = snapshotNumber ms
, confirmed = []
, utxo = generateUTxOFromModelSnapshot ms{decommitUTxO = mempty}
, utxoToDecommit =
let toDecommit = generateUTxOFromModelSnapshot ms{snapshotUTxO = mempty}
in if null toDecommit then Nothing else Just toDecommit
, utxo
, utxoToDecommit = if null toDecommit || null utxo then Nothing else Just toDecommit
}
signatures = aggregate [sign sk snapshot | sk <- [Fixture.aliceSk, Fixture.bobSk, Fixture.carolSk]]

Expand Down

0 comments on commit f58d335

Please sign in to comment.