Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch authored and ch1bo committed Nov 29, 2022
1 parent cca54c7 commit d8a10ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 0 additions & 3 deletions hydra-node/test/Hydra/Chain/Direct/Contract/Close.hs
Expand Up @@ -71,9 +71,6 @@ healthyCloseTx =
healthyCloseUpperBoundSlotNo :: SlotNo
healthyCloseUpperBoundSlotNo = arbitrary `generateWith` 42

healthyCloseLowerBoundSlotNo :: SlotNo -> SlotNo
healthyCloseLowerBoundSlotNo n = arbitrary `suchThat` (< n) `generateWith` 42

healthyClosingSnapshot :: ClosingSnapshot
healthyClosingSnapshot =
CloseWithConfirmedSnapshot
Expand Down
8 changes: 3 additions & 5 deletions hydra-plutus/src/Hydra/Contract/Head.hs
Expand Up @@ -290,8 +290,7 @@ checkClose ctx headContext parties initialUtxoHash snapshotNumber closedUtxoHash
, utxoHash = initialUtxoHash
, contestationDeadline = makeContestationDeadline cperiod ctx
}
in traceIfFalse "s == 0" $
checkHeadOutputDatum ctx expectedOutputDatum
in checkHeadOutputDatum ctx expectedOutputDatum
| snapshotNumber > 0 =
let expectedOutputDatum =
Closed
Expand All @@ -300,9 +299,8 @@ checkClose ctx headContext parties initialUtxoHash snapshotNumber closedUtxoHash
, utxoHash = closedUtxoHash
, contestationDeadline = makeContestationDeadline cperiod ctx
}
in traceIfFalse "s > 0" $
verifySnapshotSignature parties snapshotNumber closedUtxoHash sig
&& checkHeadOutputDatum ctx expectedOutputDatum
in verifySnapshotSignature parties snapshotNumber closedUtxoHash sig
&& checkHeadOutputDatum ctx expectedOutputDatum
| otherwise = traceError "negative snapshot number"

cp = fromMilliSeconds (milliseconds cperiod)
Expand Down

0 comments on commit d8a10ab

Please sign in to comment.