@@ -50,15 +50,23 @@ def run_test(self):
5050
5151 # prepare the user wallet with 3 watch only addresses
5252 wo1 = usernode .getnewaddress ()
53+ wo1_desc = usernode .getaddressinfo (wo1 )["desc" ]
5354 wo2 = usernode .getnewaddress ()
55+ wo2_desc = usernode .getaddressinfo (wo2 )["desc" ]
5456 wo3 = usernode .getnewaddress ()
57+ wo3_desc = usernode .getaddressinfo (wo3 )["desc" ]
5558
5659 usernode .createwallet (wallet_name = 'wo' , disable_private_keys = True )
5760 wo_wallet = usernode .get_wallet_rpc ('wo' )
5861
59- wo_wallet .importaddress (wo1 )
60- wo_wallet .importaddress (wo2 )
61- wo_wallet .importaddress (wo3 )
62+ import_res = wo_wallet .importdescriptors (
63+ [
64+ {"desc" : wo1_desc , "timestamp" : "now" },
65+ {"desc" : wo2_desc , "timestamp" : "now" },
66+ {"desc" : wo3_desc , "timestamp" : "now" },
67+ ]
68+ )
69+ assert_equal (all ([r ["success" ] for r in import_res ]), True )
6270
6371 self .log .info ('Start transactions' )
6472
@@ -124,16 +132,20 @@ def run_test(self):
124132 restorenode .createwallet (wallet_name = 'wo' , disable_private_keys = True )
125133 restorewo_wallet = restorenode .get_wallet_rpc ('wo' )
126134
127- # for descriptor wallets, the test framework maps the importaddress RPC to the
128- # importdescriptors RPC (with argument 'timestamp'='now'), which always rescans
135+ # importdescriptors with "timestamp": "now" always rescans
129136 # blocks of the past 2 hours, based on the current MTP timestamp; in order to avoid
130137 # importing the last address (wo3), we advance the time further and generate 10 blocks
131138 set_node_times (self .nodes , cur_time + ten_days + ten_days + ten_days + ten_days )
132139 self .generatetoaddress (minernode , 10 , m1 )
133140
134- restorewo_wallet .importaddress (wo1 , rescan = False )
135- restorewo_wallet .importaddress (wo2 , rescan = False )
136- restorewo_wallet .importaddress (wo3 , rescan = False )
141+ import_res = restorewo_wallet .importdescriptors (
142+ [
143+ {"desc" : wo1_desc , "timestamp" : "now" },
144+ {"desc" : wo2_desc , "timestamp" : "now" },
145+ {"desc" : wo3_desc , "timestamp" : "now" },
146+ ]
147+ )
148+ assert_equal (all ([r ["success" ] for r in import_res ]), True )
137149
138150 # check user has 0 balance and no transactions
139151 assert_equal (restorewo_wallet .getbalance (), 0 )
0 commit comments