Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
parent
35955817c1
commit
d73199f8b3
@ -1,6 +1,7 @@
|
||||
package autocli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"time"
|
||||
@ -8,6 +9,7 @@ import (
|
||||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
|
||||
"cosmossdk.io/x/tx/signing/aminojson"
|
||||
"github.com/cockroachdb/errors"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/spf13/cobra"
|
||||
"google.golang.org/protobuf/reflect/protoreflect"
|
||||
|
||||
@ -112,9 +114,7 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript
|
||||
}
|
||||
|
||||
cmd, err := b.buildMethodCommandCommon(descriptor, options, func(cmd *cobra.Command, input protoreflect.Message) error {
|
||||
if noIndent, _ := cmd.Flags().GetBool(flags.FlagNoIndent); noIndent {
|
||||
encoderOptions.Indent = ""
|
||||
}
|
||||
cmd.SetContext(context.WithValue(context.Background(), client.ClientContextKey, &b.ClientCtx))
|
||||
|
||||
clientConn, err := getClientConn(cmd)
|
||||
if err != nil {
|
||||
@ -126,6 +126,10 @@ func (b *Builder) BuildQueryMethodCommand(descriptor protoreflect.MethodDescript
|
||||
return err
|
||||
}
|
||||
|
||||
if noIndent, _ := cmd.Flags().GetBool(flags.FlagNoIndent); noIndent {
|
||||
encoderOptions.Indent = ""
|
||||
}
|
||||
|
||||
enc := encoder(aminojson.NewEncoder(encoderOptions))
|
||||
bz, err := enc.Marshal(output.Interface())
|
||||
if err != nil {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user