purple: switch local testing to staging testing

This commit is contained in:
William Casarin
2024-01-28 17:32:44 -08:00
parent 0c63f2ee26
commit ff6b19578e
8 changed files with 25 additions and 15 deletions

View File

@@ -325,7 +325,13 @@ func decode_nostr_event(txt: String) -> NostrResponse? {
func encode_json<T: Encodable>(_ val: T) -> String? {
let encoder = JSONEncoder()
encoder.outputFormatting = .withoutEscapingSlashes
return (try? encoder.encode(val)).map { String(decoding: $0, as: UTF8.self) }
return (try? encode_json_data(val)).map { String(decoding: $0, as: UTF8.self) }
}
func encode_json_data<T: Encodable>(_ val: T) throws -> Data {
let encoder = JSONEncoder()
encoder.outputFormatting = .withoutEscapingSlashes
return try encoder.encode(val)
}
func decode_nostr_event_json(json: String) -> NostrEvent? {