Skip to content

Commit 7e504c4

Browse files
committed
test: assert positive wallet-scoped activity search
The mixed v1/v2 test already proved the default wallet cannot see the hardware row (the leak check). Add the positive side so the test reads complete: a wallet-scoped search for each wallet's own address returns exactly that wallet's single row.
1 parent 473c918 commit 7e504c4

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

src/modules/activity/tests.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,39 @@ mod tests {
10851085
.unwrap();
10861086
assert!(scoped_search.is_empty());
10871087

1088+
// Positive side: each wallet's own address search returns exactly its own row.
1089+
let hardware_search = db
1090+
.get_activities(
1091+
Some(wallet_id),
1092+
None,
1093+
None,
1094+
None,
1095+
Some("bc1qv2hardware".to_string()),
1096+
None,
1097+
None,
1098+
None,
1099+
None,
1100+
)
1101+
.unwrap();
1102+
assert_eq!(hardware_search.len(), 1);
1103+
assert_eq!(hardware_search[0].get_wallet_id(), wallet_id);
1104+
1105+
let default_search = db
1106+
.get_activities(
1107+
Some(DEFAULT_WALLET_ID),
1108+
None,
1109+
None,
1110+
None,
1111+
Some("bc1qv1default".to_string()),
1112+
None,
1113+
None,
1114+
None,
1115+
None,
1116+
)
1117+
.unwrap();
1118+
assert_eq!(default_search.len(), 1);
1119+
assert_eq!(default_search[0].get_wallet_id(), DEFAULT_WALLET_ID);
1120+
10881121
cleanup(&db_path);
10891122
}
10901123

0 commit comments

Comments
 (0)