Skip to content

Commit 2096697

Browse files
committed
Resolve assert checks for v17
1 parent cc79a67 commit 2096697

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

integration_test/tests/wallet.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ fn wallet__import_multi() {
380380

381381
// Uses descriptor (valid): success - true
382382
// on v18 onwards, it will return a watch-only warning.
383+
// NOTE: Works only for v18 onwards, as v17 doesn't support descriptors.
383384
let req3 = ImportMultiRequest {
384385
desc: Some(dummy_desc.to_string()),
385386
script_pub_key: None,
@@ -388,24 +389,23 @@ fn wallet__import_multi() {
388389

389390
let json: ImportMulti = node.client.import_multi(&[req1, req2, req3]).expect("importmulti");
390391

391-
// result of req1: should succeed, no error, no warning.
392-
// just any random script doesn't work with v17.
393392
#[cfg(not(feature = "v17"))]
394393
{
394+
// result of req1: should succeed, no error, no warning.
395+
// just any random script doesn't work with v17.
395396
assert!(json.0[0].success);
396397
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());
397403
}
398404

399405
// result of req2: should fail with error (wallet already contains privkey for address/script)
400406
assert!(!json.0[1].success);
401407
assert!(json.0[1].error.is_some());
402408

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());
409409
}
410410

411411
#[test]

0 commit comments

Comments
 (0)