30
30
class BackwardsCompatibilityTest (BitcoinTestFramework ):
31
31
def set_test_params (self ):
32
32
self .setup_clean_chain = True
33
- self .num_nodes = 10
33
+ self .num_nodes = 8
34
34
# Add new version after each release:
35
35
self .extra_args = [
36
36
[
"-addresstype=bech32" ,
"[email protected] " ],
# Pre-release: use to mine blocks. noban for immediate tx relay
@@ -41,8 +41,6 @@ def set_test_params(self):
41
41
[
"-nowallet" ,
"-walletrbf=1" ,
"-addresstype=bech32" ,
"[email protected] " ],
# v22.0
42
42
[
"-nowallet" ,
"-walletrbf=1" ,
"-addresstype=bech32" ,
"[email protected] " ],
# v0.21.0
43
43
[
"-nowallet" ,
"-walletrbf=1" ,
"-addresstype=bech32" ,
"[email protected] " ],
# v0.20.1
44
- [
"-nowallet" ,
"-walletrbf=1" ,
"-addresstype=bech32" ,
"[email protected] " ],
# v0.19.1
45
- ["-nowallet" , "-walletrbf=1" , "-addresstype=bech32" , "-whitelist=127.0.0.1" ], # v0.18.1
46
44
]
47
45
self .wallet_names = [self .default_wallet_name ]
48
46
@@ -60,8 +58,6 @@ def setup_nodes(self):
60
58
220000 ,
61
59
210000 ,
62
60
200100 ,
63
- 190100 ,
64
- 180100 ,
65
61
])
66
62
67
63
self .start_nodes ()
@@ -88,18 +84,16 @@ def major_version_at_least(self, node, major):
88
84
def run_test (self ):
89
85
node_miner = self .nodes [0 ]
90
86
node_master = self .nodes [1 ]
91
- node_v21 = self .nodes [self .num_nodes - 4 ]
92
- node_v18 = self .nodes [self .num_nodes - 1 ]
87
+ node_v21 = self .nodes [self .num_nodes - 2 ]
88
+ node_v20 = self .nodes [self .num_nodes - 1 ] # bdb only
93
89
94
90
legacy_nodes = self .nodes [2 :] # Nodes that support legacy wallets
95
- legacy_only_nodes = self .nodes [- 3 :] # Nodes that only support legacy wallets
96
- descriptors_nodes = self .nodes [2 :- 3 ] # Nodes that support descriptor wallets
91
+ descriptors_nodes = self .nodes [2 :- 1 ] # Nodes that support descriptor wallets
97
92
98
93
self .generatetoaddress (node_miner , COINBASE_MATURITY + 1 , node_miner .getnewaddress ())
99
94
100
95
# Sanity check the test framework:
101
- res = node_v18 .getblockchaininfo ()
102
- assert_equal (res ['blocks' ], COINBASE_MATURITY + 1 )
96
+ assert_equal (node_v20 .getblockchaininfo ()["blocks" ], COINBASE_MATURITY + 1 )
103
97
104
98
self .log .info ("Test wallet backwards compatibility..." )
105
99
# Create a number of wallets and open them in older versions:
@@ -206,13 +200,11 @@ def run_test(self):
206
200
)
207
201
208
202
# Check that descriptor wallets don't work on legacy only nodes
209
- self .log .info ("Test descriptor wallet incompatibility on:" )
210
- for node in legacy_only_nodes :
211
- self .log .info (f"- { node .version } " )
212
- # Descriptor wallets appear to be corrupted wallets to old software
213
- assert self .major_version_less_than (node , 21 )
214
- for wallet_name in ["w1" , "w2" , "w3" ]:
215
- assert_raises_rpc_error (- 4 , "Wallet file verification failed: wallet.dat corrupt, salvage failed" , node .loadwallet , wallet_name )
203
+ self .log .info ("Test descriptor wallet incompatibility on v0.20" )
204
+ # Descriptor wallets appear to be corrupted wallets to old software
205
+ assert self .major_version_equals (node_v20 , 20 )
206
+ for wallet_name in ["w1" , "w2" , "w3" ]:
207
+ assert_raises_rpc_error (- 4 , "Wallet file verification failed: wallet.dat corrupt, salvage failed" , node_v20 .loadwallet , wallet_name )
216
208
217
209
# w1 cannot be opened by 0.21 since it contains a taproot descriptor
218
210
self .log .info ("Test that 0.21 cannot open wallet containing tr() descriptors" )
0 commit comments