mirror of
git://jb55.com/damus
synced 2024-10-01 09:20:47 +00:00
nostrscript: fix nscripts not loading
This was broken by the recent nip19 changes, let's fix it again
Fixes: cb4adf06f1
("nip19: added swift enums")
Changelog-Fixed: Fix nostrscripts not loading
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
4defab73d0
commit
28f292f692
@ -70,10 +70,14 @@ enum Bech32Object : Equatable {
|
||||
case nprofile(NProfile)
|
||||
case nrelay(String)
|
||||
case naddr(NAddr)
|
||||
|
||||
|
||||
static func parse(_ str: String) -> Bech32Object? {
|
||||
if str.starts(with: "nscript"), let decoded = try? bech32_decode(str) {
|
||||
return .nscript(decoded.data.bytes)
|
||||
}
|
||||
|
||||
var b: nostr_bech32_t = nostr_bech32()
|
||||
|
||||
|
||||
let bytes = Array(str.utf8)
|
||||
|
||||
bytes.withUnsafeBufferPointer { buffer in
|
||||
|
Loading…
Reference in New Issue
Block a user