@@ -25,8 +25,10 @@ def add_options(self, parser):
2525
2626 def set_test_params (self ):
2727 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' ])
3032
3133 def skip_test_if_missing_module (self ):
3234 self .skip_if_no_wallet ()
@@ -40,12 +42,13 @@ def run_test(self):
4042 self .stop_node (1 )
4143 shutil .copyfile (wallet_path , wallet_backup_path )
4244 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 )
4847
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 ):
4952 self .log .info ("Generate keys for wallet with address type: {}" .format (output_type ))
5053 idx = i + 1
5154 for _ in range (90 ):
@@ -59,9 +62,10 @@ def run_test(self):
5962 assert not address_details ["isscript" ] and not address_details ["iswitness" ]
6063 elif i == 1 :
6164 assert address_details ["isscript" ] and not address_details ["iswitness" ]
62- else :
65+ elif i == 2 :
6366 assert not address_details ["isscript" ] and address_details ["iswitness" ]
64-
67+ elif i == 3 :
68+ assert address_details ["isscript" ] and address_details ["iswitness" ]
6569
6670 self .log .info ("Send funds to wallet" )
6771 self .nodes [0 ].sendtoaddress (addr_oldpool , 10 )
@@ -87,6 +91,8 @@ def run_test(self):
8791 assert_equal (self .nodes [idx ].getaddressinfo (self .nodes [idx ].getnewaddress (address_type = output_type ))['hdkeypath' ], "m/49h/1h/0h/0/110" )
8892 elif output_type == 'bech32' :
8993 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" )
9096 else :
9197 assert_equal (self .nodes [idx ].getaddressinfo (self .nodes [idx ].getnewaddress (address_type = output_type ))['hdkeypath' ], "m/0'/0'/110'" )
9298
0 commit comments