Skip to content

Commit

Permalink
Fix tx-cost benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch committed Dec 5, 2023
1 parent 93a100f commit b448dca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hydra-node/bench/tx-cost/TxCost.hs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ computeContestCost = do
snapshot <- genConfirmedSnapshot headId (succ closedSnapshotNumber) utxo (ctxHydraSigningKeys ctx)
pointInTime <- genPointInTimeBefore (getContestationDeadline stClosed)
let cp = ctxContestationPeriod ctx
pure (unsafeContest cctx utxo headId cp snapshot pointInTime, getKnownUTxO stClosed <> getKnownUTxO cctx)
let contestUtxo = getKnownUTxO stClosed <> getKnownUTxO cctx
pure (unsafeContest cctx contestUtxo headId cp snapshot pointInTime, contestUtxo)

computeAbortCost :: IO [(NumParties, TxSize, MemUnit, CpuUnit, Lovelace)]
computeAbortCost =
Expand Down Expand Up @@ -232,7 +233,8 @@ computeFanOutCost = do
closeTx = unsafeClose cctx spendableUTxO headId (ctxHeadParameters ctx) snapshot startSlot closePoint
stClosed = snd . fromJust $ observeClose stOpen closeTx
deadlineSlotNo = slotNoFromUTCTime (getContestationDeadline stClosed)
pure (utxo, unsafeFanout cctx spendableUTxO seedTxIn utxo deadlineSlotNo, getKnownUTxO stClosed <> getKnownUTxO cctx)
utxoToFanout = getKnownUTxO stClosed <> getKnownUTxO cctx
pure (utxo, unsafeFanout cctx utxoToFanout seedTxIn utxo deadlineSlotNo, getKnownUTxO stClosed <> getKnownUTxO cctx)

newtype NumParties = NumParties Int
deriving newtype (Eq, Show, Ord, Num, Real, Enum, Integral)
Expand Down

0 comments on commit b448dca

Please sign in to comment.