mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
test: Use clean chain in MempoolCompatibilityTest
The test creates enough blocks itself, so there is no need to have more. Also, remove os import.
This commit is contained in:
parent
e35fb7bc48
commit
fa7f65b0f8
1 changed files with 5 additions and 6 deletions
|
@ -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'])
|
||||
|
|
Loading…
Add table
Reference in a new issue