diff --git a/core/src/store.rs b/core/src/store.rs index 20c25d1..a13258c 100644 --- a/core/src/store.rs +++ b/core/src/store.rs @@ -901,6 +901,18 @@ mod tests { assert_eq!(store.history("alice@example.org").unwrap(), [([9u8; 32], 42)]); } + #[test] + fn accepted_state_reads_the_row_not_a_wish() { + let store = temp_store("accepted-state"); + let identity = [9u8; KEY_LEN]; + assert_eq!(store.accepted_state("a@example.org").unwrap(), None); + store.accept("a@example.org", &identity).unwrap(); + assert_eq!(store.accepted_state("a@example.org").unwrap(), Some(true)); + // block() is an UPDATE, not a DELETE: the row survives at active = 0. + store.block("a@example.org").unwrap(); + assert_eq!(store.accepted_state("a@example.org").unwrap(), Some(false)); + } + #[test] fn unpin_returns_to_trust_on_first_use() { let store = temp_store("unpin");