Skip to content

Commit

Permalink
Problem: cannot unmarshal gov param into a *big.Int
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mmsqe committed Oct 14, 2024
1 parent ba8668a commit 98e9a10
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions x/tx/signing/aminojson/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 98e9a10

Please sign in to comment.