From 2abd2ec8a52fe9eefcf750e8a1b3c35d0c9361c8 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Wed, 6 Mar 2024 15:33:20 +0100 Subject: [PATCH] feat(client/v2): marshal enum as string (#19653) --- client/v2/CHANGELOG.md | 5 +++-- client/v2/autocli/query.go | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index 59d67f187702..de1a4852c32e 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -36,12 +36,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -## [v2.0.0-beta.2] - 2023-02-19 +## [v2.0.0-beta.2] - 2024-XX-XX ### Improvements +* [#19618](https://github.com/cosmos/cosmos-sdk/pull/19618) Marshal enum as string in queries. * [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Use client context from root (or enhanced) command in autocli commands. - * Note, the given command must have a `client.Context` in its context. + * Note, the given command must have a `client.Context` in its context. * [#19216](https://github.com/cosmos/cosmos-sdk/pull/19216) Do not overwrite TxConfig, use directly the one provided in context. TxConfig should always be set in the `client.Context` in `root.go` of an app. ### Bug Fixes diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 41fec4a23f5f..92a04d732afe 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -111,6 +111,7 @@ func (b *Builder) BuildQueryMethodCommand(ctx context.Context, descriptor protor outputType := util.ResolveMessageType(b.TypeResolver, descriptor.Output()) encoderOptions := aminojson.EncoderOptions{ Indent: " ", + EnumAsString: true, DoNotSortFields: true, TypeResolver: b.TypeResolver, FileResolver: b.FileResolver,