Skip to content

Commit

Permalink
Problem: x/supply is not marked as deprecated (#724)
Browse files Browse the repository at this point in the history
Solution: Marked `x/supply` grpc and cli as deprecated. Fixes #720.
  • Loading branch information
devashishdxt authored Mar 10, 2022
1 parent f3685b9 commit a7f75b6
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 56 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Upgrade `cosmos-sdk` to `v0.45.1` and `ibc-go` to `v3.0.0-rc0`. #717
- Mark gRPC and CLI of `x/supply` as deprecated. #724

*March 1, 2022*

Expand Down
2 changes: 2 additions & 0 deletions proto/supply/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ option go_package = "github.com/crypto-org-chain/chain-main/x/supply/types";

// Query defines the gRPC querier service.
service Query {
option deprecated = true;

// TotalSupply queries the total supply of all coins.
rpc TotalSupply(SupplyRequest) returns (SupplyResponse) {
option (google.api.http).get = "/chainmain/supply/v1/total";
Expand Down
25 changes: 1 addition & 24 deletions x/nft/types/query.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions x/supply/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
func GetQueryCmd() *cobra.Command {
cmd := &cobra.Command{
Use: types.ModuleName,
Short: "Querying commands for the supply module",
Short: "Querying commands for the supply module [Deprecated: do not use]",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
Expand All @@ -35,9 +35,9 @@ func GetQueryCmd() *cobra.Command {
func GetCmdQueryTotalSupply() *cobra.Command {
cmd := &cobra.Command{
Use: "total",
Short: "Query the total supply of coins of the chain",
Short: "Query the total supply of coins of the chain [Deprecated: do not use]",
Long: strings.TrimSpace(
fmt.Sprintf(`Query total supply of coins that are held by accounts in the chain.
fmt.Sprintf(`Query total supply of coins that are held by accounts in the chain. [Deprecated: do not use]
Example:
$ %s query %s total
`,
Expand All @@ -50,6 +50,7 @@ Example:
return err
}

// nolint: staticcheck
queryClient := types.NewQueryClient(clientCtx)
res, err := queryClient.TotalSupply(cmd.Context(), types.NewSupplyRequest())
if err != nil {
Expand All @@ -69,9 +70,9 @@ Example:
func GetCmdQueryLiquidSupply() *cobra.Command {
cmd := &cobra.Command{
Use: "liquid",
Short: "Query the liquid supply of coins of the chain",
Short: "Query the liquid supply of coins of the chain [Deprecated: do not use]",
Long: strings.TrimSpace(
fmt.Sprintf(`Query liquid supply of coins that are held by accounts in the chain.
fmt.Sprintf(`Query liquid supply of coins that are held by accounts in the chain. [Deprecated: do not use]
Example:
$ %s query %s liquid
`,
Expand All @@ -84,6 +85,7 @@ Example:
return err
}

// nolint: staticcheck
queryClient := types.NewQueryClient(clientCtx)
res, err := queryClient.LiquidSupply(cmd.Context(), types.NewSupplyRequest())
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions x/supply/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func (a AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Ro

// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the capability module.
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {
// nolint: staticcheck
err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx))

if err != nil {
Expand Down Expand Up @@ -134,6 +135,7 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd

// RegisterServices registers query server.
func (am AppModule) RegisterServices(cfg module.Configurator) {
// nolint: staticcheck
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
}

Expand Down
60 changes: 33 additions & 27 deletions x/supply/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7f75b6

Please sign in to comment.