aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAurèle Oulès <aurele@oules.com>2022-11-27 11:03:04 +0100
committerAurèle Oulès <aurele@oules.com>2022-12-15 09:53:51 +0100
commit564b580bf07742483a140c7c095b896a6d5d6cad (patch)
tree8563f2d234fa5341b3d3ba51201a27577472c3bf /test
parent71d9a7c03b44236c2fea2b74f92a69234d29f717 (diff)
downloadbitcoin-564b580bf07742483a140c7c095b896a6d5d6cad.tar.xz
test: Introduce MIN_BLOCKS_TO_KEEP constant
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_pruning.py3
-rw-r--r--test/functional/test_framework/blocktools.py1
2 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/feature_pruning.py b/test/functional/feature_pruning.py
index f01e9a451f..de1ea8a3a6 100755
--- a/test/functional/feature_pruning.py
+++ b/test/functional/feature_pruning.py
@@ -11,6 +11,7 @@ This test takes 30 mins or more (up to 2 hours)
import os
from test_framework.blocktools import (
+ MIN_BLOCKS_TO_KEEP,
create_block,
create_coinbase,
)
@@ -333,7 +334,7 @@ class PruneTest(BitcoinTestFramework):
assert has_block(2), "blk00002.dat is still there, should be pruned by now"
# advance the tip so blk00002.dat and blk00003.dat can be pruned (the last 288 blocks should now be in blk00004.dat)
- self.generate(node, 288, sync_fun=self.no_op)
+ self.generate(node, MIN_BLOCKS_TO_KEEP, sync_fun=self.no_op)
prune(1000)
assert not has_block(2), "blk00002.dat is still there, should be pruned by now"
assert not has_block(3), "blk00003.dat is still there, should be pruned by now"
diff --git a/test/functional/test_framework/blocktools.py b/test/functional/test_framework/blocktools.py
index 77653df96e..f8e94ca6ba 100644
--- a/test/functional/test_framework/blocktools.py
+++ b/test/functional/test_framework/blocktools.py
@@ -61,6 +61,7 @@ WITNESS_COMMITMENT_HEADER = b"\xaa\x21\xa9\xed"
NORMAL_GBT_REQUEST_PARAMS = {"rules": ["segwit"]}
VERSIONBITS_LAST_OLD_BLOCK_VERSION = 4
+MIN_BLOCKS_TO_KEEP = 288
def create_block(hashprev=None, coinbase=None, ntime=None, *, version=None, tmpl=None, txlist=None):