fix: x/tx/signing/aminojson: revert json.NewEncoder that added newlines (#16701)

This commit is contained in:
Emmanuel T Odeke 2023-06-26 11:02:17 -07:00 committed by GitHub
parent aca89be7b2
commit 417f455ea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -305,7 +305,12 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er
}
func jsonMarshal(w io.Writer, v interface{}) error {
return json.NewEncoder(w).Encode(v)
blob, err := json.Marshal(v)
if err != nil {
return err
}
_, err = w.Write(blob)
return err
}
func (enc Encoder) marshalList(list protoreflect.List, writer io.Writer) error {