@@ -380,6 +380,7 @@ fn wallet__import_multi() {
380
380
381
381
// Uses descriptor (valid): success - true
382
382
// on v18 onwards, it will return a watch-only warning.
383
+ // NOTE: Works only for v18 onwards, as v17 doesn't support descriptors.
383
384
let req3 = ImportMultiRequest {
384
385
desc : Some ( dummy_desc. to_string ( ) ) ,
385
386
script_pub_key : None ,
@@ -388,24 +389,23 @@ fn wallet__import_multi() {
388
389
389
390
let json: ImportMulti = node. client . import_multi ( & [ req1, req2, req3] ) . expect ( "importmulti" ) ;
390
391
391
- // result of req1: should succeed, no error, no warning.
392
- // just any random script doesn't work with v17.
393
392
#[ cfg( not( feature = "v17" ) ) ]
394
393
{
394
+ // result of req1: should succeed, no error, no warning.
395
+ // just any random script doesn't work with v17.
395
396
assert ! ( json. 0 [ 0 ] . success) ;
396
397
assert ! ( json. 0 [ 0 ] . error. is_none( ) ) ;
398
+
399
+ // result of req3: should succeed, with warning for v18 onwards
400
+ assert ! ( json. 0 [ 2 ] . success) ;
401
+ assert ! ( json. 0 [ 2 ] . error. is_none( ) ) ;
402
+ assert ! ( json. 0 [ 2 ] . warnings. is_some( ) ) ;
397
403
}
398
404
399
405
// result of req2: should fail with error (wallet already contains privkey for address/script)
400
406
assert ! ( !json. 0 [ 1 ] . success) ;
401
407
assert ! ( json. 0 [ 1 ] . error. is_some( ) ) ;
402
408
403
- // result of req3: should succeed, with warning for v18 onwards
404
- assert ! ( json. 0 [ 2 ] . success) ;
405
- assert ! ( json. 0 [ 2 ] . error. is_none( ) ) ;
406
- // warning field only available for v18 onwards.
407
- #[ cfg( not( feature = "v17" ) ) ]
408
- assert ! ( json. 0 [ 2 ] . warnings. is_some( ) ) ;
409
409
}
410
410
411
411
#[ test]
0 commit comments