aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-07-12 14:33:16 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-07-25 15:24:04 +0200
commitfa7f65b0f81f3a2899c8eb540182c7d9a90fff00 (patch)
treeb0f4c23d32613938d56153babf9d36feb51f53ec
parente35fb7bc48d360585b80d0c7f89ac5087c1d405e (diff)
downloadbitcoin-fa7f65b0f81f3a2899c8eb540182c7d9a90fff00.tar.xz
test: Use clean chain in MempoolCompatibilityTest
The test creates enough blocks itself, so there is no need to have more. Also, remove os import.
-rwxr-xr-xtest/functional/mempool_compatibility.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/functional/mempool_compatibility.py b/test/functional/mempool_compatibility.py
index 3f632d3d56..fd3e219586 100755
--- a/test/functional/mempool_compatibility.py
+++ b/test/functional/mempool_compatibility.py
@@ -10,8 +10,6 @@ In case we need to break mempool compatibility we can continue to use the test b
Previous releases are required by this test, see test/README.md.
"""
-import os
-
from test_framework.blocktools import COINBASE_MATURITY
from test_framework.test_framework import BitcoinTestFramework
from test_framework.wallet import (
@@ -23,6 +21,7 @@ from test_framework.wallet import (
class MempoolCompatibilityTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
+ self.setup_clean_chain = True
def skip_test_if_missing_module(self):
self.skip_if_no_previous_releases()
@@ -55,9 +54,9 @@ class MempoolCompatibilityTest(BitcoinTestFramework):
self.stop_node(1)
self.log.info("Move mempool.dat from old to new node")
- old_node_mempool = os.path.join(old_node.chain_path, 'mempool.dat')
- new_node_mempool = os.path.join(new_node.chain_path, 'mempool.dat')
- os.rename(old_node_mempool, new_node_mempool)
+ old_node_mempool = old_node.chain_path / "mempool.dat"
+ new_node_mempool = new_node.chain_path / "mempool.dat"
+ old_node_mempool.rename(new_node_mempool)
self.log.info("Start new node and verify mempool contains the tx")
self.start_node(1)
@@ -70,7 +69,7 @@ class MempoolCompatibilityTest(BitcoinTestFramework):
self.stop_node(1)
self.log.info("Move mempool.dat from new to old node")
- os.rename(new_node_mempool, old_node_mempool)
+ new_node_mempool.rename(old_node_mempool)
self.log.info("Start old node again and verify mempool contains both txs")
self.start_node(0, ['-nowallet'])