Track per-outcome activity clocks in public positions

This commit is contained in:
2026-12-05 04:51:33 +08:00
parent 7e6b94aeed
commit 8b4e2c4fa3
9 changed files with 135 additions and 17 deletions
+20
View File
@@ -4234,6 +4234,26 @@ fn public_positions_walk_a_mergeable_pair_and_held_settlement() {
json!([])
);
assert!(read(&e, json!({"user":"alice","event_id":"1","condition":"e"})).is_err());
let db = rusqlite::Connection::open(&path).unwrap();
db.execute(
"UPDATE wallet_movements SET at_ms=123999 WHERE request_id='s'",
[],
)
.unwrap();
let instant = read(
&e,
json!({"user":"alice","start":123,"end":123,"sort_by":"TIMESTAMP"}),
)
.unwrap();
assert_eq!(instant["data"].as_array().unwrap().len(), 2);
assert_eq!(instant["data"][0]["first_entry_at"], 123);
assert_eq!(instant["data"][0]["last_event_at"], 123);
assert_eq!(
read(&e, json!({"user":"alice","start":124})).unwrap()["data"],
json!([])
);
assert!(read(&e, json!({"user":"alice","start":124,"end":123})).is_err());
drop(db);
let first = read(&e, json!({"user":"alice","status":"MERGEABLE","limit":1})).unwrap();
assert_eq!(first["data"][0]["mergeable"], true);
let cursor = first["pagination"]["next_cursor"].as_str().unwrap();