Skip to content

Commit

Permalink
Re-add traces
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jan 11, 2023
1 parent a31cfb2 commit da1cdd9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions hydra-plutus/src/Hydra/Contract/Head.hs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ checkAbort ctx@ScriptContext{scriptContextTxInfo = txInfo} headCurrencySymbol pa
&& mustBeSignedByParticipant ctx headCurrencySymbol
where
mustBurnAllHeadTokens =
burntTokens == length parties + 1
traceIfFalse "number of inputs do not match number of parties" $
burntTokens == length parties + 1

minted = getValue $ txInfoMint txInfo

Expand Down Expand Up @@ -137,10 +138,13 @@ checkCollectCom ctx@ScriptContext{scriptContextTxInfo = txInfo} (contestationPer
&& hasST headId outValue
where
headAddress = mkHeadAddress ctx

outValue =
maybe mempty (txOutValue . txInInfoResolved) $ findOwnInput ctx

everyoneHasCommitted =
nTotalCommits == length parties
traceIfFalse "not everyone committed" $
nTotalCommits == length parties

(expectedChangeValue, collectedCommits, nTotalCommits) =
traverseInputs
Expand Down Expand Up @@ -350,7 +354,8 @@ checkHeadOutputDatum ctx d =
NoOutputDatum ->
traceError "missing datum"
OutputDatumHash actualHash ->
Just actualHash == expectedHash
traceIfFalse "output datum hash mismatch" $
Just actualHash == expectedHash
OutputDatum actual ->
traceIfFalse "output datum mismatch" $
getDatum actual == expectedData
Expand Down

0 comments on commit da1cdd9

Please sign in to comment.