From 51ac6f876b2a03bafd4e56c3554486a823cb70f7 Mon Sep 17 00:00:00 2001 From: Anil Kumar Kammari Date: Wed, 28 Oct 2020 17:09:49 +0530 Subject: [PATCH] Rename RegisterGRPCRoutes (#7696) * Rename * Fix missing Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- docs/basics/app-anatomy.md | 2 +- docs/building-modules/module-interfaces.md | 2 +- docs/building-modules/module-manager.md | 4 +-- server/api/server.go | 4 +-- simapp/app.go | 2 +- tests/mocks/types_module_module.go | 36 +++++++++++----------- types/module/module.go | 8 ++--- x/auth/module.go | 4 +-- x/auth/vesting/module.go | 4 +-- x/bank/module.go | 4 +-- x/capability/module.go | 4 +-- x/crisis/module.go | 4 +-- x/distribution/module.go | 4 +-- x/evidence/module.go | 4 +-- x/genutil/module.go | 4 +-- x/gov/module.go | 4 +-- x/ibc/applications/transfer/module.go | 4 +-- x/ibc/core/module.go | 4 +-- x/ibc/testing/mock/mock.go | 4 +-- x/mint/module.go | 4 +-- x/params/module.go | 4 +-- x/slashing/module.go | 4 +-- x/staking/module.go | 4 +-- x/upgrade/module.go | 4 +-- 24 files changed, 63 insertions(+), 63 deletions(-) diff --git a/docs/basics/app-anatomy.md b/docs/basics/app-anatomy.md index 529ec9b27..68d799e36 100644 --- a/docs/basics/app-anatomy.md +++ b/docs/basics/app-anatomy.md @@ -223,7 +223,7 @@ Generally, the [commands related to a module](../building-modules/module-interfa Each module can expose gRPC endpoints, called [service methods](https://grpc.io/docs/what-is-grpc/core-concepts/#service-definition) and are defined in the [module's Protobuf `query.proto` file](#grpc-query-services). A service method is defined by its name, input arguments and output response. The module then needs to: -- define a `RegisterGRPCRoutes` method on `AppModuleBasic` to wire the client gRPC requests to the correct handler inside the module. +- define a `RegisterGRPCGatewayRoutes` method on `AppModuleBasic` to wire the client gRPC requests to the correct handler inside the module. - for each service method, define a corresponding handler. The handler implements the core logic necessary to serve the gRPC request, and is located in the `keeper/grpc_query.go` file. #### gRPC-gateway REST Endpoints diff --git a/docs/building-modules/module-interfaces.md b/docs/building-modules/module-interfaces.md index 1c8dcdbce..2acb4ac99 100644 --- a/docs/building-modules/module-interfaces.md +++ b/docs/building-modules/module-interfaces.md @@ -97,7 +97,7 @@ Similarly, there is a `AddQueryFlagsToCmd(cmd *cobra.Command)` to add common fla In addition to providing an ABCI query pathway, modules [custom queries](./messages-and-queries.md#grpc-queries) can provide a GRPC proxy server that routes requests in the GRPC protocol to ABCI query requests under the hood. -In order to do that, module should implement `RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux)` on `AppModuleBasic` to wire the client gRPC requests to the correct handler inside the module. +In order to do that, module should implement `RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux)` on `AppModuleBasic` to wire the client gRPC requests to the correct handler inside the module. Here's an example from the `auth` module: diff --git a/docs/building-modules/module-manager.md b/docs/building-modules/module-manager.md index 1c034bde7..7c6ead627 100644 --- a/docs/building-modules/module-manager.md +++ b/docs/building-modules/module-manager.md @@ -39,7 +39,7 @@ Let us go through the methods: - `DefaultGenesis(codec.JSONMarshaler)`: Returns a default [`GenesisState`](./genesis.md#genesisstate) for the module, marshalled to `json.RawMessage`. The default `GenesisState` need to be defined by the module developer and is primarily used for testing. - `ValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage)`: Used to validate the `GenesisState` defined by a module, given in its `json.RawMessage` form. It will usually unmarshall the `json` before running a custom [`ValidateGenesis`](./genesis.md#validategenesis) function defined by the module developer. - `RegisterRESTRoutes(client.Context, *mux.Router)`: Registers the REST routes for the module. These routes will be used to map REST request to the module in order to process them. See [../interfaces/rest.md] for more. -- `RegisterGRPCRoutes(client.Context, *runtime.ServeMux)`: Registers gRPC routes for the module. +- `RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux)`: Registers gRPC routes for the module. - `GetTxCmd()`: Returns the root [`Tx` command](./module-interfaces.md#tx) for the module. The subcommands of this root command are used by end-users to generate new transactions containing [`message`s](./messages-and-queries.md#queries) defined in the module. - `GetQueryCmd()`: Return the root [`query` command](./module-interfaces.md#query) for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module. @@ -116,7 +116,7 @@ It implements the following methods: - `DefaultGenesis(cdc codec.JSONMarshaler)`: Provides default genesis information for modules in the application by calling the [`DefaultGenesis(cdc codec.JSONMarshaler)`](./genesis.md#defaultgenesis) function of each module. It is used to construct a default genesis file for the application. - `ValidateGenesis(cdc codec.JSONMarshaler, txEncCfg client.TxEncodingConfig, genesis map[string]json.RawMessage)`: Validates the genesis information modules by calling the [`ValidateGenesis(codec.JSONMarshaler, client.TxEncodingConfig, json.RawMessage)`](./genesis.md#validategenesis) function of each module. - `RegisterRESTRoutes(ctx client.Context, rtr *mux.Router)`: Registers REST routes for modules by calling the [`RegisterRESTRoutes`](./module-interfaces.md#register-routes) function of each module. This function is usually called function from the `main.go` function of the [application's command-line interface](../interfaces/cli.md). -- `RegisterGRPCRoutes(clientCtx client.Context, rtr *runtime.ServeMux)`: Registers gRPC routes for modules. +- `RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr *runtime.ServeMux)`: Registers gRPC routes for modules. - `AddTxCommands(rootTxCmd *cobra.Command)`: Adds modules' transaction commands to the application's [`rootTxCommand`](../interfaces/cli.md#transaction-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../interfaces/cli.md). - `AddQueryCommands(rootQueryCmd *cobra.Command)`: Adds modules' query commands to the application's [`rootQueryCommand`](../interfaces/cli.md#query-commands). This function is usually called function from the `main.go` function of the [application's command-line interface](../interfaces/cli.md). diff --git a/server/api/server.go b/server/api/server.go index 5c037101c..b73b95556 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -104,7 +104,7 @@ func (s *Server) Start(cfg config.Config) error { return err } - s.registerGRPCRoutes() + s.registerGRPCGatewayRoutes() s.listener = listener var h http.Handler = s.Router @@ -123,7 +123,7 @@ func (s *Server) Close() error { return s.listener.Close() } -func (s *Server) registerGRPCRoutes() { +func (s *Server) registerGRPCGatewayRoutes() { s.Router.PathPrefix("/").Handler(s.GRPCRouter) } diff --git a/simapp/app.go b/simapp/app.go index 41683dff8..0d1d226d8 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -547,7 +547,7 @@ func (app *SimApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APICon authrest.RegisterTxRoutes(clientCtx, apiSvr.Router) ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) - ModuleBasics.RegisterGRPCRoutes(apiSvr.ClientCtx, apiSvr.GRPCRouter) + ModuleBasics.RegisterGRPCGatewayRoutes(apiSvr.ClientCtx, apiSvr.GRPCRouter) // register swagger API from root so that other applications can override easily if apiConfig.Swagger { diff --git a/tests/mocks/types_module_module.go b/tests/mocks/types_module_module.go index b03b35809..41ded4d7a 100644 --- a/tests/mocks/types_module_module.go +++ b/tests/mocks/types_module_module.go @@ -120,16 +120,16 @@ func (mr *MockAppModuleBasicMockRecorder) RegisterRESTRoutes(arg0, arg1 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterRESTRoutes), arg0, arg1) } -// RegisterGRPCRoutes mocks base method -func (m *MockAppModuleBasic) RegisterGRPCRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes mocks base method +func (m *MockAppModuleBasic) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterGRPCRoutes", arg0, arg1) + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) } -// RegisterGRPCRoutes indicates an expected call of RegisterGRPCRoutes -func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCRoutes(arg0, arg1 interface{}) *gomock.Call { +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes +func (mr *MockAppModuleBasicMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterGRPCRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleBasic)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } // GetTxCmd mocks base method @@ -261,16 +261,16 @@ func (mr *MockAppModuleGenesisMockRecorder) RegisterRESTRoutes(arg0, arg1 interf return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterRESTRoutes), arg0, arg1) } -// RegisterGRPCRoutes mocks base method -func (m *MockAppModuleGenesis) RegisterGRPCRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes mocks base method +func (m *MockAppModuleGenesis) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterGRPCRoutes", arg0, arg1) + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) } -// RegisterGRPCRoutes indicates an expected call of RegisterGRPCRoutes -func (mr *MockAppModuleGenesisMockRecorder) RegisterGRPCRoutes(arg0, arg1 interface{}) *gomock.Call { +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes +func (mr *MockAppModuleGenesisMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterGRPCRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModuleGenesis)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } // GetTxCmd mocks base method @@ -430,16 +430,16 @@ func (mr *MockAppModuleMockRecorder) RegisterRESTRoutes(arg0, arg1 interface{}) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterRESTRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterRESTRoutes), arg0, arg1) } -// RegisterGRPCRoutes mocks base method -func (m *MockAppModule) RegisterGRPCRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes mocks base method +func (m *MockAppModule) RegisterGRPCGatewayRoutes(arg0 client.Context, arg1 *runtime.ServeMux) { m.ctrl.T.Helper() - m.ctrl.Call(m, "RegisterGRPCRoutes", arg0, arg1) + m.ctrl.Call(m, "RegisterGRPCGatewayRoutes", arg0, arg1) } -// RegisterGRPCRoutes indicates an expected call of RegisterGRPCRoutes -func (mr *MockAppModuleMockRecorder) RegisterGRPCRoutes(arg0, arg1 interface{}) *gomock.Call { +// RegisterGRPCGatewayRoutes indicates an expected call of RegisterGRPCGatewayRoutes +func (mr *MockAppModuleMockRecorder) RegisterGRPCGatewayRoutes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterGRPCRoutes), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterGRPCGatewayRoutes", reflect.TypeOf((*MockAppModule)(nil).RegisterGRPCGatewayRoutes), arg0, arg1) } // GetTxCmd mocks base method diff --git a/types/module/module.go b/types/module/module.go index ec9c1c77b..97319e5d0 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -56,7 +56,7 @@ type AppModuleBasic interface { // client functionality RegisterRESTRoutes(client.Context, *mux.Router) - RegisterGRPCRoutes(client.Context, *runtime.ServeMux) + RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux) GetTxCmd() *cobra.Command GetQueryCmd() *cobra.Command } @@ -115,10 +115,10 @@ func (bm BasicManager) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rou } } -// RegisterGRPCRoutes registers all module rest routes -func (bm BasicManager) RegisterGRPCRoutes(clientCtx client.Context, rtr *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers all module rest routes +func (bm BasicManager) RegisterGRPCGatewayRoutes(clientCtx client.Context, rtr *runtime.ServeMux) { for _, b := range bm { - b.RegisterGRPCRoutes(clientCtx, rtr) + b.RegisterGRPCGatewayRoutes(clientCtx, rtr) } } diff --git a/x/auth/module.go b/x/auth/module.go index 55b5dc7fb..098dd774e 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -65,8 +65,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout rest.RegisterRoutes(clientCtx, rtr, types.StoreKey) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the auth module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the auth module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index 7afab8d34..3cc579a40 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -57,9 +57,9 @@ func (AppModuleBasic) ValidateGenesis(_ codec.JSONMarshaler, _ client.TxEncoding // RegisterRESTRoutes registers module's REST handlers. Currently, this is a no-op. func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} -// RegisterGRPCRoutes registers the module's gRPC Gateway routes. Currently, this +// RegisterGRPCGatewayRoutes registers the module's gRPC Gateway routes. Currently, this // is a no-op. -func (a AppModuleBasic) RegisterGRPCRoutes(_ client.Context, _ *runtime.ServeMux) {} +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {} // GetTxCmd returns the root tx command for the auth module. func (AppModuleBasic) GetTxCmd() *cobra.Command { diff --git a/x/bank/module.go b/x/bank/module.go index 971263613..958d0db75 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -64,8 +64,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout rest.RegisterHandlers(clientCtx, rtr) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the bank module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the bank module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/capability/module.go b/x/capability/module.go index cc1d6272e..f27e5cdb5 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -69,8 +69,8 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxE // RegisterRESTRoutes registers the capability module's REST service handlers. func (a AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} -// RegisterGRPCRoutes registers the gRPC Gateway routes for the capability module. -func (a AppModuleBasic) RegisterGRPCRoutes(_ client.Context, _ *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the capability module. +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) { } // GetTxCmd returns the capability module's root tx command. diff --git a/x/crisis/module.go b/x/crisis/module.go index 4066cb2ef..9793dc8bf 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -56,8 +56,8 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxE // RegisterRESTRoutes registers no REST routes for the crisis module. func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} -// RegisterGRPCRoutes registers the gRPC Gateway routes for the capability module. -func (AppModuleBasic) RegisterGRPCRoutes(_ client.Context, _ *runtime.ServeMux) {} +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the capability module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {} // GetTxCmd returns the root tx command for the crisis module. func (b AppModuleBasic) GetTxCmd() *cobra.Command { diff --git a/x/distribution/module.go b/x/distribution/module.go index c32bcbc1e..034be6d96 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -68,8 +68,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx sdkclient.Context, rtr *mux.R rest.RegisterHandlers(clientCtx, rtr) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the distribution module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx sdkclient.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the distribution module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/evidence/module.go b/x/evidence/module.go index 7ff49aabd..4367fe8d5 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -85,8 +85,8 @@ func (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Ro rest.RegisterRoutes(clientCtx, rtr, evidenceRESTHandlers) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the evidence module. -func (a AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the evidence module. +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/genutil/module.go b/x/genutil/module.go index 711e5a688..bfaeb0c59 100644 --- a/x/genutil/module.go +++ b/x/genutil/module.go @@ -56,8 +56,8 @@ func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, txEncodingConfi // RegisterRESTRoutes registers the REST routes for the genutil module. func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} -// RegisterGRPCRoutes registers the gRPC Gateway routes for the genutil module. -func (AppModuleBasic) RegisterGRPCRoutes(_ client.Context, _ *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the genutil module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) { } // GetTxCmd returns no root tx command for the genutil module. diff --git a/x/gov/module.go b/x/gov/module.go index 1183f6060..ad2191660 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -84,8 +84,8 @@ func (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Ro rest.RegisterHandlers(clientCtx, rtr, proposalRESTHandlers) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the gov module. -func (a AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the gov module. +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 994782880..0f9b3faee 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -72,8 +72,8 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxE func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the ibc-transfer module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc-transfer module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/ibc/core/module.go b/x/ibc/core/module.go index 4590556be..3371dc88a 100644 --- a/x/ibc/core/module.go +++ b/x/ibc/core/module.go @@ -67,8 +67,8 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config client.TxE // RegisterRESTRoutes does nothing. IBC does not support legacy REST routes. func (AppModuleBasic) RegisterRESTRoutes(client.Context, *mux.Router) {} -// RegisterGRPCRoutes registers the gRPC Gateway routes for the ibc module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the ibc module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { clienttypes.RegisterQueryHandlerClient(context.Background(), mux, clienttypes.NewQueryClient(clientCtx)) connectiontypes.RegisterQueryHandlerClient(context.Background(), mux, connectiontypes.NewQueryClient(clientCtx)) channeltypes.RegisterQueryHandlerClient(context.Background(), mux, channeltypes.NewQueryClient(clientCtx)) diff --git a/x/ibc/testing/mock/mock.go b/x/ibc/testing/mock/mock.go index 89ed2a4dd..e338e24d3 100644 --- a/x/ibc/testing/mock/mock.go +++ b/x/ibc/testing/mock/mock.go @@ -58,8 +58,8 @@ func (AppModuleBasic) ValidateGenesis(codec.JSONMarshaler, client.TxEncodingConf // RegisterRESTRoutes implements AppModuleBasic interface. func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) {} -// RegisterGRPCRoutes implements AppModuleBasic interface. -func (a AppModuleBasic) RegisterGRPCRoutes(_ client.Context, _ *runtime.ServeMux) {} +// RegisterGRPCGatewayRoutes implements AppModuleBasic interface. +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {} // GetTxCmd implements AppModuleBasic interface. func (AppModuleBasic) GetTxCmd() *cobra.Command { diff --git a/x/mint/module.go b/x/mint/module.go index 0a29598ad..a10013982 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -69,8 +69,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout rest.RegisterRoutes(clientCtx, rtr) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the mint module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the mint module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/params/module.go b/x/params/module.go index b95f76947..146046031 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -55,8 +55,8 @@ func (AppModuleBasic) ValidateGenesis(_ codec.JSONMarshaler, config client.TxEnc // RegisterRESTRoutes registers the REST routes for the params module. func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} -// RegisterGRPCRoutes registers the gRPC Gateway routes for the params module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the params module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { proposal.RegisterQueryHandlerClient(context.Background(), mux, proposal.NewQueryClient(clientCtx)) } diff --git a/x/slashing/module.go b/x/slashing/module.go index 3698bb698..91ad472e9 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -76,8 +76,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout rest.RegisterHandlers(clientCtx, rtr) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the slashig module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the slashig module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/staking/module.go b/x/staking/module.go index 4fa17d4d4..f2e422117 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -74,8 +74,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Rout rest.RegisterHandlers(clientCtx, rtr) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the staking module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the staking module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) } diff --git a/x/upgrade/module.go b/x/upgrade/module.go index df5e23a2f..c136d9cf0 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -47,8 +47,8 @@ func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, r *mux.Router rest.RegisterRoutes(clientCtx, r) } -// RegisterGRPCRoutes registers the gRPC Gateway routes for the upgrade module. -func (AppModuleBasic) RegisterGRPCRoutes(clientCtx client.Context, mux *runtime.ServeMux) { +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the upgrade module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) }