Commit 0c4551d
refactor: migrate gift-wrap to mostro-core 0.9.1 nip59 module
Bump mostro-core to 0.9.1 and nostr-sdk to 0.44.1, then replace the
local NIP-59 implementation with the centralized
`wrap_message` / `unwrap_message` / `validate_response` API exposed
by `mostro_core::nip59`.
- send_dm now delegates to wrap_message; identity_keys parameter is
dropped because nostr-sdk 0.44 enforces rumor.pubkey == seal.pubkey
(SenderMismatch). The single signer drives rumor authorship, seal
signing, and the inner tuple signature.
- Admin flows (storage::admin_send_dm, take_dispute) now sign the
whole pipeline with admin_keys, aligning with how
send_admin_gift_wrap_dm already worked for plain DMs.
- parse_dm_events uses unwrap_message; print_dm_events uses
validate_response, with one documented exception for `NewOrder`
pushes that arrive without a request_id (range-trade child).
- Drops gift_wrap_from_seal_with_pow, create_gift_wrap_event,
send_gift_wrap_dm{,_internal}, send_admin_gift_wrap_dm,
determine_message_type, create_expiration_tags, and the
MessageType enum, all subsumed by the new API.
- NIP-17 `PrivateDirectMessage` (kind 14) and the per-dispute
shared-key chat transport are out of scope and left untouched.
Knock-on changes from the dependency bump: rename
NOSTR_REPLACEABLE_EVENT_KIND to NOSTR_ORDER_EVENT_KIND (same value
38383, preserves derived BIP32 keys), Timestamp::as_u64 →
as_secs, and add the new `initiator` / `solver_pubkey` fields
to RestoredDisputesInfo in tests.
Tests: 4 new wiring unit tests in messaging.rs (wrap→unwrap
roundtrip, SECRET semantics, PoW, wrong-keys → None) and 2 new
integration tests in tests/parser_dms.rs covering the
wrap_message → parse_dm_events handshake.
Closes #163
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 92e5e02 commit 0c4551d
24 files changed
Lines changed: 296 additions & 420 deletions
File tree
- src
- cli
- parser
- util
- tests
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
187 | 186 | | |
188 | 187 | | |
189 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
0 commit comments