From 9a15d220b0b296d03e0b3e303eede6f4707f8ef9 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 28 Jul 2025 09:36:31 -0300 Subject: [PATCH] nip46: reword invalid pubkey hex messages. --- nip46/dynamic-signer.go | 4 ++-- nip46/static-key-signer.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/nip46/dynamic-signer.go b/nip46/dynamic-signer.go index 94ac21d..931f47b 100644 --- a/nip46/dynamic-signer.go +++ b/nip46/dynamic-signer.go @@ -163,7 +163,7 @@ func (p *DynamicSigner) HandleRequest(ctx context.Context, event nostr.Event) ( } thirdPartyPubkey, err := nostr.PubKeyFromHex(req.Params[0]) if err != nil { - resultErr = fmt.Errorf("first argument to 'nip44_encrypt' is not a valid pubkey string") + resultErr = fmt.Errorf("first argument to 'nip44_encrypt' is not a valid pubkey hex") break } if p.AuthorizeEncryption != nil && !p.AuthorizeEncryption(ctx, event.PubKey) { @@ -185,7 +185,7 @@ func (p *DynamicSigner) HandleRequest(ctx context.Context, event nostr.Event) ( } thirdPartyPubkey, err := nostr.PubKeyFromHex(req.Params[0]) if err != nil { - resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a valid pubkey string") + resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a valid pubkey hex") break } if p.AuthorizeEncryption != nil && !p.AuthorizeEncryption(ctx, event.PubKey) { diff --git a/nip46/static-key-signer.go b/nip46/static-key-signer.go index 74e5bca..8816a81 100644 --- a/nip46/static-key-signer.go +++ b/nip46/static-key-signer.go @@ -117,7 +117,7 @@ func (p *StaticKeySigner) HandleRequest(_ context.Context, event nostr.Event) ( } thirdPartyPubkey, err := nostr.PubKeyFromHex(req.Params[0]) if err != nil { - resultErr = fmt.Errorf("first argument to 'nip04_encrypt' is not a valid pubkey string") + resultErr = fmt.Errorf("first argument to 'nip04_encrypt' is not a valid pubkey hex") break } plaintext := req.Params[1] @@ -140,7 +140,7 @@ func (p *StaticKeySigner) HandleRequest(_ context.Context, event nostr.Event) ( } thirdPartyPubkey, err := nostr.PubKeyFromHex(req.Params[0]) if err != nil { - resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a valid pubkey string") + resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a valid pubkey hex") break } ciphertext := req.Params[1] @@ -163,7 +163,7 @@ func (p *StaticKeySigner) HandleRequest(_ context.Context, event nostr.Event) ( } thirdPartyPubkey, err := nostr.PubKeyFromHex(req.Params[0]) if err != nil { - resultErr = fmt.Errorf("first argument to 'nip04_encrypt' is not a valid pubkey string") + resultErr = fmt.Errorf("first argument to 'nip04_encrypt' is not a valid pubkey hex") break } plaintext := req.Params[1] @@ -186,7 +186,7 @@ func (p *StaticKeySigner) HandleRequest(_ context.Context, event nostr.Event) ( } thirdPartyPubkey, err := nostr.PubKeyFromHex(req.Params[0]) if err != nil { - resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a valid pubkey string") + resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a valid pubkey hex") break } ciphertext := req.Params[1]