refactor: clean-up test helpers and tmcli (#13805)

This commit is contained in:
Julien Robert
2022-11-09 11:13:27 +00:00
committed by GitHub
parent 76be73022a
commit 4f7d9ea233
36 changed files with 453 additions and 582 deletions
+2 -4
View File
@@ -5,8 +5,6 @@ import (
"fmt"
"path/filepath"
tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
@@ -52,7 +50,7 @@ func runConfigCmd(cmd *cobra.Command, args []string) error {
cmd.Println(conf.ChainID)
case flags.FlagKeyringBackend:
cmd.Println(conf.KeyringBackend)
case tmcli.OutputFlag:
case flags.FlagOutput:
cmd.Println(conf.Output)
case flags.FlagNode:
cmd.Println(conf.Node)
@@ -72,7 +70,7 @@ func runConfigCmd(cmd *cobra.Command, args []string) error {
conf.SetChainID(value)
case flags.FlagKeyringBackend:
conf.SetKeyringBackend(value)
case tmcli.OutputFlag:
case flags.FlagOutput:
conf.SetOutput(value)
case flags.FlagNode:
conf.SetNode(value)
+3 -1
View File
@@ -76,7 +76,9 @@ const (
FlagReverse = "reverse"
FlagTip = "tip"
FlagAux = "aux"
FlagOutput = tmcli.OutputFlag
// FlagOutput is the flag to set the output format.
// This differs from FlagOutputDocument that is used to set the output file.
FlagOutput = tmcli.OutputFlag
// Tendermint logging flags
FlagLogLevel = "log_level"
+1 -2
View File
@@ -7,7 +7,6 @@ import (
"strings"
"github.com/spf13/cobra"
tmcli "github.com/tendermint/tendermint/libs/cli"
tmtypes "github.com/tendermint/tendermint/types"
"github.com/cosmos/cosmos-sdk/client"
@@ -59,7 +58,7 @@ func ValidatorCommand() *cobra.Command {
}
cmd.Flags().String(flags.FlagNode, "tcp://localhost:26657", "<host>:<port> to Tendermint RPC interface for this chain")
cmd.Flags().StringP(tmcli.OutputFlag, "o", "text", "Output format (text|json)")
cmd.Flags().StringP(flags.FlagOutput, "o", "text", "Output format (text|json)")
cmd.Flags().Int(flags.FlagPage, query.DefaultPage, "Query a specific page of paginated results")
cmd.Flags().Int(flags.FlagLimit, 100, "Query number of results returned per page")