Skip to content

Commit 327b7e9

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#25581: test: refactor: pass absolute fee in create_lots_of_big_transactions helper
6cbe65c test: refactor: pass absolute fee in `create_lots_of_big_transactions` helper (Sebastian Falbesoner) Pull request description: Recently merged PR #25522 (commit 2222842) enabled specifying an absolute fee for MiniWallet's `create_self_transfer` method. We can use that in the `create_lots_of_big_transactions` helper to avoid deducting the fee manually (with prior conversion from BTC to Satoshis). This helper is used (directly or indirectly) in the tests `feature_maxuploadtarget.py`, `mempool_limit.py`, `mining_prioritisetransaction.py`. ACKs for top commit: MarcoFalke: cr ACK 6cbe65c Tree-SHA512: 63d66939ae36722a2dc787cbd8f1f995de6232139c2169a3d25525f43c7aaacf646d86b4095a8078f26db18e916778c8097acb19ef17ab0f58382b8bb718d60b
2 parents f9783b0 + 6cbe65c commit 327b7e9

File tree

1 file changed

+1
-4
lines changed
  • test/functional/test_framework

1 file changed

+1
-4
lines changed

test/functional/test_framework/util.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,16 +512,13 @@ def gen_return_txouts():
512512
# Create a spend of each passed-in utxo, splicing in "txouts" to each raw
513513
# transaction to make it large. See gen_return_txouts() above.
514514
def create_lots_of_big_transactions(mini_wallet, node, fee, tx_batch_size, txouts, utxos=None):
515-
from .messages import COIN
516-
fee_sats = int(fee * COIN)
517515
txids = []
518516
use_internal_utxos = utxos is None
519517
for _ in range(tx_batch_size):
520518
tx = mini_wallet.create_self_transfer(
521519
utxo_to_spend=None if use_internal_utxos else utxos.pop(),
522-
fee_rate=0,
520+
fee=fee,
523521
)["tx"]
524-
tx.vout[0].nValue -= fee_sats
525522
tx.vout.extend(txouts)
526523
res = node.testmempoolaccept([tx.serialize().hex()])[0]
527524
assert_equal(res['fees']['base'], fee)

0 commit comments

Comments
 (0)