From b48d2249b9160eeb5dc10c1f4c3373f578d21f97 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 3 Apr 2025 00:23:26 -0300 Subject: [PATCH] small things. --- nip42/nip42.go | 2 +- nip44/nip44.go | 2 +- nip60/wallet.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nip42/nip42.go b/nip42/nip42.go index 2c05dbc..9d68ec4 100644 --- a/nip42/nip42.go +++ b/nip42/nip42.go @@ -39,7 +39,7 @@ func ValidateAuthEvent(event *nostr.Event, challenge string, relayURL string) (p return "", false } - if event.Tags.GetFirst([]string{"challenge", challenge}) == nil { + if event.Tags.FindWithValue("challenge", challenge) == nil { return "", false } diff --git a/nip44/nip44.go b/nip44/nip44.go index e01a6e5..253dab2 100644 --- a/nip44/nip44.go +++ b/nip44/nip44.go @@ -104,7 +104,7 @@ func Decrypt(b64ciphertextWrapped string, conversationKey [32]byte) (string, err decoded, err := base64.StdEncoding.DecodeString(b64ciphertextWrapped) if err != nil { - return "", fmt.Errorf("invalid base64") + return "", fmt.Errorf("invalid base64: %w", err) } if decoded[0] != version { diff --git a/nip60/wallet.go b/nip60/wallet.go index b5346ce..ded01f6 100644 --- a/nip60/wallet.go +++ b/nip60/wallet.go @@ -142,11 +142,11 @@ func loadWallet( for ie := range deletions { w.Lock() if !eosed { - for _, tag := range ie.Event.Tags.All([]string{"e", ""}) { + for tag := range ie.Event.Tags.FindAll("e") { w.pendingDeletions = append(w.pendingDeletions, tag[1]) } } else { - for _, tag := range ie.Event.Tags.All([]string{"e", ""}) { + for tag := range ie.Event.Tags.FindAll("e") { w.removeDeletedToken(tag[1]) } }