Skip to content

Commit

Permalink
Fix contest off-chain
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1bo committed Jul 15, 2024
1 parent 38de24c commit e79dfed
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hydra-node/src/Hydra/Chain/Direct/Tx.hs
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ contestTx scriptRegistry vk Snapshot{number, utxo, utxoToDecommit, version} sig
Head.ClosedDatum
{ snapshotNumber = toInteger number
, utxoHash
, deltaUTxOHash = toBuiltin . hashUTxO @Tx <$> utxoToDecommit
, deltaUTxOHash
, parties = closedParties
, contestationDeadline = newContestationDeadline
, contestationPeriod = onChainConstestationPeriod
Expand All @@ -708,6 +708,16 @@ contestTx scriptRegistry vk Snapshot{number, utxo, utxoToDecommit, version} sig
, version = toInteger version
}

-- TODO: DRY with contestRedeemer
deltaUTxOHash
| offChainVersion == version =
Just . toBuiltin $ hashUTxO @Tx $ fromMaybe mempty utxoToDecommit
| offChainVersion == version + 1 =
Nothing
| otherwise =
-- XXX: should not be needed
Nothing

utxoHash = toBuiltin $ hashUTxO @Tx utxo

data FanoutTxError
Expand Down

0 comments on commit e79dfed

Please sign in to comment.