From c8e6d08236ff225db445009bf513d6d25def8eb2 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 16 Apr 2024 02:05:09 +0200 Subject: test: refactor: eliminate COINBASE_MATURITY magic number in fill_mempool --- test/functional/test_framework/mempool_util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/functional/test_framework/mempool_util.py b/test/functional/test_framework/mempool_util.py index 4d4b00b8b6..230a95855b 100644 --- a/test/functional/test_framework/mempool_util.py +++ b/test/functional/test_framework/mempool_util.py @@ -5,6 +5,9 @@ """Helpful routines for mempool testing.""" from decimal import Decimal +from .blocktools import ( + COINBASE_MATURITY, +) from .util import ( assert_equal, assert_greater_than, @@ -38,8 +41,8 @@ def fill_mempool(test_framework, node, miniwallet): # 75 transactions each with a fee rate higher than the previous one test_framework.generate(miniwallet, 1 + (num_of_batches * tx_batch_size)) - # Mine COINBASE_MATURITY - 1 blocks so that the UTXOs are allowed to be spent - test_framework.generate(node, 100 - 1) + # Mine enough blocks so that the UTXOs are allowed to be spent + test_framework.generate(node, COINBASE_MATURITY - 1) # Get all UTXOs up front to ensure none of the transactions spend from each other, as that may # change their effective feerate and thus the order in which they are selected for eviction. -- cgit v1.2.3