From 65ac6ef83205c41653e6ffe2acd664f968926fb2 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 23 Feb 2026 13:29:47 +0000 Subject: 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::): 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). --- tests/purgatory.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/purgatory.rs b/tests/purgatory.rs index efc28c9..553271f 100644 --- a/tests/purgatory.rs +++ b/tests/purgatory.rs @@ -66,6 +66,13 @@ isolated_purgatory_test!(test_announcement_served_after_git_push); isolated_purgatory_test!(test_bare_repo_exists_for_purgatory_announcement); isolated_purgatory_test!(test_state_event_accepted_for_purgatory_announcement); +// ============================================================ +// Deletion Event Tests (NIP-09) +// ============================================================ + +isolated_purgatory_test!(test_deletion_by_event_id_removes_purgatory_announcement); +isolated_purgatory_test!(test_deletion_by_coordinate_removes_purgatory_announcement); + // ============================================================ // State Event Purgatory Tests (already implemented) // ============================================================ -- cgit v1.2.3