replace usage of IsValidPublicKeyHex() in subpackages.

This commit is contained in:
fiatjaf
2024-01-18 20:30:20 -03:00
parent 9457c5a794
commit 2586144a5c
6 changed files with 14 additions and 14 deletions

View File

@@ -81,7 +81,7 @@ func (p *DynamicSigner) HandleRequest(event *nostr.Event) (
}
targetUser := event.Tags.GetFirst([]string{"p", ""})
if targetUser == nil || !nostr.IsValidPublicKeyHex((*targetUser)[1]) {
if targetUser == nil || !nostr.IsValid32ByteHex((*targetUser)[1]) {
return req, resp, eventResponse, false, fmt.Errorf("invalid \"p\" tag")
}
@@ -153,7 +153,7 @@ func (p *DynamicSigner) HandleRequest(event *nostr.Event) (
break
}
thirdPartyPubkey := req.Params[0]
if !nostr.IsValidPublicKeyHex(thirdPartyPubkey) {
if !nostr.IsValidPublicKey(thirdPartyPubkey) {
resultErr = fmt.Errorf("first argument to 'nip04_encrypt' is not a pubkey string")
break
}
@@ -179,7 +179,7 @@ func (p *DynamicSigner) HandleRequest(event *nostr.Event) (
break
}
thirdPartyPubkey := req.Params[0]
if !nostr.IsValidPublicKeyHex(thirdPartyPubkey) {
if !nostr.IsValidPublicKey(thirdPartyPubkey) {
resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a pubkey string")
break
}

View File

@@ -134,7 +134,7 @@ func (p *StaticKeySigner) HandleRequest(event *nostr.Event) (
break
}
thirdPartyPubkey := req.Params[0]
if !nostr.IsValidPublicKeyHex(thirdPartyPubkey) {
if !nostr.IsValidPublicKey(thirdPartyPubkey) {
resultErr = fmt.Errorf("first argument to 'nip04_encrypt' is not a pubkey string")
break
}
@@ -156,7 +156,7 @@ func (p *StaticKeySigner) HandleRequest(event *nostr.Event) (
break
}
thirdPartyPubkey := req.Params[0]
if !nostr.IsValidPublicKeyHex(thirdPartyPubkey) {
if !nostr.IsValidPublicKey(thirdPartyPubkey) {
resultErr = fmt.Errorf("first argument to 'nip04_decrypt' is not a pubkey string")
break
}