Skip to content

Commit d71086c

Browse files
alltheseasclaude
andcommitted
Add NIP-62 end-to-end websocket tests
38 tests covering the full NIP-62 Request to Vanish lifecycle over websocket against a live strfry relay: event submission, cron-based deletion sweep (polled), re-broadcast prevention, relay tag validation (matching, non-matching, missing), kind 5 protection of kind 62 in both orderings, deletion tombstone bypass via import path, gift wrap cleanup and blocking (ALL_RELAYS and specific serviceUrl), NIP-09 deletion event sweep, cross-pubkey isolation, timestamp boundary semantics, persistence across restart, NIP-11 advertisement, and feature flag behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 97f2124 commit d71086c

File tree

4 files changed

+787
-0
lines changed

4 files changed

+787
-0
lines changed

test/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,16 @@ These commands test the query engine, with and without `limit`:
2626
These commands test the monitor engine:
2727

2828
perl test/filterFuzzTest.pl monitor
29+
30+
## NIP-62 (Request to Vanish) E2E tests
31+
32+
These tests start a live strfry relay and exercise the full NIP-62 lifecycle
33+
over websocket: vanish requests, cron-based event deletion, re-broadcast
34+
prevention, gift wrap cleanup, relay tag validation, and more.
35+
36+
Requires Python 3.8+ with `secp256k1` and `websockets`:
37+
38+
pip install secp256k1 websockets
39+
python3 test/nip62_e2e_test.py
40+
41+
The suite takes ~3 minutes (cron sweep polling at 30s intervals for 5 tests).

test/cfgs/nip62Test.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
db = "./strfry-db-nip62-test/"
2+
3+
events {
4+
rejectEventsOlderThanSeconds = 9999999999
5+
}
6+
7+
relay {
8+
port = 40562
9+
10+
auth {
11+
serviceUrl = "ws://127.0.0.1:40562"
12+
}
13+
14+
nip62 {
15+
enabled = true
16+
}
17+
}

test/cfgs/nip62TestDisabled.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
db = "./strfry-db-nip62-test/"
2+
3+
events {
4+
rejectEventsOlderThanSeconds = 9999999999
5+
}
6+
7+
relay {
8+
port = 40562
9+
10+
nip62 {
11+
enabled = false
12+
}
13+
}

0 commit comments

Comments
 (0)