upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-23 13:29:47 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-23 13:29:47 +0000
commit65ac6ef83205c41653e6ffe2acd664f968926fb2 (patch)
treec31301c599dfaffd75e61af3f6004d1b95373a72 /tests
parentc368f9132a16d45a17ad55943e4b68ba85a6835b (diff)
feat: remove purgatory announcements on NIP-09 deletion events
Kind 5 deletion events signed by the announcement author now evict the corresponding purgatory entry and delete the bare repository from disk. Both NIP-09 reference styles are supported: - e tag (event ID): matches the purgatory entry whose event ID equals the tag value - a tag (coordinate 30617:<pubkey>:<identifier>): matches by coordinate, only removes entries with created_at <= deletion event created_at per NIP-09 spec Author-only enforcement: coordinate pubkey and e-tag owner must match the deletion event pubkey; third-party deletion attempts are silently ignored. Includes 6 unit tests and 2 integration tests (event ID and coordinate paths).
Diffstat (limited to 'tests')
-rw-r--r--tests/purgatory.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/purgatory.rs b/tests/purgatory.rs
index efc28c9..553271f 100644
--- a/tests/purgatory.rs
+++ b/tests/purgatory.rs
@@ -67,6 +67,13 @@ isolated_purgatory_test!(test_bare_repo_exists_for_purgatory_announcement);
67isolated_purgatory_test!(test_state_event_accepted_for_purgatory_announcement); 67isolated_purgatory_test!(test_state_event_accepted_for_purgatory_announcement);
68 68
69// ============================================================ 69// ============================================================
70// Deletion Event Tests (NIP-09)
71// ============================================================
72
73isolated_purgatory_test!(test_deletion_by_event_id_removes_purgatory_announcement);
74isolated_purgatory_test!(test_deletion_by_coordinate_removes_purgatory_announcement);
75
76// ============================================================
70// State Event Purgatory Tests (already implemented) 77// State Event Purgatory Tests (already implemented)
71// ============================================================ 78// ============================================================
72 79