aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-07-11 09:21:34 +0200
committerMacroFake <falke.marco@gmail.com>2022-07-11 09:21:36 +0200
commit327b7e9236e3b0cde750df72d5f75821e52e545c (patch)
tree53fa23571c7fbecbfd00c48d2ba4932eaf11516f /test/functional
parentf9783b0f07c0c9a5dd55e1779ece5ab66519c2f2 (diff)
parent6cbe65c5d7fb23e922e5e0451a6907abb69c7cde (diff)
downloadbitcoin-327b7e9236e3b0cde750df72d5f75821e52e545c.tar.xz
Merge bitcoin/bitcoin#25581: test: refactor: pass absolute fee in `create_lots_of_big_transactions` helper
6cbe65c5d7fb23e922e5e0451a6907abb69c7cde test: refactor: pass absolute fee in `create_lots_of_big_transactions` helper (Sebastian Falbesoner) Pull request description: Recently merged PR #25522 (commit 2222842ae73f85494797b14753bc18446e4817a2) 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 6cbe65c5d7fb23e922e5e0451a6907abb69c7cde Tree-SHA512: 63d66939ae36722a2dc787cbd8f1f995de6232139c2169a3d25525f43c7aaacf646d86b4095a8078f26db18e916778c8097acb19ef17ab0f58382b8bb718d60b
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/test_framework/util.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py
index 1ee23f7574..58528b7858 100644
--- a/test/functional/test_framework/util.py
+++ b/test/functional/test_framework/util.py
@@ -512,16 +512,13 @@ def gen_return_txouts():
# Create a spend of each passed-in utxo, splicing in "txouts" to each raw
# transaction to make it large. See gen_return_txouts() above.
def create_lots_of_big_transactions(mini_wallet, node, fee, tx_batch_size, txouts, utxos=None):
- from .messages import COIN
- fee_sats = int(fee * COIN)
txids = []
use_internal_utxos = utxos is None
for _ in range(tx_batch_size):
tx = mini_wallet.create_self_transfer(
utxo_to_spend=None if use_internal_utxos else utxos.pop(),
- fee_rate=0,
+ fee=fee,
)["tx"]
- tx.vout[0].nValue -= fee_sats
tx.vout.extend(txouts)
res = node.testmempoolaccept([tx.serialize().hex()])[0]
assert_equal(res['fees']['base'], fee)