From 98e9a10679d44684e0401b32e4d1f2cc9f4b94ad Mon Sep 17 00:00:00 2001 From: mmsqe Date: Mon, 14 Oct 2024 17:09:58 +0800 Subject: [PATCH] Problem: cannot unmarshal gov param into a *big.Int * when use back LegacyDec, since main branch skip any cosmossdk.io/math.LegacyDec value, * no need to unmarshal here, for more info: https://github.com/cosmos/cosmos-sdk/blob/4274dcf4429cc725a3bda58410bd8325d721a3e9/x/tx/signing/aminojson/options.go#L134 --- x/tx/signing/aminojson/encoder.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/x/tx/signing/aminojson/encoder.go b/x/tx/signing/aminojson/encoder.go index e954c2651e30..c4bf10d04dbe 100644 --- a/x/tx/signing/aminojson/encoder.go +++ b/x/tx/signing/aminojson/encoder.go @@ -51,12 +51,7 @@ func cosmosDecEncoder(_ *Encoder, v protoreflect.Value, w io.Writer) error { if val == "" { return jsonMarshal(w, "0") } - var dec math.LegacyDec - err := dec.Unmarshal([]byte(val)) - if err != nil { - return err - } - return jsonMarshal(w, dec.String()) + return jsonMarshal(w, val) case []byte: if len(val) == 0 { return jsonMarshal(w, "0")