diff --git a/CHANGELOG.md b/CHANGELOG.md index e4706f20e..94baea314 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -113,6 +113,7 @@ be used to retrieve the actual proposal `Content`. Also the `NewMsgSubmitProposa - TxBuilder.Sign - TxBuilder.SignStdTx * (client) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CLIContext` is renamed to `Context`. `Context` and all related methods have been moved from package context to client. +* (modules) [\#6326](https://github.com/cosmos/cosmos-sdk/pull/6326) `AppModuleBasic.GetQueryCmd` now takes a single `CLIContext` parameter. Migration guide: diff --git a/simapp/cmd/simcli/main.go b/simapp/cmd/simcli/main.go index 780fcaca7..234e54988 100644 --- a/simapp/cmd/simcli/main.go +++ b/simapp/cmd/simcli/main.go @@ -103,7 +103,11 @@ func queryCmd(cdc *codec.Codec) *cobra.Command { ) // add modules' query commands - simapp.ModuleBasics.AddQueryCommands(queryCmd, cdc) + clientCtx := client.Context{} + clientCtx = clientCtx. + WithJSONMarshaler(appCodec). + WithCodec(cdc) + simapp.ModuleBasics.AddQueryCommands(queryCmd, clientCtx) return queryCmd } diff --git a/tests/mocks/tendermint_tm_db_DB.go b/tests/mocks/tendermint_tm_db_DB.go index bed59a498..cdf5e5ab0 100644 --- a/tests/mocks/tendermint_tm_db_DB.go +++ b/tests/mocks/tendermint_tm_db_DB.go @@ -6,7 +6,7 @@ package mocks import ( gomock "github.com/golang/mock/gomock" - tm_db "github.com/tendermint/tm-db" + db "github.com/tendermint/tm-db" reflect "reflect" ) @@ -106,10 +106,10 @@ func (mr *MockDBMockRecorder) Has(arg0 interface{}) *gomock.Call { } // Iterator mocks base method -func (m *MockDB) Iterator(arg0, arg1 []byte) (tm_db.Iterator, error) { +func (m *MockDB) Iterator(arg0, arg1 []byte) (db.Iterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Iterator", arg0, arg1) - ret0, _ := ret[0].(tm_db.Iterator) + ret0, _ := ret[0].(db.Iterator) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -121,10 +121,10 @@ func (mr *MockDBMockRecorder) Iterator(arg0, arg1 interface{}) *gomock.Call { } // NewBatch mocks base method -func (m *MockDB) NewBatch() tm_db.Batch { +func (m *MockDB) NewBatch() db.Batch { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "NewBatch") - ret0, _ := ret[0].(tm_db.Batch) + ret0, _ := ret[0].(db.Batch) return ret0 } @@ -149,10 +149,10 @@ func (mr *MockDBMockRecorder) Print() *gomock.Call { } // ReverseIterator mocks base method -func (m *MockDB) ReverseIterator(arg0, arg1 []byte) (tm_db.Iterator, error) { +func (m *MockDB) ReverseIterator(arg0, arg1 []byte) (db.Iterator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ReverseIterator", arg0, arg1) - ret0, _ := ret[0].(tm_db.Iterator) + ret0, _ := ret[0].(db.Iterator) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/tests/mocks/types_module_module.go b/tests/mocks/types_module_module.go index 22b353a97..a5f7efdd4 100644 --- a/tests/mocks/types_module_module.go +++ b/tests/mocks/types_module_module.go @@ -106,31 +106,31 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterRESTRoutes(arg0, arg1 interfac } // GetTxCmd mocks base method -func (m *MockAppModuleBasic) GetTxCmd(arg0 client.Context) *cobra.Command { +func (m *MockAppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd", arg0) + ret := m.ctrl.Call(m, "GetTxCmd", clientCtx) ret0, _ := ret[0].(*cobra.Command) return ret0 } // GetTxCmd indicates an expected call of GetTxCmd -func (mr *MockAppModuleBasicMockRecorder) GetTxCmd(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleBasicMockRecorder) GetTxCmd(clientCtx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetTxCmd), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetTxCmd), clientCtx) } // GetQueryCmd mocks base method -func (m *MockAppModuleBasic) GetQueryCmd(arg0 *codec.Codec) *cobra.Command { +func (m *MockAppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd", arg0) + ret := m.ctrl.Call(m, "GetQueryCmd", clientCtx) ret0, _ := ret[0].(*cobra.Command) return ret0 } // GetQueryCmd indicates an expected call of GetQueryCmd -func (mr *MockAppModuleBasicMockRecorder) GetQueryCmd(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleBasicMockRecorder) GetQueryCmd(clientCtx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetQueryCmd), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleBasic)(nil).GetQueryCmd), clientCtx) } // MockAppModuleGenesis is a mock of AppModuleGenesis interface @@ -223,31 +223,31 @@ func (mr *MockAppModuleGenesisMockRecorder) RegisterRESTRoutes(arg0, arg1 interf } // GetTxCmd mocks base method -func (m *MockAppModuleGenesis) GetTxCmd(arg0 client.Context) *cobra.Command { +func (m *MockAppModuleGenesis) GetTxCmd(clientCtx client.Context) *cobra.Command { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd", arg0) + ret := m.ctrl.Call(m, "GetTxCmd", clientCtx) ret0, _ := ret[0].(*cobra.Command) return ret0 } // GetTxCmd indicates an expected call of GetTxCmd -func (mr *MockAppModuleGenesisMockRecorder) GetTxCmd(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleGenesisMockRecorder) GetTxCmd(clientCtx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetTxCmd), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetTxCmd), clientCtx) } // GetQueryCmd mocks base method -func (m *MockAppModuleGenesis) GetQueryCmd(arg0 *codec.Codec) *cobra.Command { +func (m *MockAppModuleGenesis) GetQueryCmd(clientCtx client.Context) *cobra.Command { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd", arg0) + ret := m.ctrl.Call(m, "GetQueryCmd", clientCtx) ret0, _ := ret[0].(*cobra.Command) return ret0 } // GetQueryCmd indicates an expected call of GetQueryCmd -func (mr *MockAppModuleGenesisMockRecorder) GetQueryCmd(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleGenesisMockRecorder) GetQueryCmd(clientCtx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetQueryCmd), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModuleGenesis)(nil).GetQueryCmd), clientCtx) } // InitGenesis mocks base method @@ -368,31 +368,31 @@ func (mr *MockAppModuleMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) } // GetTxCmd mocks base method -func (m *MockAppModule) GetTxCmd(arg0 client.Context) *cobra.Command { +func (m *MockAppModule) GetTxCmd(clientCtx client.Context) *cobra.Command { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTxCmd", arg0) + ret := m.ctrl.Call(m, "GetTxCmd", clientCtx) ret0, _ := ret[0].(*cobra.Command) return ret0 } // GetTxCmd indicates an expected call of GetTxCmd -func (mr *MockAppModuleMockRecorder) GetTxCmd(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleMockRecorder) GetTxCmd(clientCtx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModule)(nil).GetTxCmd), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTxCmd", reflect.TypeOf((*MockAppModule)(nil).GetTxCmd), clientCtx) } // GetQueryCmd mocks base method -func (m *MockAppModule) GetQueryCmd(arg0 *codec.Codec) *cobra.Command { +func (m *MockAppModule) GetQueryCmd(clientCtx client.Context) *cobra.Command { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetQueryCmd", arg0) + ret := m.ctrl.Call(m, "GetQueryCmd", clientCtx) ret0, _ := ret[0].(*cobra.Command) return ret0 } // GetQueryCmd indicates an expected call of GetQueryCmd -func (mr *MockAppModuleMockRecorder) GetQueryCmd(arg0 interface{}) *gomock.Call { +func (mr *MockAppModuleMockRecorder) GetQueryCmd(clientCtx interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModule)(nil).GetQueryCmd), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQueryCmd", reflect.TypeOf((*MockAppModule)(nil).GetQueryCmd), clientCtx) } // InitGenesis mocks base method diff --git a/types/module/module.go b/types/module/module.go index 2ef4cc98a..3723e4e58 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -52,8 +52,8 @@ type AppModuleBasic interface { // client functionality RegisterRESTRoutes(client.Context, *mux.Router) - GetTxCmd(client.Context) *cobra.Command - GetQueryCmd(*codec.Codec) *cobra.Command + GetTxCmd(clientCtx client.Context) *cobra.Command + GetQueryCmd(clientCtx client.Context) *cobra.Command } // BasicManager is a collection of AppModuleBasic @@ -113,9 +113,9 @@ func (bm BasicManager) AddTxCommands(rootTxCmd *cobra.Command, ctx client.Contex } // AddQueryCommands adds all query commands to the rootQueryCmd -func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command, cdc *codec.Codec) { +func (bm BasicManager) AddQueryCommands(rootQueryCmd *cobra.Command, clientCtx client.Context) { for _, b := range bm { - if cmd := b.GetQueryCmd(cdc); cmd != nil { + if cmd := b.GetQueryCmd(clientCtx); cmd != nil { rootQueryCmd.AddCommand(cmd) } } diff --git a/types/module/module_test.go b/types/module/module_test.go index 45b6e8c46..6913c389f 100644 --- a/types/module/module_test.go +++ b/types/module/module_test.go @@ -36,7 +36,7 @@ func TestBasicManager(t *testing.T) { mockAppModuleBasic1.EXPECT().RegisterRESTRoutes(gomock.Eq(client.Context{}), gomock.Eq(&mux.Router{})).Times(1) mockAppModuleBasic1.EXPECT().RegisterCodec(gomock.Eq(cdc)).Times(1) mockAppModuleBasic1.EXPECT().GetTxCmd(clientCtx).Times(1).Return(nil) - mockAppModuleBasic1.EXPECT().GetQueryCmd(cdc).Times(1).Return(nil) + mockAppModuleBasic1.EXPECT().GetQueryCmd(clientCtx).Times(1).Return(nil) mm := module.NewBasicManager(mockAppModuleBasic1) require.Equal(t, mm["mockAppModuleBasic1"], mockAppModuleBasic1) @@ -55,7 +55,7 @@ func TestBasicManager(t *testing.T) { mockCmd := &cobra.Command{Use: "root"} mm.AddTxCommands(mockCmd, clientCtx) - mm.AddQueryCommands(mockCmd, cdc) + mm.AddQueryCommands(mockCmd, clientCtx) // validate genesis returns nil require.Nil(t, module.NewBasicManager().ValidateGenesis(cdc, wantDefaultGenesis)) diff --git a/x/auth/module.go b/x/auth/module.go index 8ec50779d..e0da77eec 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -68,8 +68,8 @@ func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns the root query command for the auth module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(clientCtx.Codec) } // RegisterInterfaceTypes registers interfaces and implementations of the auth module. diff --git a/x/bank/module.go b/x/bank/module.go index 9af9d684f..00f89117a 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -67,8 +67,8 @@ func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns no root query command for the bank module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(clientCtx.Codec) } // RegisterInterfaceTypes registers interfaces and implementations of the bank module. diff --git a/x/capability/module.go b/x/capability/module.go index db6ae3487..5c4483719 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -68,7 +68,7 @@ func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} func (a AppModuleBasic) GetTxCmd(_ client.Context) *cobra.Command { return nil } // GetQueryCmd returns the capability module's root query command. -func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command { return nil } +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { return nil } // ---------------------------------------------------------------------------- // AppModule diff --git a/x/crisis/module.go b/x/crisis/module.go index 304673fc1..524809a2d 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -61,7 +61,7 @@ func (b AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns no root query command for the crisis module. -func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command { return nil } +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { return nil } //____________________________________________________________________________ diff --git a/x/distribution/module.go b/x/distribution/module.go index 71a6cd232..246a75194 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -71,8 +71,8 @@ func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns the root query command for the distribution module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(StoreKey, cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(StoreKey, clientCtx.Codec) } // RegisterInterfaceTypes implements InterfaceModule diff --git a/x/evidence/module.go b/x/evidence/module.go index ee8afdcd5..f2004447f 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -93,8 +93,8 @@ func (a AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetTxCmd returns the evidence module's root query command. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(StoreKey, cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(StoreKey, clientCtx.Codec) } func (AppModuleBasic) RegisterInterfaceTypes(registry types.InterfaceRegistry) { diff --git a/x/genutil/module.go b/x/genutil/module.go index f0a7d866a..ccff8649c 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -55,7 +55,7 @@ func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} func (AppModuleBasic) GetTxCmd(_ client.Context) *cobra.Command { return nil } // GetQueryCmd returns no root query command for the genutil module. -func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command { return nil } +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { return nil } //____________________________________________________________________________ diff --git a/x/gov/module.go b/x/gov/module.go index 1908aa001..dc54f1836 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -92,8 +92,8 @@ func (a AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns the root query command for the gov module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(StoreKey, cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(StoreKey, clientCtx.Codec) } // RegisterInterfaceTypes implements InterfaceModule.RegisterInterfaceTypes diff --git a/x/ibc-transfer/module.go b/x/ibc-transfer/module.go index 0118fa764..95bb04083 100644 --- a/x/ibc-transfer/module.go +++ b/x/ibc-transfer/module.go @@ -75,8 +75,8 @@ func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd implements AppModuleBasic interface -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(cdc, QuerierRoute) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(clientCtx.Codec, QuerierRoute) } // RegisterInterfaceTypes registers module concrete types into protobuf Any. diff --git a/x/ibc/module.go b/x/ibc/module.go index f0e1eff81..fa6725048 100644 --- a/x/ibc/module.go +++ b/x/ibc/module.go @@ -71,8 +71,8 @@ func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns no root query command for the ibc module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(QuerierRoute, cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(QuerierRoute, clientCtx.Codec) } // RegisterInterfaceTypes registers module concrete types into protobuf Any. diff --git a/x/mint/module.go b/x/mint/module.go index 1a97a1be6..53d51f139 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -66,8 +66,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout func (AppModuleBasic) GetTxCmd(_ client.Context) *cobra.Command { return nil } // GetQueryCmd returns the root query command for the mint module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(clientCtx.Codec) } //____________________________________________________________________________ diff --git a/x/params/module.go b/x/params/module.go index c8008df03..3f2f797f9 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -52,7 +52,7 @@ func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} func (AppModuleBasic) GetTxCmd(_ client.Context) *cobra.Command { return nil } // GetQueryCmd returns no root query command for the params module. -func (AppModuleBasic) GetQueryCmd(_ *codec.Codec) *cobra.Command { return nil } +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { return nil } func (am AppModuleBasic) RegisterInterfaceTypes(registry types.InterfaceRegistry) { proposal.RegisterInterfaces(registry) diff --git a/x/slashing/module.go b/x/slashing/module.go index 1d95e2439..c7304e625 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -72,8 +72,8 @@ func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns no root query command for the slashing module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(StoreKey, cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(StoreKey, clientCtx.Codec) } //____________________________________________________________________________ diff --git a/x/staking/module.go b/x/staking/module.go index 432096f59..56cee71aa 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -75,8 +75,8 @@ func (AppModuleBasic) GetTxCmd(clientCtx client.Context) *cobra.Command { } // GetQueryCmd returns no root query command for the staking module. -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { - return cli.GetQueryCmd(StoreKey, cdc) +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { + return cli.GetQueryCmd(StoreKey, clientCtx.Codec) } //_____________________________________ diff --git a/x/upgrade/module.go b/x/upgrade/module.go index f87025c2e..223b1eb31 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -51,14 +51,14 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, r *mux.Router } // GetQueryCmd returns the cli query commands for this module -func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command { +func (AppModuleBasic) GetQueryCmd(clientCtx client.Context) *cobra.Command { queryCmd := &cobra.Command{ Use: "upgrade", Short: "Querying commands for the upgrade module", } queryCmd.AddCommand(flags.GetCommands( - cli.GetPlanCmd(StoreKey, cdc), - cli.GetAppliedHeightCmd(StoreKey, cdc), + cli.GetPlanCmd(StoreKey, clientCtx.Codec), + cli.GetAppliedHeightCmd(StoreKey, clientCtx.Codec), )...) return queryCmd