aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-01-08 08:34:35 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-01-08 08:35:01 +0100
commit5082324225bf9b7f59a6a7efe3d1225fcacbc627 (patch)
treeccddb979b1ec6a402da9a818ba7793477c10f852 /test
parent76b45d5fd7eb99f612cf9c10a7617de4019f6cd5 (diff)
parenta7599c80ebb9579df45e2d6ccf3168302cf42f03 (diff)
downloadbitcoin-5082324225bf9b7f59a6a7efe3d1225fcacbc627.tar.xz
Merge #20688: test: run mempool_compatibility.py even with wallet disabled
a7599c80ebb9579df45e2d6ccf3168302cf42f03 test: run mempool_compatibility.py even with wallet disabled (Michael Dietz) Pull request description: Another functional test rewritten as proposed in https://github.com/bitcoin/bitcoin/issues/20078 ACKs for top commit: MarcoFalke: review ACK a7599c80ebb9579df45e2d6ccf3168302cf42f03 didn't test Tree-SHA512: cc7a617e5489ed27bbdbdee85a82fa08525375061f7f4524577a6b8ecb340396adac88419b51f513be22ca53edd0a3bd5d572d9f43ffc2c18550b0ef9069d238
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/mempool_compatibility.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/functional/mempool_compatibility.py b/test/functional/mempool_compatibility.py
index 8ac91bd008..eb08765ebf 100755
--- a/test/functional/mempool_compatibility.py
+++ b/test/functional/mempool_compatibility.py
@@ -16,15 +16,15 @@ Only v0.15.2 is required by this test. The rest is used in other backwards compa
import os
from test_framework.test_framework import BitcoinTestFramework
+from test_framework.wallet import MiniWallet
class MempoolCompatibilityTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
- self.wallet_names = [None, self.default_wallet_name]
+ self.wallet_names = [None]
def skip_test_if_missing_module(self):
- self.skip_if_no_wallet()
self.skip_if_no_previous_releases()
def setup_network(self):
@@ -38,8 +38,15 @@ class MempoolCompatibilityTest(BitcoinTestFramework):
def run_test(self):
self.log.info("Test that mempool.dat is compatible between versions")
- old_node = self.nodes[0]
- new_node = self.nodes[1]
+ old_node, new_node = self.nodes
+ new_wallet = MiniWallet(new_node)
+ new_wallet.generate(1)
+ new_node.generate(100)
+ # Sync the nodes to ensure old_node has the block that contains the coinbase that new_wallet will spend.
+ # Otherwise, because coinbases are only valid in a block and not as loose txns, if the nodes aren't synced
+ # unbroadcasted_tx won't pass old_node's `MemPoolAccept::PreChecks`.
+ self.connect_nodes(0, 1)
+ self.sync_blocks()
recipient = old_node.getnewaddress()
self.stop_node(1)
@@ -58,7 +65,7 @@ class MempoolCompatibilityTest(BitcoinTestFramework):
assert old_tx_hash in new_node.getrawmempool()
self.log.info("Add unbroadcasted tx to mempool on new node and shutdown")
- unbroadcasted_tx_hash = new_node.sendtoaddress(recipient, 0.0001)
+ unbroadcasted_tx_hash = new_wallet.send_self_transfer(from_node=new_node)['txid']
assert unbroadcasted_tx_hash in new_node.getrawmempool()
mempool = new_node.getrawmempool(True)
assert mempool[unbroadcasted_tx_hash]['unbroadcast']