Coming from #28139 (review).
No test case in this file is meant to exercise fee estimation. All default wallets have a
custom tx fee set here. The only one missing is the one created for locked_wallet.
Coming from #28139 (review).
No test case in this file is meant to exercise fee estimation. All default wallets have a
custom tx fee set here. The only one missing is the one created for locked_wallet.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | theStack |
| Concept ACK | MarcoFalke |
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
concept ACK
605 | - value = inputs[0]["amount"] - Decimal("0.00002200") 606 | + 607 | + # Deduce exact fee to produce a changeless transaction 608 | + expected_tx_size = 110 # Total tx size: 110 vbytes, p2wpkh -> p2wpkh. Input 68 vbytes + rest of tx is 42 vbytes. 609 | + fee_rate = self.min_relay_tx_fee / 1000 # btc/vbytes 610 | + value = inputs[0]["amount"] - (fee_rate * expected_tx_size)
nit: could use the get_fee helper (from test_framework.util) for not having to bother with manual fee-rate unit coversion and fee calculation:
value = inputs[0]["amount"] - get_fee(expected_tx_size, self.min_relay_tx_fee)
sure, pushed. Thanks. would be nice to have a document somewhere mentioning the existence of these utility functions.
Same as we do with the nodes default wallets.
No test case on this file is meant to exercise fee estimation.
Updated per feedback. Thanks theStack.
Tiny change. Instead of calculating the fee manually, the code now uses
the get_fee() util function.
ACK 5364dd8666ae1afa35536f9b4fc0170eeaf37888