Skip to content

Commit

Permalink
Start with the script changes
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch authored and ch1bo committed Nov 29, 2022
1 parent dda02d7 commit 0e2ac35
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hydra-plutus/src/Hydra/Contract/Head.hs
Expand Up @@ -253,6 +253,8 @@ checkCollectCom context@ScriptContext{scriptContextTxInfo = txInfo} headContext
{-# INLINEABLE checkCollectCom #-}

-- | The close validator must verify that:
-- * Check that the closing tx validity is bounded by contestation period
-- `T_max <= T_min + CP`
--
-- * The closing snapshot number and signature is correctly signed
--
Expand All @@ -271,8 +273,13 @@ checkClose ::
ContestationPeriod ->
Bool
checkClose ctx headContext parties initialUtxoHash snapshotNumber closedUtxoHash sig cperiod =
checkSnapshot && mustBeSignedByParticipant ctx headContext
hasBoundedValidity && checkSnapshot && mustBeSignedByParticipant ctx headContext
where
hasBoundedValidity =
tMax <= tMin + cperiod
tMax = traceError "define tMax"
tMin = traceError "define tMin"

checkSnapshot
| snapshotNumber == 0 =
let expectedOutputDatum =
Expand Down

0 comments on commit 0e2ac35

Please sign in to comment.