Skip to content

Commit e568c1d

Browse files
committed
Merge bitcoin#32088: test: switch wallet_crosschain.py to signet and drop testnet4
cec14ee test: switch wallet_crosschain.py to signet (Sjors Provoost) 9c29515 test: drop testnet4 from wallet_crosschain.py (Sjors Provoost) Pull request description: It's sufficient to check only one test network, so this PR reverts the addition of testnet4 from bitcoin#29775. Testnet3 is deprecated. Instead of moving to testnet4, which might also be deprecated in the future, use signet. ACKs for top commit: fjahr: utACK cec14ee maflcko: lgtm ACK cec14ee 🌰 Tree-SHA512: c5aad6e7d251957f090145eac906f7985fddc3e3ba82df7184d72b961f9c856d324a1065ac98323b75501d136bd7b669fcc2565b9e66b0743eb3f3906ef37570
2 parents e8f6a48 + cec14ee commit e568c1d

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

test/functional/wallet_crosschain.py

+6-32
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def add_options(self, parser):
1111
self.add_wallet_options(parser)
1212

1313
def set_test_params(self):
14-
self.num_nodes = 3
14+
self.num_nodes = 2
1515
self.setup_clean_chain = True
1616

1717
def skip_test_if_missing_module(self):
@@ -20,16 +20,11 @@ def skip_test_if_missing_module(self):
2020
def setup_network(self):
2121
self.add_nodes(self.num_nodes)
2222

23-
# Switch node 1 to testnet before starting it.
24-
self.nodes[1].chain = 'testnet3'
25-
self.nodes[1].extra_args = ['-maxconnections=0', '-prune=550'] # disable testnet sync
26-
self.nodes[1].replace_in_config([('regtest=', 'testnet='), ('[regtest]', '[test]')])
27-
28-
# Switch node 2 to testnet4 before starting it.
29-
self.nodes[2].chain = 'testnet4'
30-
self.nodes[2].extra_args = ['-maxconnections=0', '-prune=550'] # disable testnet4 sync
31-
self.nodes[2].replace_in_config([('regtest=', 'testnet4='), ('[regtest]', '[testnet4]')])
32-
23+
# Switch node 1 to any network different from regtest before starting it.
24+
self.nodes[1].chain = 'signet'
25+
# Disable network sync and prevent disk space warning on low resource CI
26+
self.nodes[1].extra_args = ['-maxconnections=0', '-prune=550']
27+
self.nodes[1].replace_in_config([('regtest=', 'signet='), ('[regtest]', '[signet]')])
3328
self.start_nodes()
3429

3530
def run_test(self):
@@ -45,40 +40,19 @@ def run_test(self):
4540
self.nodes[1].createwallet(node1_wallet)
4641
self.nodes[1].backupwallet(node1_wallet_backup)
4742
self.nodes[1].unloadwallet(node1_wallet)
48-
node2_wallet = self.nodes[2].datadir_path / 'node2_wallet'
49-
node2_wallet_backup = self.nodes[0].datadir_path / 'node2_wallet.bak'
50-
self.nodes[2].createwallet(node2_wallet)
51-
self.nodes[2].backupwallet(node2_wallet_backup)
52-
self.nodes[2].unloadwallet(node2_wallet)
5343

5444
self.log.info("Loading/restoring wallets into nodes with a different genesis block")
5545

5646
if self.options.descriptors:
5747
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[0].loadwallet, node1_wallet)
58-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[0].loadwallet, node2_wallet)
5948
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[1].loadwallet, node0_wallet)
60-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[2].loadwallet, node0_wallet)
61-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[1].loadwallet, node2_wallet)
62-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[2].loadwallet, node1_wallet)
6349
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[0].restorewallet, 'w', node1_wallet_backup)
64-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[0].restorewallet, 'w', node2_wallet_backup)
6550
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[1].restorewallet, 'w', node0_wallet_backup)
66-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[2].restorewallet, 'w', node0_wallet_backup)
67-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[1].restorewallet, 'w', node2_wallet_backup)
68-
assert_raises_rpc_error(-18, 'Wallet file verification failed.', self.nodes[2].restorewallet, 'w', node1_wallet_backup)
6951
else:
7052
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[0].loadwallet, node1_wallet)
71-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[0].loadwallet, node2_wallet)
7253
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[1].loadwallet, node0_wallet)
73-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[2].loadwallet, node0_wallet)
74-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[1].loadwallet, node2_wallet)
75-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[2].loadwallet, node1_wallet)
7654
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[0].restorewallet, 'w', node1_wallet_backup)
77-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[0].restorewallet, 'w', node2_wallet_backup)
7855
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[1].restorewallet, 'w', node0_wallet_backup)
79-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[2].restorewallet, 'w', node0_wallet_backup)
80-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[1].restorewallet, 'w', node2_wallet_backup)
81-
assert_raises_rpc_error(-4, 'Wallet files should not be reused across chains.', self.nodes[2].restorewallet, 'w', node1_wallet_backup)
8256

8357
if not self.options.descriptors:
8458
self.log.info("Override cross-chain wallet load protection")

0 commit comments

Comments
 (0)