fix encoding and decoding of event "extra" fields.

fixes https://github.com/nbd-wtf/go-nostr/issues/31
This commit is contained in:
fiatjaf
2023-01-03 14:46:50 -03:00
parent 4a62a753e6
commit 3349b2a52b
3 changed files with 63 additions and 5 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ func (evt *Event) UnmarshalJSON(payload []byte) error {
evt.Sig = string(id)
default:
var anyValue any
json.Unmarshal(v.MarshalTo(nil), anyValue)
json.Unmarshal(v.MarshalTo([]byte{}), &anyValue)
evt.extra[key] = anyValue
}
})