fix length checks from previous commit.

This commit is contained in:
fiatjaf
2025-06-27 13:24:03 -03:00
parent 67c787c8d3
commit 56568bdeed
2 changed files with 5 additions and 5 deletions

View File

@@ -28,12 +28,12 @@ func easyjsonDecodeEvent(in *jlexer.Lexer, out *Event) {
switch key {
case "id":
b := in.UnsafeBytes()
if len(b) == 32 {
if len(b) == 64 {
hex.Decode(out.ID[:], b)
}
case "pubkey":
b := in.UnsafeBytes()
if len(b) == 32 {
if len(b) == 64 {
hex.Decode(out.PubKey[:], b)
}
case "created_at":
@@ -72,7 +72,7 @@ func easyjsonDecodeEvent(in *jlexer.Lexer, out *Event) {
out.Content = in.String()
case "sig":
b := in.UnsafeBytes()
if len(b) == 64 {
if len(b) == 128 {
hex.Decode(out.Sig[:], b)
}
}