Summary
NIP-17 private direct messages use a gift wrap envelope (kind 1059) with NIP-44 encrypted content. The GiftWrapEventStrategy enforces structural rules but there are no integration tests exercising these validations end-to-end.
What to test
- Gift wrap with exactly one
p tag and valid NIP-44 content → accepted (OK)
- Gift wrap with no
p tag → rejected with invalid: gift wrap event (kind 1059) must have a p tag...
- Gift wrap with more than one
p tag → rejected with invalid: gift wrap event (kind 1059) must have exactly one p tag
- Gift wrap with a malformed NIP-44 payload → rejected with
invalid: gift wrap content must be a valid NIP-44 v2 payload...
- Recipient can query their gift wraps via
#p tag filter
Relevant code
src/handlers/event-strategies/gift-wrap-event-strategy.ts
src/utils/nip44.ts
src/constants/base.ts — EventKinds.GIFT_WRAP, EventKinds.SEAL, EventKinds.DIRECT_MESSAGE
Suggested location
test/integration/features/nip-17/nip-17.feature
Summary
NIP-17 private direct messages use a gift wrap envelope (kind 1059) with NIP-44 encrypted content. The
GiftWrapEventStrategyenforces structural rules but there are no integration tests exercising these validations end-to-end.What to test
ptag and valid NIP-44 content → accepted (OK)ptag → rejected withinvalid: gift wrap event (kind 1059) must have a p tag...ptag → rejected withinvalid: gift wrap event (kind 1059) must have exactly one p taginvalid: gift wrap content must be a valid NIP-44 v2 payload...#ptag filterRelevant code
src/handlers/event-strategies/gift-wrap-event-strategy.tssrc/utils/nip44.tssrc/constants/base.ts—EventKinds.GIFT_WRAP,EventKinds.SEAL,EventKinds.DIRECT_MESSAGESuggested location
test/integration/features/nip-17/nip-17.feature