Skip to content

Commit a9f6a57

Browse files
committed
Merge bitcoin#30920: test: Remove 0.16.3 test from wallet_backwards_compatibility.py
fae44c8 test: Remove 0.16.3 test from wallet_backwards_compatibility.py (MarcoFalke) Pull request description: The test checks that any wallet created with current master can not be loaded with `v0.16.3`. This is interesting documentation, however it is probably not something to keep as a test, because: * It seems like an extremely unlikely (and unsupported) edge case that someone creates a wallet with master and then goes ahead to open it with a long EOL software version. * A better test would be the inverse: Create a wallet with `v0.16.3` and open it with current master. This is already tested in `wallet_upgradewallet.py`, where I've added an additional balance check before upgrading the `v0.16.3` wallet. * The test is intermittently failing when shutting down the `v0.16.3` node, for example in bitcoin#30875 (comment). The exact cause is unclear, but given that the test isn't worthy to keep, removing it will ensure that the error disappears. ACKs for top commit: Sjors: utACK fae44c8 fanquake: ACK fae44c8 - I agree that test seems to have past it's usefulness, and the fact that it otherwise causes intemittent issues is further reason to remove it. Tree-SHA512: 85bf428e616e0880198c1a7529936520505d7fa87c2eeb87a0457f13b50a163accaf5f80f9364dea978f6bd14b0b5350cda88f49aa7584682c8b5e0b0b117724
2 parents 03696bb + fae44c8 commit a9f6a57

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

test/functional/wallet_backwards_compatibility.py

+6-21
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def add_options(self, parser):
3333

3434
def set_test_params(self):
3535
self.setup_clean_chain = True
36-
self.num_nodes = 12
36+
self.num_nodes = 11
3737
# Add new version after each release:
3838
self.extra_args = [
3939
["-addresstype=bech32", "[email protected]"], # Pre-release: use to mine blocks. noban for immediate tx relay
@@ -47,7 +47,6 @@ def set_test_params(self):
4747
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "[email protected]"], # v0.19.1
4848
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=127.0.0.1"], # v0.18.1
4949
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=127.0.0.1"], # v0.17.2
50-
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=127.0.0.1", "-wallet=wallet.dat"], # v0.16.3
5150
]
5251
self.wallet_names = [self.default_wallet_name]
5352

@@ -68,7 +67,6 @@ def setup_nodes(self):
6867
190100,
6968
180100,
7069
170200,
71-
160300,
7270
])
7371

7472
self.start_nodes()
@@ -133,18 +131,17 @@ def test_v19_addmultisigaddress(self):
133131
def run_test(self):
134132
node_miner = self.nodes[0]
135133
node_master = self.nodes[1]
136-
node_v21 = self.nodes[self.num_nodes - 6]
137-
node_v17 = self.nodes[self.num_nodes - 2]
138-
node_v16 = self.nodes[self.num_nodes - 1]
134+
node_v21 = self.nodes[self.num_nodes - 5]
135+
node_v17 = self.nodes[self.num_nodes - 1]
139136

140137
legacy_nodes = self.nodes[2:] # Nodes that support legacy wallets
141-
legacy_only_nodes = self.nodes[-5:] # Nodes that only support legacy wallets
142-
descriptors_nodes = self.nodes[2:-5] # Nodes that support descriptor wallets
138+
legacy_only_nodes = self.nodes[-4:] # Nodes that only support legacy wallets
139+
descriptors_nodes = self.nodes[2:-4] # Nodes that support descriptor wallets
143140

144141
self.generatetoaddress(node_miner, COINBASE_MATURITY + 1, node_miner.getnewaddress())
145142

146143
# Sanity check the test framework:
147-
res = node_v16.getblockchaininfo()
144+
res = node_v17.getblockchaininfo()
148145
assert_equal(res['blocks'], COINBASE_MATURITY + 1)
149146

150147
self.log.info("Test wallet backwards compatibility...")
@@ -215,9 +212,6 @@ def run_test(self):
215212
# In descriptors wallet mode, run this test on the nodes that support descriptor wallets
216213
# In legacy wallets mode, run this test on the nodes that support legacy wallets
217214
for node in descriptors_nodes if self.options.descriptors else legacy_nodes:
218-
if self.major_version_less_than(node, 17):
219-
# loadwallet was introduced in v0.17.0
220-
continue
221215
self.log.info(f"- {node.version}")
222216
for wallet_name in ["w1", "w2", "w3"]:
223217
if self.major_version_less_than(node, 18) and wallet_name == "w3":
@@ -290,15 +284,6 @@ def run_test(self):
290284
node_v17.assert_start_raises_init_error(["-wallet=w3"], "Error: Error loading w3: Wallet requires newer version of Bitcoin Core")
291285
self.start_node(node_v17.index)
292286

293-
# No wallet created in master can be opened in 0.16
294-
self.log.info("Test that wallets created in master are too new for 0.16")
295-
self.stop_node(node_v16.index)
296-
for wallet_name in ["w1", "w2", "w3"]:
297-
if self.options.descriptors:
298-
node_v16.assert_start_raises_init_error([f"-wallet={wallet_name}"], f"Error: {wallet_name} corrupt, salvage failed")
299-
else:
300-
node_v16.assert_start_raises_init_error([f"-wallet={wallet_name}"], f"Error: Error loading {wallet_name}: Wallet requires newer version of Bitcoin Core")
301-
302287
# When descriptors are enabled, w1 cannot be opened by 0.21 since it contains a taproot descriptor
303288
if self.options.descriptors:
304289
self.log.info("Test that 0.21 cannot open wallet containing tr() descriptors")

test/functional/wallet_upgradewallet.py

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ def copy_split_hd():
185185
self.restart_node(0)
186186
copy_v16()
187187
wallet = node_master.get_wallet_rpc(self.default_wallet_name)
188+
assert_equal(wallet.getbalance(), v16_3_balance)
188189
self.log.info("Test upgradewallet without a version argument")
189190
self.test_upgradewallet(wallet, previous_version=159900, expected_version=169900)
190191
# wallet should still contain the same balance

0 commit comments

Comments
 (0)