From 45987fe03de09ab891c944e5b3d051f5984e66f3 Mon Sep 17 00:00:00 2001 From: randogoth Date: Tue, 29 Sep 2026 11:58:00 +0300 Subject: [PATCH] =?UTF-8?q?test:=20pin=20accepted=5Fstate's=20contract=20?= =?UTF-8?q?=E2=80=94=20main=20tier,=20blocked,=20never=20accepted?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/src/store.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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");