Skip to content

Commit

Permalink
Push deadline using contestation period during contest tx building
Browse files Browse the repository at this point in the history
  • Loading branch information
ffakenz committed Feb 8, 2023
1 parent 76dcb13 commit 5d113a1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hydra-node/src/Hydra/Chain/Direct/Tx.hs
Expand Up @@ -355,6 +355,7 @@ closeTx vk closing startSlotNo (endSlotNo, utcTime) openThreadOutput headId =
, utxoHash = toBuiltin utxoHashBytes
, parties = openParties
, contestationDeadline
, contestationPeriod = openContestationPeriod
, headId = headIdToCurrencySymbol headId
, contesters = []
}
Expand Down Expand Up @@ -415,14 +416,18 @@ contestTx vk Snapshot{number, utxo} sig (slotNo, _) ClosedThreadOutput{closedThr

contester = toPlutusKeyHash (verificationKeyHash vk)

onChainConstestationPeriod = toChain contestationPeriod

pushedContestationDeadline = addContestationPeriod closedContestationDeadline onChainConstestationPeriod

headDatumAfter =
mkTxOutDatum
Head.Closed
{ snapshotNumber = toInteger number
, utxoHash
, parties = closedParties
, contestationDeadline = closedContestationDeadline
, contestationPeriod = toChain contestationPeriod
, contestationDeadline = pushedContestationDeadline
, contestationPeriod = onChainConstestationPeriod
, headId = headIdToCurrencySymbol headId
, contesters = contester : closedContesters
}
Expand Down

0 comments on commit 5d113a1

Please sign in to comment.