Skip to content

Commit

Permalink
Calculate number of witnesses when balancing the transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
v0d1ch committed Apr 29, 2024
1 parent f045847 commit 35ab519
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions hydra-node/src/Hydra/Chain/Direct/Wallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Cardano.Ledger.Api (
ppMaxTxExUnitsL,
rdmrsTxWitsL,
referenceInputsTxBodyL,
reqSignerHashesTxBodyL,
scriptIntegrityHashTxBodyL,
witsTxL,
)
Expand Down Expand Up @@ -311,9 +312,7 @@ coverFee_ pparams systemStart epochInfo lookupUTxO walletUTxO partialTx@Babbage.
unbalancedTx
& bodyTxL . outputsTxBodyL %~ (|> feeTxOut)
& bodyTxL . feeTxBodyL .~ Coin 10_000_000
-- XXX: Not hard-code but parameterize to make this flexible enough for
-- later signing and commit transactions with more than one sig
additionalWitnesses = 2
additionalWitnesses = 1 + length (partialTx ^. bodyTxL . reqSignerHashesTxBodyL)

-- Balance tx with a change output and computed fee
change <-
Expand Down

0 comments on commit 35ab519

Please sign in to comment.