@@ -25,8 +25,10 @@ def add_options(self, parser):
25
25
26
26
def set_test_params (self ):
27
27
self .setup_clean_chain = True
28
- self .num_nodes = 4
29
- self .extra_args = [[], ['-keypool=100' ], ['-keypool=100' ], ['-keypool=100' ]]
28
+ self .num_nodes = 5
29
+ self .extra_args = [[]]
30
+ for _ in range (self .num_nodes - 1 ):
31
+ self .extra_args .append (['-keypool=100' ])
30
32
31
33
def skip_test_if_missing_module (self ):
32
34
self .skip_if_no_wallet ()
@@ -40,12 +42,13 @@ def run_test(self):
40
42
self .stop_node (1 )
41
43
shutil .copyfile (wallet_path , wallet_backup_path )
42
44
self .start_node (1 , self .extra_args [1 ])
43
- self .connect_nodes (0 , 1 )
44
- self .connect_nodes (0 , 2 )
45
- self .connect_nodes (0 , 3 )
46
-
47
- for i , output_type in enumerate (["legacy" , "p2sh-segwit" , "bech32" ]):
45
+ for i in [1 , 2 , 3 , 4 ]:
46
+ self .connect_nodes (0 , i )
48
47
48
+ output_types = ["legacy" , "p2sh-segwit" , "bech32" ]
49
+ if self .options .descriptors :
50
+ output_types .append ("bech32m" )
51
+ for i , output_type in enumerate (output_types ):
49
52
self .log .info ("Generate keys for wallet with address type: {}" .format (output_type ))
50
53
idx = i + 1
51
54
for _ in range (90 ):
@@ -59,9 +62,10 @@ def run_test(self):
59
62
assert not address_details ["isscript" ] and not address_details ["iswitness" ]
60
63
elif i == 1 :
61
64
assert address_details ["isscript" ] and not address_details ["iswitness" ]
62
- else :
65
+ elif i == 2 :
63
66
assert not address_details ["isscript" ] and address_details ["iswitness" ]
64
-
67
+ elif i == 3 :
68
+ assert address_details ["isscript" ] and address_details ["iswitness" ]
65
69
66
70
self .log .info ("Send funds to wallet" )
67
71
self .nodes [0 ].sendtoaddress (addr_oldpool , 10 )
@@ -87,6 +91,8 @@ def run_test(self):
87
91
assert_equal (self .nodes [idx ].getaddressinfo (self .nodes [idx ].getnewaddress (address_type = output_type ))['hdkeypath' ], "m/49h/1h/0h/0/110" )
88
92
elif output_type == 'bech32' :
89
93
assert_equal (self .nodes [idx ].getaddressinfo (self .nodes [idx ].getnewaddress (address_type = output_type ))['hdkeypath' ], "m/84h/1h/0h/0/110" )
94
+ elif output_type == 'bech32m' :
95
+ assert_equal (self .nodes [idx ].getaddressinfo (self .nodes [idx ].getnewaddress (address_type = output_type ))['hdkeypath' ], "m/86h/1h/0h/0/110" )
90
96
else :
91
97
assert_equal (self .nodes [idx ].getaddressinfo (self .nodes [idx ].getnewaddress (address_type = output_type ))['hdkeypath' ], "m/0'/0'/110'" )
92
98
0 commit comments