Skip to content

Commit

Permalink
Use first output as the head one in v_commit
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch committed Jan 12, 2023
1 parent 3372c46 commit 9d00143
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hydra-plutus/src/Hydra/Contract/Commit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ validator (_party, _headScriptHash, _commit, headId) r ctx =
ViaAbort ->
traceIfFalse "ST not burned" (mustBurnST (txInfoMint $ scriptContextTxInfo ctx) headId)
ViaCollectCom ->
traceIfFalse "ST is missing in the output" (hasST headId outputs)
traceIfFalse "ST is missing in the output" (hasST headId headOutputValue)
where
outputs = foldMap txOutValue $ txInfoOutputs $ scriptContextTxInfo ctx
headOutputValue =
case txInfoOutputs (scriptContextTxInfo ctx) of
[] -> mempty
(headOutput : _) ->
txOutValue headOutput

compiledValidator :: CompiledCode ValidatorType
compiledValidator =
Expand Down

0 comments on commit 9d00143

Please sign in to comment.