damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | LICENSE

commit a6a275d90b8b0fbbd37d29bd6e118ac0123a8985
parent 453d57405b510adf72a317b5d12d176083487cd8
Author: William Casarin <jb55@jb55.com>
Date:   Sun, 17 Apr 2022 14:24:25 -0700

fix event tags encoding

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mdamus/Nostr/NostrEvent.swift | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/damus/Nostr/NostrEvent.swift b/damus/Nostr/NostrEvent.swift @@ -196,11 +196,14 @@ func event_commitment(ev: NostrEvent, tags: String) -> String { let encoder = JSONEncoder() let str_data = try! encoder.encode(ev.content) let content = String(decoding: str_data, as: UTF8.self) - return "[0,\"\(ev.pubkey)\",\(ev.created_at),\(ev.kind),\(tags),\(content)]" + let commit = "[0,\"\(ev.pubkey)\",\(ev.created_at),\(ev.kind),\(tags),\(content)]" + //print("COMMIT", commit) + return commit } func calculate_event_id(ev: NostrEvent) -> String { let tags_encoder = JSONEncoder() + tags_encoder.outputFormatting = .withoutEscapingSlashes let tags_data = try! tags_encoder.encode(ev.tags) let tags = String(decoding: tags_data, as: UTF8.self)