Closed naiyoma closed 2 months ago
Concept ACK Approach ACK tACK 6d91cb7
I tested calculate_input_weight
helper function for both the call sites in test/functional/wallet_send.py
and test/functional/rpc_psbt.py
respectively.
The PR introduces a helper function to calculate input_weight
at two different call sites and thereby prevents code duplication.
Another call site where this helper function could be used is test/functional/wallet_fundrawtransaction.py
, the reason for not covering it could be that the method of calculating input_weight
and the data available to do so differ.
thank you for hosting!
Session Details
Notes
Currently, the transaction input weight is calculated manually as follows:
input_weight = ((len_prevout_txid + len_prevout_index + len_sequence + len_scriptsig) * WITNESS_SCALE_FACTOR) + len_scriptwitness
This method is replicated in the test cases found intest/functional/wallet_send.py
andtest/functional/rpc_psbt.py
. The proposed solution involves using a helper functioncalculate_input_weight
and calling it at the respective call sites.Questions
Did you review the PR? Concept ACK, approach ACK, tested ACK, or NACK? What was your review approach?
What does this PR do?
Look through the code base and check if input weight is being calculated in other call sites(test) that the PR has not covered, why is this the case?
Learning
transaction weight tests