From 1ea1ea8559604d5c0aa13951b3016967438da2a5 Mon Sep 17 00:00:00 2001 From: blushi Date: Wed, 14 Oct 2020 10:02:22 +0200 Subject: [PATCH] Update old ref of RegisterQueryService --- docs/basics/app-anatomy.md | 2 +- docs/building-modules/messages-and-queries.md | 2 +- docs/building-modules/module-manager.md | 4 ++-- types/module/module.go | 4 ++-- x/auth/module.go | 2 +- x/auth/vesting/module.go | 2 +- x/bank/module.go | 2 +- x/capability/module.go | 2 +- x/crisis/module.go | 2 +- x/distribution/module.go | 2 +- x/evidence/module.go | 2 +- x/gov/module.go | 2 +- x/ibc/applications/transfer/module.go | 2 +- x/ibc/core/module.go | 2 +- x/ibc/testing/mock/mock.go | 2 +- x/mint/module.go | 2 +- x/params/module.go | 2 +- x/slashing/module.go | 2 +- x/staking/module.go | 2 +- x/upgrade/module.go | 2 +- 20 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/basics/app-anatomy.md b/docs/basics/app-anatomy.md index 74b32a6d466b..a69ae50529f4 100644 --- a/docs/basics/app-anatomy.md +++ b/docs/basics/app-anatomy.md @@ -176,7 +176,7 @@ gRPC query services are defined in the module's Protobuf definition, specificall Protobuf generates a `QueryServer` interface for each module, containing all the service methods. A module's [`keeper`](#keeper) then needs to implement this `QueryServer` interface, by providing the concrete implementation of each service method. This concrete implementation is the handler of the corresponding gRPC query endpoint. -Finally, each module should also implement the `RegisterQueryService` method as part of the [`AppModule` interface](#application-module-interface). This method should call the `RegisterQueryServer` function provided by the generated Protobuf code. +Finally, each module should also implement the `RegisterServices` method as part of the [`AppModule` interface](#application-module-interface). This method should call the `RegisterQueryServer` function provided by the generated Protobuf code. ### Legacy Querier diff --git a/docs/building-modules/messages-and-queries.md b/docs/building-modules/messages-and-queries.md index e087bd130db6..40694a84464c 100644 --- a/docs/building-modules/messages-and-queries.md +++ b/docs/building-modules/messages-and-queries.md @@ -52,7 +52,7 @@ Here's an example of such a `Query` service definition: As `proto.Message`s, generated `Response` types implement by default `String()` method of [`fmt.Stringer`](https://golang.org/pkg/fmt/#Stringer). -A `RegisterQueryServer` method is also generated and should be used to register the module's query server in `RegisterQueryService` method from the [`AppModule` interface](./module-manager.md#appmodule). +A `RegisterQueryServer` method is also generated and should be used to register the module's query server in `RegisterServices` method from the [`AppModule` interface](./module-manager.md#appmodule). ### Legacy Queries diff --git a/docs/building-modules/module-manager.md b/docs/building-modules/module-manager.md index a9130ef740ff..b72fd37fb705 100644 --- a/docs/building-modules/module-manager.md +++ b/docs/building-modules/module-manager.md @@ -72,7 +72,7 @@ Let us go through the methods of `AppModule`: - `Route()`: Returns the route for [`message`s](./messages-and-queries.md#messages) to be routed to the module by [`baseapp`](../core/baseapp.md#message-routing). - `QuerierRoute()` (deprecated): Returns the name of the module's query route, for [`queries`](./messages-and-queries.md#queries) to be routes to the module by [`baseapp`](../core/baseapp.md#query-routing). - `LegacyQuerierHandler(*codec.LegacyAmino)` (deprecated): Returns a [`querier`](./querier.md) given the query `path`, in order to process the `query`. -- `RegisterQueryService(grpc.Server)`: Allows a module to register a gRPC query service. +- `RegisterServices(Configurator)`: Allows a module to register services. - `BeginBlock(sdk.Context, abci.RequestBeginBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. Implement empty if no logic needs to be triggered at the beginning of each block for this module. - `EndBlock(sdk.Context, abci.RequestEndBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. This is also where the module can inform the underlying consensus engine of validator set changes (e.g. the `staking` module). Implement empty if no logic needs to be triggered at the beginning of each block for this module. @@ -135,7 +135,7 @@ The module manager is used throughout the application whenever an action on a co - `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). - `RegisterInvariants(ir sdk.InvariantRegistry)`: Registers the [invariants](./invariants.md) of each module. - `RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter, legacyQuerierCdc *codec.LegacyAmino)`: Registers module routes to the application's `router`, in order to route [`message`s](./messages-and-queries.md#messages) to the appropriate [`handler`](./handler.md), and module query routes to the application's `queryRouter`, in order to route [`queries`](./messages-and-queries.md#queries) to the appropriate [`querier`](./querier.md). -- `RegisterQueryServices(grpcRouter grpc.Server)`: Registers all module gRPC query services. +- `RegisterServices(cfg Configurator)`: Registers all module gRPC query services. - `InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, genesisData map[string]json.RawMessage)`: Calls the [`InitGenesis`](./genesis.md#initgenesis) function of each module when the application is first started, in the order defined in `OrderInitGenesis`. Returns an `abci.ResponseInitChain` to the underlying consensus engine, which can contain validator updates. - `ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler)`: Calls the [`ExportGenesis`](./genesis.md#exportgenesis) function of each module, in the order defined in `OrderExportGenesis`. The export constructs a genesis file from a previously existing state, and is mainly used when a hard-fork upgrade of the chain is required. - `BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)`: At the beginning of each block, this function is called from [`baseapp`](../core/baseapp.md#beginblock) and, in turn, calls the [`BeginBlock`](./beginblock-endblock.md) function of each module, in the order defined in `OrderBeginBlockers`. It creates a child [context](../core/context.md) with an event manager to aggregate [events](../core/events.md) emitted from all modules. The function returns an `abci.ResponseBeginBlock` which contains the aforementioned events. diff --git a/types/module/module.go b/types/module/module.go index ec9c1c77b5d3..f149fd5f3739 100644 --- a/types/module/module.go +++ b/types/module/module.go @@ -166,10 +166,10 @@ type AppModule interface { // routes Route() sdk.Route - // Deprecated: use RegisterQueryService + // Deprecated: use RegisterServices QuerierRoute() string - // Deprecated: use RegisterQueryService + // Deprecated: use RegisterServices LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier // RegisterServices allows a module to register services diff --git a/x/auth/module.go b/x/auth/module.go index 21e43bef262b..85971d18651f 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -125,7 +125,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.accountKeeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.accountKeeper) diff --git a/x/auth/vesting/module.go b/x/auth/vesting/module.go index b4997d60e4bd..bea4d3946867 100644 --- a/x/auth/vesting/module.go +++ b/x/auth/vesting/module.go @@ -100,7 +100,7 @@ func (am AppModule) Route() sdk.Route { // functionality. func (AppModule) QuerierRoute() string { return "" } -// RegisterQueryService performs a no-op. +// RegisterServices performs a no-op. func (am AppModule) RegisterServices(_ module.Configurator) {} // LegacyQuerierHandler performs a no-op. diff --git a/x/bank/module.go b/x/bank/module.go index 1b3d68f4607d..02615c464820 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -94,7 +94,7 @@ type AppModule struct { accountKeeper types.AccountKeeper } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/capability/module.go b/x/capability/module.go index cc1d6272eb0f..1e84a6f13cca 100644 --- a/x/capability/module.go +++ b/x/capability/module.go @@ -111,7 +111,7 @@ func (AppModule) QuerierRoute() string { return "" } // LegacyQuerierHandler returns the capability module's Querier. func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(module.Configurator) {} diff --git a/x/crisis/module.go b/x/crisis/module.go index fdc2ffb03d6f..67a074bd7165 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -112,7 +112,7 @@ func (AppModule) QuerierRoute() string { return "" } // LegacyQuerierHandler returns no sdk.Querier. func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(module.Configurator) {} diff --git a/x/distribution/module.go b/x/distribution/module.go index 9c53d5619170..addc416f2a10 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -139,7 +139,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/evidence/module.go b/x/evidence/module.go index 1ac32c2148b7..620db7f6eee7 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -148,7 +148,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/gov/module.go b/x/gov/module.go index 31c0e5c05d80..1187fedc4680 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -155,7 +155,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 4d73f693cd2a..b92aaa676bd4 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -120,7 +120,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/ibc/core/module.go b/x/ibc/core/module.go index 35a734ccf959..032ee755a751 100644 --- a/x/ibc/core/module.go +++ b/x/ibc/core/module.go @@ -130,7 +130,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return nil } -// RegisterQueryService registers the gRPC query service for the ibc module. +// RegisterServices registers the gRPC query service for the ibc module. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryService(cfg.QueryServer(), am.keeper) } diff --git a/x/ibc/testing/mock/mock.go b/x/ibc/testing/mock/mock.go index 89ed2a4dd468..25bc5e953ede 100644 --- a/x/ibc/testing/mock/mock.go +++ b/x/ibc/testing/mock/mock.go @@ -102,7 +102,7 @@ func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return nil } -// RegisterQueryService implements the AppModule interface. +// RegisterServices implements the AppModule interface. func (am AppModule) RegisterServices(module.Configurator) {} // InitGenesis implements the AppModule interface. diff --git a/x/mint/module.go b/x/mint/module.go index 0a29598add2c..c9ed5f01e8ff 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -123,7 +123,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a gRPC query service to respond to the +// RegisterServices registers a gRPC query service to respond to the // module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/params/module.go b/x/params/module.go index b95f76947ddb..2dd7967b16aa 100644 --- a/x/params/module.go +++ b/x/params/module.go @@ -109,7 +109,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a gRPC query service to respond to the +// RegisterServices registers a gRPC query service to respond to the // module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { proposal.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/slashing/module.go b/x/slashing/module.go index f74c4a84dfd2..e644b87a1cd6 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -137,7 +137,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) diff --git a/x/staking/module.go b/x/staking/module.go index 6a344265b74a..860d717e64f1 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -133,7 +133,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { querier := keeper.Querier{Keeper: am.keeper} diff --git a/x/upgrade/module.go b/x/upgrade/module.go index df5e23a2f4f2..bf467340f201 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -94,7 +94,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd return keeper.NewQuerier(am.keeper, legacyQuerierCdc) } -// RegisterQueryService registers a GRPC query service to respond to the +// RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper)