diff --git a/x/evidence/client/cli/tx_test.go b/x/evidence/client/cli/tx_test.go index bbb162564c..94b9ed517d 100644 --- a/x/evidence/client/cli/tx_test.go +++ b/x/evidence/client/cli/tx_test.go @@ -24,10 +24,6 @@ import ( ) func TestGetQueryCmd(t *testing.T) { - cmd := cli.GetQueryCmd() - cmd.SetOut(io.Discard) - require.NotNil(t, cmd) - encCfg := testutilmod.MakeTestEncodingConfig(evidence.AppModuleBasic{}) kr := keyring.NewInMemory(encCfg.Codec) baseCtx := client.Context{}. @@ -98,6 +94,10 @@ func TestGetQueryCmd(t *testing.T) { clientCtx := tc.ctxGen().WithOutput(&outBuf) ctx := svrcmd.CreateExecuteContext(context.Background()) + cmd := cli.GetQueryCmd() + cmd.SetOut(io.Discard) + require.NotNil(t, cmd) + cmd.SetContext(ctx) cmd.SetArgs(tc.args)