From 02675a7d82fbc0c9611ac68de1dd8b0416323b9e Mon Sep 17 00:00:00 2001 From: "k." Date: Sat, 28 Dec 2024 20:11:03 +0330 Subject: [PATCH] fix(filter): parsing kinds with uint16 instead of int16. (#94) --- types/filter/filter_easyjson.go | 4 ++-- types/message/message.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/filter/filter_easyjson.go b/types/filter/filter_easyjson.go index 9bfd28d..642acb8 100644 --- a/types/filter/filter_easyjson.go +++ b/types/filter/filter_easyjson.go @@ -77,7 +77,7 @@ func easyjson4d398eaaDecodeGithubComDezhTechImmortalTypesFilter(in *jlexer.Lexer out.Kinds = (out.Kinds)[:0] } for !in.IsDelim(']') { - v2 := types.Kind(in.Int16()) + v2 := types.Kind(in.Uint16()) out.Kinds = append(out.Kinds, v2) in.WantComma() } @@ -195,7 +195,7 @@ func easyjson4d398eaaEncodeGithubComDezhTechImmortalTypesFilter(out *jwriter.Wri if v6 > 0 { out.RawByte(',') } - out.Int(int(v7)) + out.Uint16(uint16(v7)) } out.RawByte(']') } diff --git a/types/message/message.go b/types/message/message.go index d3ab99a..ddf61c4 100644 --- a/types/message/message.go +++ b/types/message/message.go @@ -123,7 +123,7 @@ func (em Event) EncodeToJSON() ([]byte, error) { return res, nil } -// Req reperesents a NIP-01 REQ message. +// Req represents a NIP-01 REQ message. type Req struct { SubscriptionID string filter.Filters