fix: Fix Evidence CLI query flag parsing (#13458)
This commit is contained in:
parent
3e2504510f
commit
709b4e2ca0
@ -32,7 +32,6 @@ $ %s query %s --page=2 --limit=50
|
||||
),
|
||||
),
|
||||
Args: cobra.MaximumNArgs(1),
|
||||
DisableFlagParsing: true,
|
||||
SuggestionsMinimumDistance: 2,
|
||||
RunE: QueryEvidenceCmd(),
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
|
||||
"github.com/stretchr/testify/require"
|
||||
abci "github.com/tendermint/tendermint/abci/types"
|
||||
tmbytes "github.com/tendermint/tendermint/libs/bytes"
|
||||
@ -17,6 +16,9 @@ import (
|
||||
coretypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
tmtypes "github.com/tendermint/tendermint/types"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client/flags"
|
||||
svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
|
||||
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||
clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli"
|
||||
@ -99,6 +101,21 @@ func TestGetQueryCmd(t *testing.T) {
|
||||
"evidence: []\npagination: null",
|
||||
false,
|
||||
},
|
||||
"all evidence (json output)": {
|
||||
[]string{
|
||||
fmt.Sprintf("--%s=json", flags.FlagOutput),
|
||||
},
|
||||
func() client.Context {
|
||||
bz, _ := encCfg.Codec.Marshal(&sdk.TxResponse{})
|
||||
c := newMockTendermintRPC(abci.ResponseQuery{
|
||||
Value: bz,
|
||||
})
|
||||
return baseCtx.WithClient(c)
|
||||
},
|
||||
"",
|
||||
`{"evidence":[],"pagination":null}`,
|
||||
false,
|
||||
},
|
||||
}
|
||||
|
||||
for name, tc := range testCases {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user