diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-21 11:39:33 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-21 12:26:51 +0000 |
| commit | 780d09b0c1eb823f02fc61de6dbf99b2d5cefaca (patch) | |
| tree | 14e9a6be0ea40b3a05b17a8d214d7169bb232716 /src | |
| parent | 487b9496c06cb4abcf3674b598c1bb56899548be (diff) | |
fix: create_announcement_event test helper uses correct NIP-34 tag format
NIP-34 specifies single clone/relays tags with multiple values, not multiple
tags with single values. Update test helper to match spec.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nostr/events.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nostr/events.rs b/src/nostr/events.rs index 39014da..1d5a50f 100644 --- a/src/nostr/events.rs +++ b/src/nostr/events.rs | |||
| @@ -495,17 +495,19 @@ mod tests { | |||
| 495 | vec![identifier.to_string()], | 495 | vec![identifier.to_string()], |
| 496 | )]; | 496 | )]; |
| 497 | 497 | ||
| 498 | for url in clone_urls { | 498 | // NIP-34: Single clone tag with multiple values |
| 499 | if !clone_urls.is_empty() { | ||
| 499 | tags.push(Tag::custom( | 500 | tags.push(Tag::custom( |
| 500 | nostr_sdk::TagKind::Clone, | 501 | nostr_sdk::TagKind::Clone, |
| 501 | vec![url.to_string()], | 502 | clone_urls.iter().map(|s| s.to_string()), |
| 502 | )); | 503 | )); |
| 503 | } | 504 | } |
| 504 | 505 | ||
| 505 | for relay in relays { | 506 | // NIP-34: Single relays tag with multiple values |
| 507 | if !relays.is_empty() { | ||
| 506 | tags.push(Tag::custom( | 508 | tags.push(Tag::custom( |
| 507 | nostr_sdk::TagKind::Relays, | 509 | nostr_sdk::TagKind::Relays, |
| 508 | vec![relay.to_string()], | 510 | relays.iter().map(|s| s.to_string()), |
| 509 | )); | 511 | )); |
| 510 | } | 512 | } |
| 511 | 513 | ||