mirror of
https://github.com/block/buzz.git
synced 2026-10-30 22:11:36 +00:00
Four orchestrator_postgres_tests used make_kind9_event for both the
first and second calls. Nostr event IDs are deterministic over
(pubkey, created_at, kind, tags, content), so two calls with identical
inputs within the same second produce the same event ID. Step 3c
(event duplicate precheck) fires before the intended guard — lifecycle
guard, epoch guard, or proof-replay uniqueness — causing the tests to
assert the wrong error.
Fix: add make_kind9_event_msg(keys, channel_id, content) helper and
use distinct content strings for every second call that is not
deliberately testing step-3c behaviour.
orchestrator_pg_concurrent_enrollment_converges: format content with
task index so each spawned task produces a unique event.
orchestrator_pg_lifecycle_advance_rejects_final_use: second call uses
"lifecycle-advance-second-msg" → NoActiveBinding or BindingRetired
fires as intended.
orchestrator_pg_epoch_guard_catches_zero_row_update: second call uses
"epoch-guard-second-msg" → epoch UPDATE guard runs and passes.
orchestrator_pg_proof_replay_is_rejected: second call uses
"proof-replay-second-msg" → step-3d proof-owner mismatch fires
(ProofReplayed) instead of step-3c DuplicateEvent.
After this change all 22 NIP-FI ignored PG tests pass (15/15
orchestrator_postgres_tests, 7/7 postgres_tests).
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>