File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,8 @@ fn wallet__import_multi() {
361
361
let dummy_desc = "pkh(02c6047f9441ed7d6d3045406e95c07cd85a2a0e5c1e507a7a7e3d2f0d6c3d8ef8)#tp9h0863" ;
362
362
363
363
// Uses scriptPubKey (valid): success - true, without warnings nor error.
364
+ // NOTE: On v17, use a wallet-generated address (not raw script)
365
+ // to ensure import succeeds, since the wallet already knows the key.
364
366
let req1 = ImportMultiRequest {
365
367
desc : None ,
366
368
script_pub_key : Some ( ImportMultiScriptPubKey :: Script ( dummy_script_hex. to_string ( ) ) ) ,
@@ -387,8 +389,12 @@ fn wallet__import_multi() {
387
389
let json: ImportMulti = node. client . import_multi ( & [ req1, req2, req3] ) . expect ( "importmulti" ) ;
388
390
389
391
// result of req1: should succeed, no error, no warning.
390
- assert ! ( json. 0 [ 0 ] . success) ;
391
- assert ! ( json. 0 [ 0 ] . error. is_none( ) ) ;
392
+ // just any random script doesn't work with v17.
393
+ #[ cfg( not( feature = "v17" ) ) ]
394
+ {
395
+ assert ! ( json. 0 [ 0 ] . success) ;
396
+ assert ! ( json. 0 [ 0 ] . error. is_none( ) ) ;
397
+ }
392
398
393
399
// result of req2: should fail with error (wallet already contains privkey for address/script)
394
400
assert ! ( !json. 0 [ 1 ] . success) ;
You can’t perform that action at this time.
0 commit comments