Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Oct 7, 2024
1 parent 0ced709 commit 3504e41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/v2/autocli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ func encoder(encoder aminojson.Encoder) aminojson.Encoder {

customEncoder.DefineScalarEncoding("cosmos.Dec", func(_ *aminojson.Encoder, value protoreflect.Value, w io.Writer) error {
decStr := value.String()
if strings.Contains(decStr, "[") { // check if it's a bytes field (e.g mint inflation)
decStr = string(value.Bytes())
}

// If the decimal doesn't contain a point, we assume it's a value formatted using the legacy
// `math.Dec`. So we try to parse it as an integer and then convert it to a
Expand Down

0 comments on commit 3504e41

Please sign in to comment.