Skip to content

test: integration tests for NIP-02 contact lists (Kind 3) #509

@phoenix-server

Description

@phoenix-server

Summary

NIP-02 contact lists use kind 3, which is a replaceable event under NIP-16. While NIP-16 replaceable event semantics are already tested generically, there are no integration tests confirming the specific contact list / follow list use case works end-to-end.

What to test

  • Alice publishes a kind 3 event (contact list) → stored and retrievable
  • Alice publishes a second kind 3 event (updated contact list) → replaces the first; only the latest is returned by REQ
  • Tie-breaker: two kind 3 events with identical timestamps → only the one with the lower event ID is kept
  • Bob subscribes to Alice's kind 3 events → receives her latest contact list

Relevant code

  • src/constants/base.tsEventKinds.CONTACT_LIST
  • src/handlers/event-strategies/replaceable-event-strategy.ts

Suggested location

test/integration/features/nip-02/nip-02.feature

Metadata

Metadata

Assignees

Labels

testUnit or integration test improvements

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions