From 1d944d521993d3164751b55bf6d11ba23be6714e Mon Sep 17 00:00:00 2001 From: Draco Date: Tue, 27 Feb 2024 14:40:52 -0500 Subject: [PATCH] Validator Vesting gRPC Endpoints (#1832) * Add validator-vesting grpc * Update validator REST API endpoints to use grpc * Update validator-vesting cli to use grpc * Update changelog for added grpc changes * Add grpc query tests --- CHANGELOG.md | 2 + docs/core/proto-docs.md | 225 ++ .../kava/validatorvesting/v1beta1/query.proto | 131 + x/validator-vesting/client/cli/query.go | 94 +- x/validator-vesting/client/rest/query.go | 180 +- x/validator-vesting/keeper/grpc_query.go | 358 +++ x/validator-vesting/keeper/grpc_query_test.go | 116 + x/validator-vesting/module.go | 12 +- x/validator-vesting/types/querier.go | 26 - x/validator-vesting/types/query.pb.go | 2503 +++++++++++++++++ x/validator-vesting/types/query.pb.gw.go | 543 ++++ 11 files changed, 3932 insertions(+), 258 deletions(-) create mode 100644 proto/kava/validatorvesting/v1beta1/query.proto create mode 100644 x/validator-vesting/keeper/grpc_query.go create mode 100644 x/validator-vesting/keeper/grpc_query_test.go delete mode 100644 x/validator-vesting/types/querier.go create mode 100644 x/validator-vesting/types/query.pb.go create mode 100644 x/validator-vesting/types/query.pb.gw.go diff --git a/CHANGELOG.md b/CHANGELOG.md index e9e3469b..fb562654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ - (cdp) [#1818] Add module param and logic for running x/cdp begin blocker every `n` blocks - (cli) [#1804] Add `rocksdb compact` command for manual DB compaction of state or blockstore. - (cosmos-sdk) [#1811] Upgrades app to cosmos-sdk v0.47.7 +- (validator-vesting) [#1832] Add grpc query service to replace removed legacy querier. ## [v0.25.0] @@ -324,6 +325,7 @@ the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.38.4/CHANGELOG.md). - [#257](https://github.com/Kava-Labs/kava/pulls/257) Include scripts to run large-scale simulations remotely using aws-batch +[#1832]: https://github.com/Kava-Labs/kava/pull/1832 [#1811]: https://github.com/Kava-Labs/kava/pull/1811 [#1804]: https://github.com/Kava-Labs/kava/pull/1804 [#1785]: https://github.com/Kava-Labs/kava/pull/1785 diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 82b35968..eb95d96a 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -580,6 +580,24 @@ - [Msg](#kava.swap.v1beta1.Msg) +- [kava/validatorvesting/v1beta1/query.proto](#kava/validatorvesting/v1beta1/query.proto) + - [QueryCirculatingSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDRequest) + - [QueryCirculatingSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDResponse) + - [QueryCirculatingSupplyRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyRequest) + - [QueryCirculatingSupplyResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyResponse) + - [QueryCirculatingSupplySWPRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPRequest) + - [QueryCirculatingSupplySWPResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPResponse) + - [QueryCirculatingSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXRequest) + - [QueryCirculatingSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXResponse) + - [QueryTotalSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDRequest) + - [QueryTotalSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDResponse) + - [QueryTotalSupplyRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyRequest) + - [QueryTotalSupplyResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyResponse) + - [QueryTotalSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXRequest) + - [QueryTotalSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXResponse) + + - [Query](#kava.validatorvesting.v1beta1.Query) + - [Scalar Value Types](#scalar-value-types) @@ -7861,6 +7879,213 @@ Msg defines the swap Msg service. + +

Top

+ +## kava/validatorvesting/v1beta1/query.proto + + + + + +### QueryCirculatingSupplyHARDRequest +QueryCirculatingSupplyHARDRequest is the request type for the Query/CirculatingSupplyHARD RPC method + + + + + + + + +### QueryCirculatingSupplyHARDResponse +QueryCirculatingSupplyHARDResponse is the response type for the Query/CirculatingSupplyHARD RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [string](#string) | | | + + + + + + + + +### QueryCirculatingSupplyRequest +QueryCirculatingSupplyRequest is the request type for the Query/CirculatingSupply RPC method + + + + + + + + +### QueryCirculatingSupplyResponse +QueryCirculatingSupplyResponse is the response type for the Query/CirculatingSupply RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [string](#string) | | | + + + + + + + + +### QueryCirculatingSupplySWPRequest +QueryCirculatingSupplySWPRequest is the request type for the Query/CirculatingSupplySWP RPC method + + + + + + + + +### QueryCirculatingSupplySWPResponse +QueryCirculatingSupplySWPResponse is the response type for the Query/CirculatingSupplySWP RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [string](#string) | | | + + + + + + + + +### QueryCirculatingSupplyUSDXRequest +QueryCirculatingSupplyUSDXRequest is the request type for the Query/CirculatingSupplyUSDX RPC method + + + + + + + + +### QueryCirculatingSupplyUSDXResponse +QueryCirculatingSupplyUSDXResponse is the response type for the Query/CirculatingSupplyUSDX RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [string](#string) | | | + + + + + + + + +### QueryTotalSupplyHARDRequest +QueryTotalSupplyHARDRequest is the request type for the Query/TotalSupplyHARD RPC method + + + + + + + + +### QueryTotalSupplyHARDResponse +QueryTotalSupplyHARDResponse is the response type for the Query/TotalSupplyHARD RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [string](#string) | | | + + + + + + + + +### QueryTotalSupplyRequest +QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method + + + + + + + + +### QueryTotalSupplyResponse +QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [string](#string) | | | + + + + + + + + +### QueryTotalSupplyUSDXRequest +QueryTotalSupplyUSDXRequest is the request type for the Query/TotalSupplyUSDX RPC method + + + + + + + + +### QueryTotalSupplyUSDXResponse +QueryTotalSupplyUSDXResponse is the response type for the Query/TotalSupplyUSDX RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [string](#string) | | | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service for validator-vesting module + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `CirculatingSupply` | [QueryCirculatingSupplyRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyRequest) | [QueryCirculatingSupplyResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyResponse) | CirculatingSupply returns the total amount of kava tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply| +| `TotalSupply` | [QueryTotalSupplyRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyRequest) | [QueryTotalSupplyResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyResponse) | TotalSupply returns the total amount of kava tokens | GET|/kava/validator-vesting/v1beta1/total_supply| +| `CirculatingSupplyHARD` | [QueryCirculatingSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDRequest) | [QueryCirculatingSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDResponse) | CirculatingSupplyHARD returns the total amount of hard tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply_hard| +| `CirculatingSupplyUSDX` | [QueryCirculatingSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXRequest) | [QueryCirculatingSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXResponse) | CirculatingSupplyUSDX returns the total amount of usdx tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply_usdx| +| `CirculatingSupplySWP` | [QueryCirculatingSupplySWPRequest](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPRequest) | [QueryCirculatingSupplySWPResponse](#kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPResponse) | CirculatingSupplySWP returns the total amount of swp tokens in circulation | GET|/kava/validator-vesting/v1beta1/circulating_supply_swp| +| `TotalSupplyHARD` | [QueryTotalSupplyHARDRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDRequest) | [QueryTotalSupplyHARDResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyHARDResponse) | TotalSupplyHARD returns the total amount of hard tokens | GET|/kava/validator-vesting/v1beta1/total_supply_hard| +| `TotalSupplyUSDX` | [QueryTotalSupplyUSDXRequest](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXRequest) | [QueryTotalSupplyUSDXResponse](#kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXResponse) | TotalSupplyUSDX returns the total amount of usdx tokens | GET|/kava/validator-vesting/v1beta1/total_supply_usdx| + + + + + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/proto/kava/validatorvesting/v1beta1/query.proto b/proto/kava/validatorvesting/v1beta1/query.proto new file mode 100644 index 00000000..406c0713 --- /dev/null +++ b/proto/kava/validatorvesting/v1beta1/query.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; +package kava.validatorvesting.v1beta1; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; + +option go_package = "github.com/kava-labs/kava/x/validator-vesting/types"; +option (gogoproto.goproto_getters_all) = false; + +// Query defines the gRPC querier service for validator-vesting module +service Query { + // CirculatingSupply returns the total amount of kava tokens in circulation + rpc CirculatingSupply(QueryCirculatingSupplyRequest) returns (QueryCirculatingSupplyResponse) { + option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply"; + } + + // TotalSupply returns the total amount of kava tokens + rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { + option (google.api.http).get = "/kava/validator-vesting/v1beta1/total_supply"; + } + + // CirculatingSupplyHARD returns the total amount of hard tokens in circulation + rpc CirculatingSupplyHARD(QueryCirculatingSupplyHARDRequest) returns (QueryCirculatingSupplyHARDResponse) { + option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply_hard"; + } + + // CirculatingSupplyUSDX returns the total amount of usdx tokens in circulation + rpc CirculatingSupplyUSDX(QueryCirculatingSupplyUSDXRequest) returns (QueryCirculatingSupplyUSDXResponse) { + option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply_usdx"; + } + + // CirculatingSupplySWP returns the total amount of swp tokens in circulation + rpc CirculatingSupplySWP(QueryCirculatingSupplySWPRequest) returns (QueryCirculatingSupplySWPResponse) { + option (google.api.http).get = "/kava/validator-vesting/v1beta1/circulating_supply_swp"; + } + + // TotalSupplyHARD returns the total amount of hard tokens + rpc TotalSupplyHARD(QueryTotalSupplyHARDRequest) returns (QueryTotalSupplyHARDResponse) { + option (google.api.http).get = "/kava/validator-vesting/v1beta1/total_supply_hard"; + } + + // TotalSupplyUSDX returns the total amount of usdx tokens + rpc TotalSupplyUSDX(QueryTotalSupplyUSDXRequest) returns (QueryTotalSupplyUSDXResponse) { + option (google.api.http).get = "/kava/validator-vesting/v1beta1/total_supply_usdx"; + } +} + +// QueryCirculatingSupplyRequest is the request type for the Query/CirculatingSupply RPC method +message QueryCirculatingSupplyRequest {} + +// QueryCirculatingSupplyResponse is the response type for the Query/CirculatingSupply RPC method +message QueryCirculatingSupplyResponse { + string amount = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method +message QueryTotalSupplyRequest {} + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method +message QueryTotalSupplyResponse { + string amount = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// QueryCirculatingSupplyHARDRequest is the request type for the Query/CirculatingSupplyHARD RPC method +message QueryCirculatingSupplyHARDRequest {} + +// QueryCirculatingSupplyHARDResponse is the response type for the Query/CirculatingSupplyHARD RPC method +message QueryCirculatingSupplyHARDResponse { + string amount = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// QueryCirculatingSupplyUSDXRequest is the request type for the Query/CirculatingSupplyUSDX RPC method +message QueryCirculatingSupplyUSDXRequest {} + +// QueryCirculatingSupplyUSDXResponse is the response type for the Query/CirculatingSupplyUSDX RPC method +message QueryCirculatingSupplyUSDXResponse { + string amount = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// QueryCirculatingSupplySWPRequest is the request type for the Query/CirculatingSupplySWP RPC method +message QueryCirculatingSupplySWPRequest {} + +// QueryCirculatingSupplySWPResponse is the response type for the Query/CirculatingSupplySWP RPC method +message QueryCirculatingSupplySWPResponse { + string amount = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// QueryTotalSupplyHARDRequest is the request type for the Query/TotalSupplyHARD RPC method +message QueryTotalSupplyHARDRequest {} + +// QueryTotalSupplyHARDResponse is the response type for the Query/TotalSupplyHARD RPC method +message QueryTotalSupplyHARDResponse { + string amount = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} + +// QueryTotalSupplyUSDXRequest is the request type for the Query/TotalSupplyUSDX RPC method +message QueryTotalSupplyUSDXRequest {} + +// QueryTotalSupplyUSDXResponse is the response type for the Query/TotalSupplyUSDX RPC method +message QueryTotalSupplyUSDXResponse { + string amount = 1 [ + (cosmos_proto.scalar) = "cosmos.Int", + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; +} diff --git a/x/validator-vesting/client/cli/query.go b/x/validator-vesting/client/cli/query.go index baafa84f..748d21b2 100644 --- a/x/validator-vesting/client/cli/query.go +++ b/x/validator-vesting/client/cli/query.go @@ -1,7 +1,7 @@ package cli import ( - "fmt" + "context" "github.com/spf13/cobra" @@ -48,19 +48,12 @@ func queryCirculatingSupply() *cobra.Command { return err } - // Query - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupply), nil) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupply(context.Background(), &types.QueryCirculatingSupplyRequest{}) if err != nil { return err } - cliCtx = cliCtx.WithHeight(height) - - // Decode and print results - var out int64 - if err := cliCtx.LegacyAmino.UnmarshalJSON(res, &out); err != nil { - return fmt.Errorf("failed to unmarshal supply: %w", err) - } - return cliCtx.PrintObjectLegacy(out) + return cliCtx.PrintString(res.Amount.String()) }, } } @@ -76,20 +69,12 @@ func queryTotalSupply() *cobra.Command { if err != nil { return err } - - // Query - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryTotalSupply), nil) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.TotalSupply(context.Background(), &types.QueryTotalSupplyRequest{}) if err != nil { return err } - cliCtx = cliCtx.WithHeight(height) - - // Decode and print results - var out int64 - if err := cliCtx.LegacyAmino.UnmarshalJSON(res, &out); err != nil { - return fmt.Errorf("failed to unmarshal supply: %w", err) - } - return cliCtx.PrintObjectLegacy(out) + return cliCtx.PrintString(res.Amount.String()) }, } } @@ -106,19 +91,12 @@ func queryCirculatingSupplyHARD() *cobra.Command { return err } - // Query - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupplyHARD), nil) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupplyHARD(context.Background(), &types.QueryCirculatingSupplyHARDRequest{}) if err != nil { return err } - cliCtx = cliCtx.WithHeight(height) - - // Decode and print results - var out int64 - if err := cliCtx.LegacyAmino.UnmarshalJSON(res, &out); err != nil { - return fmt.Errorf("failed to unmarshal supply: %w", err) - } - return cliCtx.PrintObjectLegacy(out) + return cliCtx.PrintString(res.Amount.String()) }, } } @@ -135,19 +113,12 @@ func queryCirculatingSupplyUSDX() *cobra.Command { return err } - // Query - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupplyUSDX), nil) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupplyUSDX(context.Background(), &types.QueryCirculatingSupplyUSDXRequest{}) if err != nil { return err } - cliCtx = cliCtx.WithHeight(height) - - // Decode and print results - var out int64 - if err := cliCtx.LegacyAmino.UnmarshalJSON(res, &out); err != nil { - return fmt.Errorf("failed to unmarshal supply: %w", err) - } - return cliCtx.PrintObjectLegacy(out) + return cliCtx.PrintString(res.Amount.String()) }, } } @@ -164,19 +135,12 @@ func queryCirculatingSupplySWP() *cobra.Command { return err } - // Query - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupplySWP), nil) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupplySWP(context.Background(), &types.QueryCirculatingSupplySWPRequest{}) if err != nil { return err } - cliCtx = cliCtx.WithHeight(height) - - // Decode and print results - var out int64 - if err := cliCtx.LegacyAmino.UnmarshalJSON(res, &out); err != nil { - return fmt.Errorf("failed to unmarshal supply: %w", err) - } - return cliCtx.PrintObjectLegacy(out) + return cliCtx.PrintString(res.Amount.String()) }, } } @@ -193,19 +157,12 @@ func queryTotalSupplyHARD() *cobra.Command { return err } - // Query - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryTotalSupplyHARD), nil) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.TotalSupplyHARD(context.Background(), &types.QueryTotalSupplyHARDRequest{}) if err != nil { return err } - cliCtx = cliCtx.WithHeight(height) - - // Decode and print results - var out int64 - if err := cliCtx.LegacyAmino.UnmarshalJSON(res, &out); err != nil { - return fmt.Errorf("failed to unmarshal supply: %w", err) - } - return cliCtx.PrintObjectLegacy(out) + return cliCtx.PrintString(res.Amount.String()) }, } } @@ -222,19 +179,12 @@ func queryTotalSupplyUSDX() *cobra.Command { return err } - // Query - res, height, err := cliCtx.QueryWithData(fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryTotalSupplyUSDX), nil) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.TotalSupplyUSDX(context.Background(), &types.QueryTotalSupplyUSDXRequest{}) if err != nil { return err } - cliCtx = cliCtx.WithHeight(height) - - // Decode and print results - var out int64 - if err := cliCtx.LegacyAmino.UnmarshalJSON(res, &out); err != nil { - return fmt.Errorf("failed to unmarshal supply: %w", err) - } - return cliCtx.PrintObjectLegacy(out) + return cliCtx.PrintString(res.Amount.String()) }, } } diff --git a/x/validator-vesting/client/rest/query.go b/x/validator-vesting/client/rest/query.go index 6be01aab..005546ec 100644 --- a/x/validator-vesting/client/rest/query.go +++ b/x/validator-vesting/client/rest/query.go @@ -1,6 +1,7 @@ package rest import ( + "context" "encoding/json" "fmt" "net/http" @@ -25,37 +26,18 @@ func registerQueryRoutes(cliCtx client.Context, r *mux.Router) { func getTotalSupplyHandlerFn(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - _, page, limit, err := rest.ParseHTTPArgsWithLimit(r, 0) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r) if !ok { return } - params := types.NewBaseQueryParams(page, limit) - bz, err := cliCtx.LegacyAmino.MarshalJSON(params) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("failed to marshal query params: %s", err)) - return - } - - route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryTotalSupply) - res, _, err := cliCtx.QueryWithData(route, bz) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.TotalSupply(context.Background(), &types.QueryTotalSupplyRequest{}) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - var totalSupply int64 - err = cliCtx.LegacyAmino.UnmarshalJSON(res, &totalSupply) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - resBytes, err := json.Marshal(totalSupply) + resBytes, err := json.Marshal(res.Amount.Int64()) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return @@ -66,38 +48,18 @@ func getTotalSupplyHandlerFn(cliCtx client.Context) http.HandlerFunc { func getCirculatingSupplyHandlerFn(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - _, page, limit, err := rest.ParseHTTPArgsWithLimit(r, 0) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r) if !ok { return } - params := types.NewBaseQueryParams(page, limit) - bz, err := cliCtx.LegacyAmino.MarshalJSON(params) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("failed to marshal query params: %s", err)) - return - } - - route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupply) - res, _, err := cliCtx.QueryWithData(route, bz) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupply(context.Background(), &types.QueryCirculatingSupplyRequest{}) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - - var circSupply int64 - err = cliCtx.LegacyAmino.UnmarshalJSON(res, &circSupply) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - resBytes, err := json.Marshal(circSupply) + resBytes, err := json.Marshal(res.Amount.Int64()) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return @@ -108,38 +70,18 @@ func getCirculatingSupplyHandlerFn(cliCtx client.Context) http.HandlerFunc { func getCirculatingSupplyHARDHandlerFn(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - _, page, limit, err := rest.ParseHTTPArgsWithLimit(r, 0) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r) if !ok { return } - params := types.NewBaseQueryParams(page, limit) - bz, err := cliCtx.LegacyAmino.MarshalJSON(params) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("failed to marshal query params: %s", err)) - return - } - - route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupplyHARD) - res, _, err := cliCtx.QueryWithData(route, bz) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupplyHARD(context.Background(), &types.QueryCirculatingSupplyHARDRequest{}) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - - var circSupply int64 - err = cliCtx.LegacyAmino.UnmarshalJSON(res, &circSupply) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - resBytes, err := json.Marshal(circSupply) + resBytes, err := json.Marshal(res.Amount.Int64()) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return @@ -150,38 +92,18 @@ func getCirculatingSupplyHARDHandlerFn(cliCtx client.Context) http.HandlerFunc { func getCirculatingSupplyUSDXHandlerFn(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - _, page, limit, err := rest.ParseHTTPArgsWithLimit(r, 0) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r) if !ok { return } - params := types.NewBaseQueryParams(page, limit) - bz, err := cliCtx.LegacyAmino.MarshalJSON(params) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("failed to marshal query params: %s", err)) - return - } - - route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupplyUSDX) - res, _, err := cliCtx.QueryWithData(route, bz) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupplyUSDX(context.Background(), &types.QueryCirculatingSupplyUSDXRequest{}) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - - var circSupply int64 - err = cliCtx.LegacyAmino.UnmarshalJSON(res, &circSupply) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - resBytes, err := json.Marshal(circSupply) + resBytes, err := json.Marshal(res.Amount.Int64()) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return @@ -192,38 +114,18 @@ func getCirculatingSupplyUSDXHandlerFn(cliCtx client.Context) http.HandlerFunc { func getCirculatingSupplySWPHandlerFn(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - _, page, limit, err := rest.ParseHTTPArgsWithLimit(r, 0) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r) if !ok { return } - params := types.NewBaseQueryParams(page, limit) - bz, err := cliCtx.LegacyAmino.MarshalJSON(params) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("failed to marshal query params: %s", err)) - return - } - - route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryCirculatingSupplySWP) - res, _, err := cliCtx.QueryWithData(route, bz) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.CirculatingSupplySWP(context.Background(), &types.QueryCirculatingSupplySWPRequest{}) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - - var circSupply int64 - err = cliCtx.LegacyAmino.UnmarshalJSON(res, &circSupply) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - resBytes, err := json.Marshal(circSupply) + resBytes, err := json.Marshal(res.Amount.Int64()) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return @@ -234,37 +136,18 @@ func getCirculatingSupplySWPHandlerFn(cliCtx client.Context) http.HandlerFunc { func getTotalSupplyHARDHandlerFn(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - _, page, limit, err := rest.ParseHTTPArgsWithLimit(r, 0) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r) if !ok { return } - params := types.NewBaseQueryParams(page, limit) - bz, err := cliCtx.LegacyAmino.MarshalJSON(params) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("failed to marshal query params: %s", err)) - return - } - - route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryTotalSupplyHARD) - res, _, err := cliCtx.QueryWithData(route, bz) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.TotalSupplyHARD(context.Background(), &types.QueryTotalSupplyHARDRequest{}) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - var totalSupply int64 - err = cliCtx.LegacyAmino.UnmarshalJSON(res, &totalSupply) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - resBytes, err := json.Marshal(totalSupply) + resBytes, err := json.Marshal(res.Amount.Int64()) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return @@ -275,37 +158,18 @@ func getTotalSupplyHARDHandlerFn(cliCtx client.Context) http.HandlerFunc { func getTotalSupplyUSDXHandlerFn(cliCtx client.Context) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { - _, page, limit, err := rest.ParseHTTPArgsWithLimit(r, 0) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error()) - return - } - cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r) if !ok { return } - params := types.NewBaseQueryParams(page, limit) - bz, err := cliCtx.LegacyAmino.MarshalJSON(params) - if err != nil { - rest.WriteErrorResponse(w, http.StatusBadRequest, fmt.Sprintf("failed to marshal query params: %s", err)) - return - } - - route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryTotalSupplyUSDX) - res, _, err := cliCtx.QueryWithData(route, bz) + queryClient := types.NewQueryClient(cliCtx) + res, err := queryClient.TotalSupplyUSDX(context.Background(), &types.QueryTotalSupplyUSDXRequest{}) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return } - var totalSupply int64 - err = cliCtx.LegacyAmino.UnmarshalJSON(res, &totalSupply) - if err != nil { - rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) - return - } - resBytes, err := json.Marshal(totalSupply) + resBytes, err := json.Marshal(res.Amount.Int64()) if err != nil { rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error()) return diff --git a/x/validator-vesting/keeper/grpc_query.go b/x/validator-vesting/keeper/grpc_query.go new file mode 100644 index 00000000..c633638f --- /dev/null +++ b/x/validator-vesting/keeper/grpc_query.go @@ -0,0 +1,358 @@ +package keeper + +import ( + "context" + "time" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/kava-labs/kava/x/validator-vesting/types" +) + +type queryServer struct { + bk types.BankKeeper +} + +var _ types.QueryServer = queryServer{} + +// NewQueryServerImpl creates a new server for handling gRPC queries. +func NewQueryServerImpl(bk types.BankKeeper) types.QueryServer { + return &queryServer{bk: bk} +} + +// CirculatingSupply implements the gRPC service handler for querying the circulating supply of the kava token. +func (s queryServer) CirculatingSupply(c context.Context, req *types.QueryCirculatingSupplyRequest) (*types. + QueryCirculatingSupplyResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + totalSupply := s.bk.GetSupply(ctx, "ukava").Amount + supplyInt := getCirculatingSupply(ctx.BlockTime(), totalSupply) + return &types.QueryCirculatingSupplyResponse{ + Amount: supplyInt, + }, nil +} + +// TotalSupply returns the total amount of ukava tokens +func (s queryServer) TotalSupply(c context.Context, req *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + totalSupply := s.bk.GetSupply(ctx, "ukava").Amount + supplyInt := sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).TruncateInt() + return &types.QueryTotalSupplyResponse{ + Amount: supplyInt, + }, nil +} + +// CirculatingSupplyHARD returns the total amount of hard tokens in circulation +func (s queryServer) CirculatingSupplyHARD(c context.Context, req *types.QueryCirculatingSupplyHARDRequest) (*types.QueryCirculatingSupplyHARDResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + supplyIncreaseDates := []time.Time{ + time.Date(2020, 10, 15, 14, 0, 0, 0, time.UTC), // + 30,000,000 *** Year ONE *** + time.Date(2020, 11, 15, 14, 0, 0, 0, time.UTC), // + 5,000,000 + time.Date(2020, 12, 15, 14, 0, 0, 0, time.UTC), // + 5,000,000 + time.Date(2021, 1, 15, 14, 0, 0, 0, time.UTC), // + 7,708,334 + time.Date(2021, 2, 15, 14, 0, 0, 0, time.UTC), // + 3,333,333 + time.Date(2021, 3, 15, 14, 0, 0, 0, time.UTC), // + 3,333,333 + time.Date(2021, 4, 15, 14, 0, 0, 0, time.UTC), // + 6,875,000 + time.Date(2021, 5, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2021, 6, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2021, 7, 15, 14, 0, 0, 0, time.UTC), // + 6,875,000 + time.Date(2021, 8, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2021, 9, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 *** Year ONE *** + time.Date(2021, 10, 15, 14, 0, 0, 0, time.UTC), // + 13,541,667 *** Year TWO *** + time.Date(2021, 11, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2021, 12, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2022, 1, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 + time.Date(2022, 2, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2022, 3, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2022, 4, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 + time.Date(2022, 5, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2022, 6, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2022, 7, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 + time.Date(2022, 8, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2022, 9, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 *** Year TWO *** + time.Date(2022, 10, 15, 14, 0, 0, 0, time.UTC), // + 8,541,667 *** Year THREE *** + time.Date(2022, 11, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2022, 12, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2023, 1, 15, 14, 0, 0, 0, time.UTC), // + 4,166,667 + time.Date(2023, 2, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2023, 3, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2023, 4, 15, 14, 0, 0, 0, time.UTC), // + 4,166,667 + time.Date(2023, 5, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2023, 6, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2023, 7, 15, 14, 0, 0, 0, time.UTC), // + 4,166,667 + time.Date(2023, 8, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 + time.Date(2023, 9, 15, 14, 0, 0, 0, time.UTC), // + 2,500,000 *** Year THREE *** + time.Date(2023, 10, 15, 14, 0, 0, 0, time.UTC), // + 3,333,334 *** Year FOUR *** + time.Date(2023, 11, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2023, 12, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 1, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 2, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 3, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 4, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 5, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 6, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 7, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 8, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 + time.Date(2024, 9, 15, 14, 0, 0, 0, time.UTC), // + 1,666,667 *** Year FOUR *** + } + + circSupply := sdk.ZeroInt() + blockTime := ctx.BlockTime() + switch { + case blockTime.Before(supplyIncreaseDates[0]): + circSupply = sdkmath.NewInt(0) + case blockTime.After(supplyIncreaseDates[0]) && blockTime.Before(supplyIncreaseDates[1]) || blockTime.Equal(supplyIncreaseDates[0]): + circSupply = sdkmath.NewInt(30000000) // Start year ONE + case blockTime.After(supplyIncreaseDates[1]) && blockTime.Before(supplyIncreaseDates[2]) || blockTime.Equal(supplyIncreaseDates[1]): + circSupply = sdkmath.NewInt(35000000) + case blockTime.After(supplyIncreaseDates[2]) && blockTime.Before(supplyIncreaseDates[3]) || blockTime.Equal(supplyIncreaseDates[2]): + circSupply = sdkmath.NewInt(40000000) + case blockTime.After(supplyIncreaseDates[3]) && blockTime.Before(supplyIncreaseDates[4]) || blockTime.Equal(supplyIncreaseDates[3]): + circSupply = sdkmath.NewInt(47708334) + case blockTime.After(supplyIncreaseDates[4]) && blockTime.Before(supplyIncreaseDates[5]) || blockTime.Equal(supplyIncreaseDates[4]): + circSupply = sdkmath.NewInt(51041667) + case blockTime.After(supplyIncreaseDates[5]) && blockTime.Before(supplyIncreaseDates[6]) || blockTime.Equal(supplyIncreaseDates[5]): + circSupply = sdkmath.NewInt(54375000) + case blockTime.After(supplyIncreaseDates[6]) && blockTime.Before(supplyIncreaseDates[7]) || blockTime.Equal(supplyIncreaseDates[6]): + circSupply = sdkmath.NewInt(61250000) + case blockTime.After(supplyIncreaseDates[7]) && blockTime.Before(supplyIncreaseDates[8]) || blockTime.Equal(supplyIncreaseDates[7]): + circSupply = sdkmath.NewInt(63750000) + case blockTime.After(supplyIncreaseDates[8]) && blockTime.Before(supplyIncreaseDates[9]) || blockTime.Equal(supplyIncreaseDates[8]): + circSupply = sdkmath.NewInt(66250000) + case blockTime.After(supplyIncreaseDates[9]) && blockTime.Before(supplyIncreaseDates[10]) || blockTime.Equal(supplyIncreaseDates[9]): + circSupply = sdkmath.NewInt(73125000) + case blockTime.After(supplyIncreaseDates[10]) && blockTime.Before(supplyIncreaseDates[11]) || blockTime.Equal(supplyIncreaseDates[10]): + circSupply = sdkmath.NewInt(75625000) + case blockTime.After(supplyIncreaseDates[11]) && blockTime.Before(supplyIncreaseDates[12]) || blockTime.Equal(supplyIncreaseDates[11]): + circSupply = sdkmath.NewInt(78125000) // End year ONE + case blockTime.After(supplyIncreaseDates[12]) && blockTime.Before(supplyIncreaseDates[13]) || blockTime.Equal(supplyIncreaseDates[12]): + circSupply = sdkmath.NewInt(91666667) // Start year TWO + case blockTime.After(supplyIncreaseDates[13]) && blockTime.Before(supplyIncreaseDates[14]) || blockTime.Equal(supplyIncreaseDates[13]): + circSupply = sdkmath.NewInt(94166667) + case blockTime.After(supplyIncreaseDates[14]) && blockTime.Before(supplyIncreaseDates[15]) || blockTime.Equal(supplyIncreaseDates[14]): + circSupply = sdkmath.NewInt(96666667) + case blockTime.After(supplyIncreaseDates[15]) && blockTime.Before(supplyIncreaseDates[16]) || blockTime.Equal(supplyIncreaseDates[15]): + circSupply = sdkmath.NewInt(105208334) + case blockTime.After(supplyIncreaseDates[16]) && blockTime.Before(supplyIncreaseDates[17]) || blockTime.Equal(supplyIncreaseDates[16]): + circSupply = sdkmath.NewInt(107708334) + case blockTime.After(supplyIncreaseDates[17]) && blockTime.Before(supplyIncreaseDates[18]) || blockTime.Equal(supplyIncreaseDates[17]): + circSupply = sdkmath.NewInt(110208334) + case blockTime.After(supplyIncreaseDates[18]) && blockTime.Before(supplyIncreaseDates[19]) || blockTime.Equal(supplyIncreaseDates[18]): + circSupply = sdkmath.NewInt(118750000) + case blockTime.After(supplyIncreaseDates[19]) && blockTime.Before(supplyIncreaseDates[20]) || blockTime.Equal(supplyIncreaseDates[19]): + circSupply = sdkmath.NewInt(121250000) + case blockTime.After(supplyIncreaseDates[20]) && blockTime.Before(supplyIncreaseDates[21]) || blockTime.Equal(supplyIncreaseDates[20]): + circSupply = sdkmath.NewInt(123750000) + case blockTime.After(supplyIncreaseDates[21]) && blockTime.Before(supplyIncreaseDates[22]) || blockTime.Equal(supplyIncreaseDates[21]): + circSupply = sdkmath.NewInt(132291668) + case blockTime.After(supplyIncreaseDates[22]) && blockTime.Before(supplyIncreaseDates[23]) || blockTime.Equal(supplyIncreaseDates[22]): + circSupply = sdkmath.NewInt(134791668) + case blockTime.After(supplyIncreaseDates[23]) && blockTime.Before(supplyIncreaseDates[24]) || blockTime.Equal(supplyIncreaseDates[23]): + circSupply = sdkmath.NewInt(137291668) // End year TWO + case blockTime.After(supplyIncreaseDates[24]) && blockTime.Before(supplyIncreaseDates[25]) || blockTime.Equal(supplyIncreaseDates[24]): + circSupply = sdkmath.NewInt(145833335) // Start year THREE + case blockTime.After(supplyIncreaseDates[25]) && blockTime.Before(supplyIncreaseDates[26]) || blockTime.Equal(supplyIncreaseDates[25]): + circSupply = sdkmath.NewInt(148333335) + case blockTime.After(supplyIncreaseDates[26]) && blockTime.Before(supplyIncreaseDates[27]) || blockTime.Equal(supplyIncreaseDates[26]): + circSupply = sdkmath.NewInt(150833335) + case blockTime.After(supplyIncreaseDates[27]) && blockTime.Before(supplyIncreaseDates[28]) || blockTime.Equal(supplyIncreaseDates[27]): + circSupply = sdkmath.NewInt(155000000) + case blockTime.After(supplyIncreaseDates[28]) && blockTime.Before(supplyIncreaseDates[29]) || blockTime.Equal(supplyIncreaseDates[28]): + circSupply = sdkmath.NewInt(157500000) + case blockTime.After(supplyIncreaseDates[29]) && blockTime.Before(supplyIncreaseDates[30]) || blockTime.Equal(supplyIncreaseDates[29]): + circSupply = sdkmath.NewInt(160000000) + case blockTime.After(supplyIncreaseDates[30]) && blockTime.Before(supplyIncreaseDates[31]) || blockTime.Equal(supplyIncreaseDates[30]): + circSupply = sdkmath.NewInt(164166669) + case blockTime.After(supplyIncreaseDates[31]) && blockTime.Before(supplyIncreaseDates[32]) || blockTime.Equal(supplyIncreaseDates[31]): + circSupply = sdkmath.NewInt(166666669) + case blockTime.After(supplyIncreaseDates[32]) && blockTime.Before(supplyIncreaseDates[33]) || blockTime.Equal(supplyIncreaseDates[32]): + circSupply = sdkmath.NewInt(169166669) + case blockTime.After(supplyIncreaseDates[33]) && blockTime.Before(supplyIncreaseDates[34]) || blockTime.Equal(supplyIncreaseDates[33]): + circSupply = sdkmath.NewInt(173333336) + case blockTime.After(supplyIncreaseDates[34]) && blockTime.Before(supplyIncreaseDates[35]) || blockTime.Equal(supplyIncreaseDates[34]): + circSupply = sdkmath.NewInt(175833336) + case blockTime.After(supplyIncreaseDates[35]) && blockTime.Before(supplyIncreaseDates[36]) || blockTime.Equal(supplyIncreaseDates[35]): + circSupply = sdkmath.NewInt(178333336) // End year THREE + case blockTime.After(supplyIncreaseDates[36]) && blockTime.Before(supplyIncreaseDates[37]) || blockTime.Equal(supplyIncreaseDates[36]): + circSupply = sdkmath.NewInt(181666670) // Start year FOUR + case blockTime.After(supplyIncreaseDates[37]) && blockTime.Before(supplyIncreaseDates[38]) || blockTime.Equal(supplyIncreaseDates[37]): + circSupply = sdkmath.NewInt(183333337) + case blockTime.After(supplyIncreaseDates[38]) && blockTime.Before(supplyIncreaseDates[39]) || blockTime.Equal(supplyIncreaseDates[38]): + circSupply = sdkmath.NewInt(185000000) + case blockTime.After(supplyIncreaseDates[39]) && blockTime.Before(supplyIncreaseDates[40]) || blockTime.Equal(supplyIncreaseDates[39]): + circSupply = sdkmath.NewInt(186666670) + case blockTime.After(supplyIncreaseDates[40]) && blockTime.Before(supplyIncreaseDates[41]) || blockTime.Equal(supplyIncreaseDates[40]): + circSupply = sdkmath.NewInt(188333338) + case blockTime.After(supplyIncreaseDates[41]) && blockTime.Before(supplyIncreaseDates[42]) || blockTime.Equal(supplyIncreaseDates[41]): + circSupply = sdkmath.NewInt(190000000) + case blockTime.After(supplyIncreaseDates[42]) && blockTime.Before(supplyIncreaseDates[43]) || blockTime.Equal(supplyIncreaseDates[42]): + circSupply = sdkmath.NewInt(191666670) + case blockTime.After(supplyIncreaseDates[43]) && blockTime.Before(supplyIncreaseDates[44]) || blockTime.Equal(supplyIncreaseDates[43]): + circSupply = sdkmath.NewInt(193333339) + case blockTime.After(supplyIncreaseDates[44]) && blockTime.Before(supplyIncreaseDates[45]) || blockTime.Equal(supplyIncreaseDates[44]): + circSupply = sdkmath.NewInt(195000000) + case blockTime.After(supplyIncreaseDates[45]) && blockTime.Before(supplyIncreaseDates[46]) || blockTime.Equal(supplyIncreaseDates[45]): + circSupply = sdkmath.NewInt(196666670) + case blockTime.After(supplyIncreaseDates[46]) && blockTime.Before(supplyIncreaseDates[47]) || blockTime.Equal(supplyIncreaseDates[46]): + circSupply = sdkmath.NewInt(198333340) + case blockTime.After(supplyIncreaseDates[47]) && blockTime.Before(supplyIncreaseDates[48]) || blockTime.Equal(supplyIncreaseDates[47]): + circSupply = sdkmath.NewInt(200000000) // End year FOUR + default: + circSupply = sdkmath.NewInt(200000000) + } + + return &types.QueryCirculatingSupplyHARDResponse{ + Amount: circSupply, + }, nil +} + +// CirculatingSupplyUSDX returns the total amount of usdx tokens in circulation +func (s queryServer) CirculatingSupplyUSDX(c context.Context, req *types.QueryCirculatingSupplyUSDXRequest) (*types.QueryCirculatingSupplyUSDXResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + totalSupply := s.bk.GetSupply(ctx, "usdx").Amount + supplyInt := sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).TruncateInt() + return &types.QueryCirculatingSupplyUSDXResponse{ + Amount: supplyInt, + }, nil +} + +// CirculatingSupplySWP returns the total amount of swp tokens in circulation +func (s queryServer) CirculatingSupplySWP(c context.Context, req *types.QueryCirculatingSupplySWPRequest) (*types.QueryCirculatingSupplySWPResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + // Start values + year := 2021 + month := 8 + + var supplyIncreaseDates []time.Time + + // Add month times for 4 years + for i := 0; i < 12*4; i++ { + // Always day 30 unless it's Feb + day := 30 + if month == 2 { + day = 28 + } + + date := time.Date(year, time.Month(month), day, 15 /* hour */, 0, 0, 0, time.UTC) + supplyIncreaseDates = append(supplyIncreaseDates, date) + + // Update year and month + if month == 12 { + month = 1 + year += 1 + } else { + month += 1 + } + } + + // Repeated tokens released + teamSwp := int64(4_687_500) + treasurySwp := int64(5_859_375) + monthlyStakersSwp := int64(520_833) + monthlyLPIncentivesSwp := int64(2_343_750) + + // []{Ecosystem, Team, Treasury, Kava Stakers, LP Incentives} + scheduleAmounts := [][]int64{ + {12_500_000, 0, 15_625_000, monthlyStakersSwp, monthlyLPIncentivesSwp}, // *** Year ONE *** + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 1 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 2 + {0, 0, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 3 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 4 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 5 + {0, 0, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 6 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 7 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 8 + {0, 0, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 9 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 10 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 11 + {0, 18_750_000, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // *** Year TWO *** + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 13 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 14 + {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 15 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 16 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 17 + {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 18 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 19 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 20 + {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 21 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 22 + {0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}, // 23 + {0, teamSwp, treasurySwp, monthlyStakersSwp, monthlyLPIncentivesSwp}, // *** Year THREE *** + } + + // Months 25-47 are the same + for i := 0; i < 23; i++ { + scheduleAmounts = append(scheduleAmounts, []int64{0, 0, 0, monthlyStakersSwp, monthlyLPIncentivesSwp}) + } + + circSupply := sdk.ZeroInt() + blockTime := ctx.BlockTime() + + for i := 0; i < len(scheduleAmounts); i++ { + if blockTime.Before(supplyIncreaseDates[i]) { + break + } + + // Sum up each category of token release + monthTotal := int64(0) + for _, val := range scheduleAmounts[i] { + monthTotal += val + } + + circSupply = circSupply.Add(sdkmath.NewInt(monthTotal)) + } + + return &types.QueryCirculatingSupplySWPResponse{ + Amount: circSupply, + }, nil +} + +// TotalSupplyHARD returns the total amount of hard tokens +func (s queryServer) TotalSupplyHARD(c context.Context, req *types.QueryTotalSupplyHARDRequest) (*types.QueryTotalSupplyHARDResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + totalSupply := s.bk.GetSupply(ctx, "hard").Amount + supplyInt := sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).TruncateInt() + return &types.QueryTotalSupplyHARDResponse{ + Amount: supplyInt, + }, nil +} + +// TotalSupplyUSDX returns the total amount of usdx tokens +func (s queryServer) TotalSupplyUSDX(c context.Context, req *types.QueryTotalSupplyUSDXRequest) (*types.QueryTotalSupplyUSDXResponse, error) { + // USDX total supply is the circulating supply + rsp, err := s.CirculatingSupplyUSDX(c, &types.QueryCirculatingSupplyUSDXRequest{}) + if err != nil { + return nil, err + } + return &types.QueryTotalSupplyUSDXResponse{ + Amount: rsp.Amount, + }, nil +} + +func getCirculatingSupply(blockTime time.Time, totalSupply sdkmath.Int) sdkmath.Int { + vestingDates := []time.Time{ + time.Date(2022, 2, 5, 14, 0, 0, 0, time.UTC), + time.Date(2022, 5, 5, 14, 0, 0, 0, time.UTC), + time.Date(2022, 8, 5, 14, 0, 0, 0, time.UTC), + time.Date(2022, 11, 5, 14, 0, 0, 0, time.UTC), + } + + switch { + case blockTime.Before(vestingDates[0]): + return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(9937500000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() + case blockTime.After(vestingDates[0]) && blockTime.Before(vestingDates[1]) || blockTime.Equal(vestingDates[0]): + return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(7453125000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() + case blockTime.After(vestingDates[1]) && blockTime.Before(vestingDates[2]) || blockTime.Equal(vestingDates[1]): + return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(4968750000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() + case blockTime.After(vestingDates[2]) && blockTime.Before(vestingDates[3]) || blockTime.Equal(vestingDates[2]): + return sdk.NewDecFromInt(totalSupply.Sub(sdkmath.NewInt(2484375000000))).Mul(sdk.MustNewDecFromStr("0.000001")).RoundInt() + default: + // align with total supply calculation and truncate int here instead of round + return sdk.NewDecFromInt(totalSupply).Mul(sdk.MustNewDecFromStr("0.000001")).TruncateInt() + } +} diff --git a/x/validator-vesting/keeper/grpc_query_test.go b/x/validator-vesting/keeper/grpc_query_test.go new file mode 100644 index 00000000..b4a848aa --- /dev/null +++ b/x/validator-vesting/keeper/grpc_query_test.go @@ -0,0 +1,116 @@ +package keeper_test + +import ( + "context" + "testing" + "time" + + sdkmath "cosmossdk.io/math" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + + "github.com/kava-labs/kava/app" + "github.com/kava-labs/kava/x/validator-vesting/keeper" + "github.com/kava-labs/kava/x/validator-vesting/types" +) + +type grpcQueryTestSuite struct { + suite.Suite + app app.TestApp + ctx sdk.Context + queryClient types.QueryClient + bk *mockBankKeeper +} + +type mockBankKeeper struct { + supply sdk.Coin +} + +func (m *mockBankKeeper) SetSupply(ctx sdk.Context, denom string, amt sdkmath.Int) { + m.supply = sdk.NewCoin(denom, amt) +} + +func (m *mockBankKeeper) GetSupply(ctx sdk.Context, denom string) sdk.Coin { + return m.supply +} + +func (suite *grpcQueryTestSuite) SetupTest() { + tApp := app.NewTestApp() + ctx := tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now()}) + suite.app = tApp + suite.ctx = ctx + suite.bk = &mockBankKeeper{} + suite.queryClient = suite.queryClientWithBlockTime(tmtime.Now()) +} + +func TestGrpcQueryTestSuite(t *testing.T) { + suite.Run(t, new(grpcQueryTestSuite)) +} + +func (suite *grpcQueryTestSuite) TestCirculatingSupply() { + suite.Run("vesting period supply", func() { + suite.bk.SetSupply(suite.ctx, "ukava", sdkmath.NewInt(2_500_000_000_000)) + lastVestingPeriod := time.Date(2022, 8, 5, 24, 0, 0, 0, time.UTC) + queryClient := suite.queryClientWithBlockTime(lastVestingPeriod) + res, err := queryClient.CirculatingSupply(context.Background(), &types.QueryCirculatingSupplyRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(15_625), res.Amount) + }) + + suite.Run("supply after last vesting period", func() { + suite.bk.SetSupply(suite.ctx, "ukava", sdkmath.NewInt(100_000_000)) + res, err := suite.queryClient.CirculatingSupply(context.Background(), &types.QueryCirculatingSupplyRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(100), res.Amount) + }) +} + +func (suite *grpcQueryTestSuite) TestTotalSupply() { + suite.bk.SetSupply(suite.ctx, "ukava", sdkmath.NewInt(100_000_000)) + res, err := suite.queryClient.TotalSupply(context.Background(), &types.QueryTotalSupplyRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(100), res.Amount) +} + +func (suite *grpcQueryTestSuite) TestCirculatingSupplyHARD() { + res, err := suite.queryClient.CirculatingSupplyHARD(context.Background(), &types.QueryCirculatingSupplyHARDRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(188333338), res.Amount) +} + +func (suite *grpcQueryTestSuite) TestCirculatingSupplyUSDX() { + suite.bk.SetSupply(suite.ctx, "usdx", sdkmath.NewInt(150_000_000)) + res, err := suite.queryClient.CirculatingSupplyUSDX(context.Background(), &types.QueryCirculatingSupplyUSDXRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(150), res.Amount) +} + +func (suite *grpcQueryTestSuite) TestCirculatingSupplySWP() { + res, err := suite.queryClient.CirculatingSupplySWP(context.Background(), &types.QueryCirculatingSupplySWPRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(198437490), res.Amount) +} + +func (suite *grpcQueryTestSuite) TestTotalSupplyHARD() { + suite.bk.SetSupply(suite.ctx, "hard", sdkmath.NewInt(150_000_000)) + res, err := suite.queryClient.TotalSupplyHARD(context.Background(), &types.QueryTotalSupplyHARDRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(150), res.Amount) +} + +func (suite *grpcQueryTestSuite) TestTotalSupplyUSDX() { + suite.bk.SetSupply(suite.ctx, "usdx", sdkmath.NewInt(150_000_000)) + res, err := suite.queryClient.TotalSupplyUSDX(context.Background(), &types.QueryTotalSupplyUSDXRequest{}) + suite.Require().NoError(err) + suite.Require().Equal(sdkmath.NewInt(150), res.Amount) +} + +func (suite *grpcQueryTestSuite) queryClientWithBlockTime(blockTime time.Time) types.QueryClient { + ctx := suite.ctx.WithBlockTime(blockTime) + queryHelper := baseapp.NewQueryServerTestHelper(ctx, suite.app.InterfaceRegistry()) + types.RegisterQueryServer(queryHelper, keeper.NewQueryServerImpl(suite.bk)) + return types.NewQueryClient(queryHelper) +} diff --git a/x/validator-vesting/module.go b/x/validator-vesting/module.go index eb4c73aa..39fa0c61 100644 --- a/x/validator-vesting/module.go +++ b/x/validator-vesting/module.go @@ -1,6 +1,7 @@ package validator_vesting import ( + "context" "encoding/json" "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -15,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/kava-labs/kava/x/validator-vesting/client/cli" + "github.com/kava-labs/kava/x/validator-vesting/keeper" "github.com/kava-labs/kava/x/validator-vesting/types" ) @@ -54,7 +56,11 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod } // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for validator-vesting module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) {} +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} // GetTxCmd returns validator-vesting module's root tx command. func (a AppModuleBasic) GetTxCmd() *cobra.Command { return nil } @@ -90,7 +96,9 @@ func (am AppModule) Name() string { // RegisterServices registers a GRPC query service to respond to the // module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) {} +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQueryServerImpl(am.bankKeeper)) +} // RegisterInvariants registers validator-vesting module's invariants. func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} diff --git a/x/validator-vesting/types/querier.go b/x/validator-vesting/types/querier.go deleted file mode 100644 index 465435f3..00000000 --- a/x/validator-vesting/types/querier.go +++ /dev/null @@ -1,26 +0,0 @@ -package types - -// Querier routes for the validator vesting module -const ( - QueryCirculatingSupply = "circulating-supply" - QueryTotalSupply = "total-supply" - QueryCirculatingSupplyHARD = "circulating-supply-hard" - QueryCirculatingSupplyUSDX = "circulating-supply-usdx" - QueryCirculatingSupplySWP = "circulating-supply-swp" - QueryTotalSupplyHARD = "total-supply-hard" - QueryTotalSupplyUSDX = "total-supply-usdx" -) - -// BaseQueryParams defines the parameters necessary for querying for all Evidence. -type BaseQueryParams struct { - Page int `json:"page" yaml:"page"` - Limit int `json:"limit" yaml:"limit"` -} - -// NewBaseQueryParams returns a new BaseQueryParams -func NewBaseQueryParams(page, limit int) BaseQueryParams { - return BaseQueryParams{ - Page: page, - Limit: limit, - } -} diff --git a/x/validator-vesting/types/query.pb.go b/x/validator-vesting/types/query.pb.go new file mode 100644 index 00000000..b8a8442d --- /dev/null +++ b/x/validator-vesting/types/query.pb.go @@ -0,0 +1,2503 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: kava/validatorvesting/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryCirculatingSupplyRequest is the request type for the Query/CirculatingSupply RPC method +type QueryCirculatingSupplyRequest struct { +} + +func (m *QueryCirculatingSupplyRequest) Reset() { *m = QueryCirculatingSupplyRequest{} } +func (m *QueryCirculatingSupplyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplyRequest) ProtoMessage() {} +func (*QueryCirculatingSupplyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{0} +} +func (m *QueryCirculatingSupplyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplyRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplyRequest.Merge(m, src) +} +func (m *QueryCirculatingSupplyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplyRequest proto.InternalMessageInfo + +// QueryCirculatingSupplyResponse is the response type for the Query/CirculatingSupply RPC method +type QueryCirculatingSupplyResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *QueryCirculatingSupplyResponse) Reset() { *m = QueryCirculatingSupplyResponse{} } +func (m *QueryCirculatingSupplyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplyResponse) ProtoMessage() {} +func (*QueryCirculatingSupplyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{1} +} +func (m *QueryCirculatingSupplyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplyResponse.Merge(m, src) +} +func (m *QueryCirculatingSupplyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplyResponse proto.InternalMessageInfo + +// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method +type QueryTotalSupplyRequest struct { +} + +func (m *QueryTotalSupplyRequest) Reset() { *m = QueryTotalSupplyRequest{} } +func (m *QueryTotalSupplyRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyRequest) ProtoMessage() {} +func (*QueryTotalSupplyRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{2} +} +func (m *QueryTotalSupplyRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalSupplyRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyRequest.Merge(m, src) +} +func (m *QueryTotalSupplyRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyRequest proto.InternalMessageInfo + +// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC method +type QueryTotalSupplyResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *QueryTotalSupplyResponse) Reset() { *m = QueryTotalSupplyResponse{} } +func (m *QueryTotalSupplyResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyResponse) ProtoMessage() {} +func (*QueryTotalSupplyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{3} +} +func (m *QueryTotalSupplyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalSupplyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyResponse.Merge(m, src) +} +func (m *QueryTotalSupplyResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyResponse proto.InternalMessageInfo + +// QueryCirculatingSupplyHARDRequest is the request type for the Query/CirculatingSupplyHARD RPC method +type QueryCirculatingSupplyHARDRequest struct { +} + +func (m *QueryCirculatingSupplyHARDRequest) Reset() { *m = QueryCirculatingSupplyHARDRequest{} } +func (m *QueryCirculatingSupplyHARDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplyHARDRequest) ProtoMessage() {} +func (*QueryCirculatingSupplyHARDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{4} +} +func (m *QueryCirculatingSupplyHARDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplyHARDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplyHARDRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplyHARDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplyHARDRequest.Merge(m, src) +} +func (m *QueryCirculatingSupplyHARDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplyHARDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplyHARDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplyHARDRequest proto.InternalMessageInfo + +// QueryCirculatingSupplyHARDResponse is the response type for the Query/CirculatingSupplyHARD RPC method +type QueryCirculatingSupplyHARDResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *QueryCirculatingSupplyHARDResponse) Reset() { *m = QueryCirculatingSupplyHARDResponse{} } +func (m *QueryCirculatingSupplyHARDResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplyHARDResponse) ProtoMessage() {} +func (*QueryCirculatingSupplyHARDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{5} +} +func (m *QueryCirculatingSupplyHARDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplyHARDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplyHARDResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplyHARDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplyHARDResponse.Merge(m, src) +} +func (m *QueryCirculatingSupplyHARDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplyHARDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplyHARDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplyHARDResponse proto.InternalMessageInfo + +// QueryCirculatingSupplyUSDXRequest is the request type for the Query/CirculatingSupplyUSDX RPC method +type QueryCirculatingSupplyUSDXRequest struct { +} + +func (m *QueryCirculatingSupplyUSDXRequest) Reset() { *m = QueryCirculatingSupplyUSDXRequest{} } +func (m *QueryCirculatingSupplyUSDXRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplyUSDXRequest) ProtoMessage() {} +func (*QueryCirculatingSupplyUSDXRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{6} +} +func (m *QueryCirculatingSupplyUSDXRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplyUSDXRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplyUSDXRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplyUSDXRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplyUSDXRequest.Merge(m, src) +} +func (m *QueryCirculatingSupplyUSDXRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplyUSDXRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplyUSDXRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplyUSDXRequest proto.InternalMessageInfo + +// QueryCirculatingSupplyUSDXResponse is the response type for the Query/CirculatingSupplyUSDX RPC method +type QueryCirculatingSupplyUSDXResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *QueryCirculatingSupplyUSDXResponse) Reset() { *m = QueryCirculatingSupplyUSDXResponse{} } +func (m *QueryCirculatingSupplyUSDXResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplyUSDXResponse) ProtoMessage() {} +func (*QueryCirculatingSupplyUSDXResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{7} +} +func (m *QueryCirculatingSupplyUSDXResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplyUSDXResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplyUSDXResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplyUSDXResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplyUSDXResponse.Merge(m, src) +} +func (m *QueryCirculatingSupplyUSDXResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplyUSDXResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplyUSDXResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplyUSDXResponse proto.InternalMessageInfo + +// QueryCirculatingSupplySWPRequest is the request type for the Query/CirculatingSupplySWP RPC method +type QueryCirculatingSupplySWPRequest struct { +} + +func (m *QueryCirculatingSupplySWPRequest) Reset() { *m = QueryCirculatingSupplySWPRequest{} } +func (m *QueryCirculatingSupplySWPRequest) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplySWPRequest) ProtoMessage() {} +func (*QueryCirculatingSupplySWPRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{8} +} +func (m *QueryCirculatingSupplySWPRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplySWPRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplySWPRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplySWPRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplySWPRequest.Merge(m, src) +} +func (m *QueryCirculatingSupplySWPRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplySWPRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplySWPRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplySWPRequest proto.InternalMessageInfo + +// QueryCirculatingSupplySWPResponse is the response type for the Query/CirculatingSupplySWP RPC method +type QueryCirculatingSupplySWPResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *QueryCirculatingSupplySWPResponse) Reset() { *m = QueryCirculatingSupplySWPResponse{} } +func (m *QueryCirculatingSupplySWPResponse) String() string { return proto.CompactTextString(m) } +func (*QueryCirculatingSupplySWPResponse) ProtoMessage() {} +func (*QueryCirculatingSupplySWPResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{9} +} +func (m *QueryCirculatingSupplySWPResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryCirculatingSupplySWPResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryCirculatingSupplySWPResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryCirculatingSupplySWPResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryCirculatingSupplySWPResponse.Merge(m, src) +} +func (m *QueryCirculatingSupplySWPResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryCirculatingSupplySWPResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryCirculatingSupplySWPResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryCirculatingSupplySWPResponse proto.InternalMessageInfo + +// QueryTotalSupplyHARDRequest is the request type for the Query/TotalSupplyHARD RPC method +type QueryTotalSupplyHARDRequest struct { +} + +func (m *QueryTotalSupplyHARDRequest) Reset() { *m = QueryTotalSupplyHARDRequest{} } +func (m *QueryTotalSupplyHARDRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyHARDRequest) ProtoMessage() {} +func (*QueryTotalSupplyHARDRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{10} +} +func (m *QueryTotalSupplyHARDRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyHARDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyHARDRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalSupplyHARDRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyHARDRequest.Merge(m, src) +} +func (m *QueryTotalSupplyHARDRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyHARDRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyHARDRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyHARDRequest proto.InternalMessageInfo + +// QueryTotalSupplyHARDResponse is the response type for the Query/TotalSupplyHARD RPC method +type QueryTotalSupplyHARDResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *QueryTotalSupplyHARDResponse) Reset() { *m = QueryTotalSupplyHARDResponse{} } +func (m *QueryTotalSupplyHARDResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyHARDResponse) ProtoMessage() {} +func (*QueryTotalSupplyHARDResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{11} +} +func (m *QueryTotalSupplyHARDResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyHARDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyHARDResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalSupplyHARDResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyHARDResponse.Merge(m, src) +} +func (m *QueryTotalSupplyHARDResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyHARDResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyHARDResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyHARDResponse proto.InternalMessageInfo + +// QueryTotalSupplyUSDXRequest is the request type for the Query/TotalSupplyUSDX RPC method +type QueryTotalSupplyUSDXRequest struct { +} + +func (m *QueryTotalSupplyUSDXRequest) Reset() { *m = QueryTotalSupplyUSDXRequest{} } +func (m *QueryTotalSupplyUSDXRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyUSDXRequest) ProtoMessage() {} +func (*QueryTotalSupplyUSDXRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{12} +} +func (m *QueryTotalSupplyUSDXRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyUSDXRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyUSDXRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalSupplyUSDXRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyUSDXRequest.Merge(m, src) +} +func (m *QueryTotalSupplyUSDXRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyUSDXRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyUSDXRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyUSDXRequest proto.InternalMessageInfo + +// QueryTotalSupplyUSDXResponse is the response type for the Query/TotalSupplyUSDX RPC method +type QueryTotalSupplyUSDXResponse struct { + Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` +} + +func (m *QueryTotalSupplyUSDXResponse) Reset() { *m = QueryTotalSupplyUSDXResponse{} } +func (m *QueryTotalSupplyUSDXResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyUSDXResponse) ProtoMessage() {} +func (*QueryTotalSupplyUSDXResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2198ebff70588a65, []int{13} +} +func (m *QueryTotalSupplyUSDXResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyUSDXResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyUSDXResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryTotalSupplyUSDXResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyUSDXResponse.Merge(m, src) +} +func (m *QueryTotalSupplyUSDXResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyUSDXResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyUSDXResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyUSDXResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryCirculatingSupplyRequest)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplyRequest") + proto.RegisterType((*QueryCirculatingSupplyResponse)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplyResponse") + proto.RegisterType((*QueryTotalSupplyRequest)(nil), "kava.validatorvesting.v1beta1.QueryTotalSupplyRequest") + proto.RegisterType((*QueryTotalSupplyResponse)(nil), "kava.validatorvesting.v1beta1.QueryTotalSupplyResponse") + proto.RegisterType((*QueryCirculatingSupplyHARDRequest)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDRequest") + proto.RegisterType((*QueryCirculatingSupplyHARDResponse)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplyHARDResponse") + proto.RegisterType((*QueryCirculatingSupplyUSDXRequest)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXRequest") + proto.RegisterType((*QueryCirculatingSupplyUSDXResponse)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplyUSDXResponse") + proto.RegisterType((*QueryCirculatingSupplySWPRequest)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPRequest") + proto.RegisterType((*QueryCirculatingSupplySWPResponse)(nil), "kava.validatorvesting.v1beta1.QueryCirculatingSupplySWPResponse") + proto.RegisterType((*QueryTotalSupplyHARDRequest)(nil), "kava.validatorvesting.v1beta1.QueryTotalSupplyHARDRequest") + proto.RegisterType((*QueryTotalSupplyHARDResponse)(nil), "kava.validatorvesting.v1beta1.QueryTotalSupplyHARDResponse") + proto.RegisterType((*QueryTotalSupplyUSDXRequest)(nil), "kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXRequest") + proto.RegisterType((*QueryTotalSupplyUSDXResponse)(nil), "kava.validatorvesting.v1beta1.QueryTotalSupplyUSDXResponse") +} + +func init() { + proto.RegisterFile("kava/validatorvesting/v1beta1/query.proto", fileDescriptor_2198ebff70588a65) +} + +var fileDescriptor_2198ebff70588a65 = []byte{ + // 619 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x96, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0xc7, 0x33, 0x9f, 0xf4, 0x55, 0x62, 0xba, 0x40, 0x8c, 0x8a, 0x68, 0x4d, 0xe3, 0x14, 0x23, + 0x21, 0x90, 0x88, 0xad, 0x34, 0x55, 0x4b, 0x2f, 0xd0, 0x0b, 0x5d, 0xd0, 0x1d, 0x4d, 0x8a, 0x40, + 0x6c, 0xa2, 0x49, 0x62, 0xb9, 0x56, 0x1d, 0x8f, 0xeb, 0x19, 0x9b, 0x86, 0x25, 0x4f, 0x80, 0xc4, + 0xab, 0x74, 0xc3, 0x03, 0x20, 0x65, 0xc1, 0xa2, 0x82, 0x0d, 0x20, 0x51, 0x41, 0xc2, 0x83, 0x20, + 0x8f, 0x27, 0xaa, 0xeb, 0xb8, 0x29, 0x76, 0x14, 0x58, 0x25, 0xb1, 0xcf, 0xe5, 0xf7, 0xf7, 0x39, + 0xf3, 0x77, 0xe0, 0xbd, 0x03, 0xec, 0x63, 0xcd, 0xc7, 0x96, 0xd9, 0xc4, 0x8c, 0xb8, 0xbe, 0x4e, + 0x99, 0x69, 0x1b, 0x9a, 0x5f, 0xaa, 0xeb, 0x0c, 0x97, 0xb4, 0x43, 0x4f, 0x77, 0xdb, 0xaa, 0xe3, + 0x12, 0x46, 0x50, 0x3e, 0x08, 0x55, 0xe3, 0xa1, 0xaa, 0x08, 0x95, 0x66, 0x1a, 0x84, 0xb6, 0x08, + 0xad, 0xf1, 0x60, 0x2d, 0xfc, 0x11, 0x66, 0x4a, 0x53, 0x06, 0x31, 0x48, 0x78, 0x3d, 0xf8, 0x26, + 0xae, 0xce, 0x1a, 0x84, 0x18, 0x96, 0xae, 0x61, 0xc7, 0xd4, 0xb0, 0x6d, 0x13, 0x86, 0x99, 0x49, + 0x6c, 0x91, 0xa3, 0x14, 0x60, 0x7e, 0x37, 0x68, 0xfe, 0xd8, 0x74, 0x1b, 0x9e, 0x85, 0x83, 0x56, + 0x55, 0xcf, 0x71, 0xac, 0x76, 0x45, 0x3f, 0xf4, 0x74, 0xca, 0x14, 0x1f, 0xca, 0x17, 0x05, 0x50, + 0x87, 0xd8, 0x54, 0x47, 0x7b, 0x70, 0x02, 0xb7, 0x88, 0x67, 0xb3, 0x69, 0x30, 0x07, 0xee, 0x5e, + 0xd9, 0x5a, 0xeb, 0x9c, 0x16, 0x72, 0xdf, 0x4e, 0x0b, 0x77, 0x0c, 0x93, 0xed, 0x7b, 0x75, 0xb5, + 0x41, 0x5a, 0x82, 0x53, 0x7c, 0x14, 0x69, 0xf3, 0x40, 0x63, 0x6d, 0x47, 0xa7, 0xea, 0x8e, 0xcd, + 0x3e, 0x1d, 0x17, 0xa1, 0x90, 0xb1, 0x63, 0xb3, 0x8a, 0xa8, 0xa5, 0xcc, 0xc0, 0x1b, 0xbc, 0xef, + 0x1e, 0x61, 0xd8, 0x3a, 0x8f, 0xe4, 0xc0, 0xe9, 0xc1, 0x5b, 0x63, 0x85, 0xb9, 0x0d, 0x6f, 0x25, + 0x3f, 0x84, 0x27, 0x9b, 0x95, 0xed, 0x3e, 0xd6, 0x6b, 0xa8, 0x0c, 0x0b, 0xfa, 0x37, 0x80, 0xcf, + 0xaa, 0xdb, 0x2f, 0x2e, 0x05, 0x0c, 0x83, 0xc6, 0x0a, 0xa8, 0xc0, 0xb9, 0xe4, 0xde, 0xd5, 0xe7, + 0x4f, 0xfb, 0x7c, 0xed, 0x8b, 0x44, 0xf0, 0x98, 0xb1, 0xe2, 0xe5, 0xe1, 0xcd, 0xf8, 0x4a, 0x45, + 0x47, 0xcb, 0xe0, 0x6c, 0xf2, 0xed, 0xbf, 0x0d, 0x15, 0x1d, 0x67, 0x02, 0xd4, 0xf8, 0x07, 0x39, + 0xff, 0x7e, 0x12, 0xfe, 0xcf, 0xdb, 0xa2, 0x8f, 0x00, 0x5e, 0x1b, 0x18, 0x15, 0x5a, 0x53, 0x87, + 0xfa, 0x97, 0x3a, 0xd4, 0x6d, 0xa4, 0x87, 0x19, 0xb3, 0x43, 0xc9, 0xca, 0xca, 0x9b, 0xcf, 0xbf, + 0xde, 0xfd, 0xb7, 0x80, 0xe6, 0xb5, 0xf3, 0x7e, 0x5b, 0x8c, 0x1b, 0x6e, 0xe3, 0xac, 0x44, 0x8d, + 0x86, 0xe0, 0xc7, 0x00, 0x4e, 0x46, 0x1e, 0x25, 0x5a, 0xfc, 0x13, 0x94, 0x41, 0x77, 0x92, 0x96, + 0x52, 0xe7, 0x09, 0xf8, 0x05, 0x0e, 0xaf, 0xa2, 0xfb, 0x97, 0xc1, 0xb3, 0x20, 0xb9, 0x8f, 0xfd, + 0x1d, 0xc0, 0xeb, 0x89, 0x8e, 0x83, 0x36, 0x32, 0x3d, 0xcb, 0xc8, 0xda, 0x4b, 0x9b, 0x23, 0x54, + 0x10, 0xa2, 0xd6, 0xb9, 0xa8, 0x65, 0xb4, 0x94, 0x7e, 0x22, 0xb5, 0x7d, 0xec, 0x36, 0x93, 0xf5, + 0x05, 0x7b, 0x9e, 0x51, 0x5f, 0xe4, 0x04, 0x65, 0xd4, 0x17, 0x3d, 0x64, 0x23, 0xe9, 0xf3, 0x68, + 0xf3, 0x08, 0x7d, 0x05, 0x70, 0x2a, 0xc9, 0xf0, 0xd0, 0x7a, 0x26, 0xb8, 0x33, 0x3b, 0x95, 0x36, + 0xb2, 0x17, 0x10, 0xe2, 0x1e, 0x71, 0x71, 0x0f, 0xd0, 0x62, 0x06, 0x71, 0xf4, 0x95, 0x83, 0x3e, + 0x00, 0x78, 0x35, 0x66, 0x99, 0x68, 0x25, 0xe5, 0xf1, 0x88, 0xee, 0xe3, 0x6a, 0xa6, 0x5c, 0x21, + 0x66, 0x99, 0x8b, 0x29, 0xa3, 0x52, 0x9a, 0xe3, 0x15, 0xee, 0x60, 0x4c, 0x07, 0xdf, 0xbe, 0xb4, + 0x3a, 0xa2, 0x7b, 0xb7, 0x9a, 0x29, 0x77, 0x24, 0x1d, 0xc1, 0xae, 0x6d, 0xed, 0x76, 0x7e, 0xca, + 0xb9, 0x4e, 0x57, 0x06, 0x27, 0x5d, 0x19, 0xfc, 0xe8, 0xca, 0xe0, 0x6d, 0x4f, 0xce, 0x9d, 0xf4, + 0xe4, 0xdc, 0x97, 0x9e, 0x9c, 0x7b, 0x59, 0x8e, 0xbc, 0x17, 0x82, 0xd2, 0x45, 0x0b, 0xd7, 0x69, + 0xd8, 0xe4, 0x28, 0xa1, 0x0d, 0x7f, 0x51, 0xd4, 0x27, 0xf8, 0xdf, 0xc8, 0xf2, 0xef, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xbd, 0x0f, 0x0a, 0x7d, 0xe1, 0x0a, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // CirculatingSupply returns the total amount of kava tokens in circulation + CirculatingSupply(ctx context.Context, in *QueryCirculatingSupplyRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplyResponse, error) + // TotalSupply returns the total amount of kava tokens + TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) + // CirculatingSupplyHARD returns the total amount of hard tokens in circulation + CirculatingSupplyHARD(ctx context.Context, in *QueryCirculatingSupplyHARDRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplyHARDResponse, error) + // CirculatingSupplyUSDX returns the total amount of usdx tokens in circulation + CirculatingSupplyUSDX(ctx context.Context, in *QueryCirculatingSupplyUSDXRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplyUSDXResponse, error) + // CirculatingSupplySWP returns the total amount of swp tokens in circulation + CirculatingSupplySWP(ctx context.Context, in *QueryCirculatingSupplySWPRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplySWPResponse, error) + // TotalSupplyHARD returns the total amount of hard tokens + TotalSupplyHARD(ctx context.Context, in *QueryTotalSupplyHARDRequest, opts ...grpc.CallOption) (*QueryTotalSupplyHARDResponse, error) + // TotalSupplyUSDX returns the total amount of usdx tokens + TotalSupplyUSDX(ctx context.Context, in *QueryTotalSupplyUSDXRequest, opts ...grpc.CallOption) (*QueryTotalSupplyUSDXResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) CirculatingSupply(ctx context.Context, in *QueryCirculatingSupplyRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplyResponse, error) { + out := new(QueryCirculatingSupplyResponse) + err := c.cc.Invoke(ctx, "/kava.validatorvesting.v1beta1.Query/CirculatingSupply", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) { + out := new(QueryTotalSupplyResponse) + err := c.cc.Invoke(ctx, "/kava.validatorvesting.v1beta1.Query/TotalSupply", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CirculatingSupplyHARD(ctx context.Context, in *QueryCirculatingSupplyHARDRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplyHARDResponse, error) { + out := new(QueryCirculatingSupplyHARDResponse) + err := c.cc.Invoke(ctx, "/kava.validatorvesting.v1beta1.Query/CirculatingSupplyHARD", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CirculatingSupplyUSDX(ctx context.Context, in *QueryCirculatingSupplyUSDXRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplyUSDXResponse, error) { + out := new(QueryCirculatingSupplyUSDXResponse) + err := c.cc.Invoke(ctx, "/kava.validatorvesting.v1beta1.Query/CirculatingSupplyUSDX", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CirculatingSupplySWP(ctx context.Context, in *QueryCirculatingSupplySWPRequest, opts ...grpc.CallOption) (*QueryCirculatingSupplySWPResponse, error) { + out := new(QueryCirculatingSupplySWPResponse) + err := c.cc.Invoke(ctx, "/kava.validatorvesting.v1beta1.Query/CirculatingSupplySWP", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TotalSupplyHARD(ctx context.Context, in *QueryTotalSupplyHARDRequest, opts ...grpc.CallOption) (*QueryTotalSupplyHARDResponse, error) { + out := new(QueryTotalSupplyHARDResponse) + err := c.cc.Invoke(ctx, "/kava.validatorvesting.v1beta1.Query/TotalSupplyHARD", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) TotalSupplyUSDX(ctx context.Context, in *QueryTotalSupplyUSDXRequest, opts ...grpc.CallOption) (*QueryTotalSupplyUSDXResponse, error) { + out := new(QueryTotalSupplyUSDXResponse) + err := c.cc.Invoke(ctx, "/kava.validatorvesting.v1beta1.Query/TotalSupplyUSDX", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // CirculatingSupply returns the total amount of kava tokens in circulation + CirculatingSupply(context.Context, *QueryCirculatingSupplyRequest) (*QueryCirculatingSupplyResponse, error) + // TotalSupply returns the total amount of kava tokens + TotalSupply(context.Context, *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) + // CirculatingSupplyHARD returns the total amount of hard tokens in circulation + CirculatingSupplyHARD(context.Context, *QueryCirculatingSupplyHARDRequest) (*QueryCirculatingSupplyHARDResponse, error) + // CirculatingSupplyUSDX returns the total amount of usdx tokens in circulation + CirculatingSupplyUSDX(context.Context, *QueryCirculatingSupplyUSDXRequest) (*QueryCirculatingSupplyUSDXResponse, error) + // CirculatingSupplySWP returns the total amount of swp tokens in circulation + CirculatingSupplySWP(context.Context, *QueryCirculatingSupplySWPRequest) (*QueryCirculatingSupplySWPResponse, error) + // TotalSupplyHARD returns the total amount of hard tokens + TotalSupplyHARD(context.Context, *QueryTotalSupplyHARDRequest) (*QueryTotalSupplyHARDResponse, error) + // TotalSupplyUSDX returns the total amount of usdx tokens + TotalSupplyUSDX(context.Context, *QueryTotalSupplyUSDXRequest) (*QueryTotalSupplyUSDXResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) CirculatingSupply(ctx context.Context, req *QueryCirculatingSupplyRequest) (*QueryCirculatingSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CirculatingSupply not implemented") +} +func (*UnimplementedQueryServer) TotalSupply(ctx context.Context, req *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalSupply not implemented") +} +func (*UnimplementedQueryServer) CirculatingSupplyHARD(ctx context.Context, req *QueryCirculatingSupplyHARDRequest) (*QueryCirculatingSupplyHARDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CirculatingSupplyHARD not implemented") +} +func (*UnimplementedQueryServer) CirculatingSupplyUSDX(ctx context.Context, req *QueryCirculatingSupplyUSDXRequest) (*QueryCirculatingSupplyUSDXResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CirculatingSupplyUSDX not implemented") +} +func (*UnimplementedQueryServer) CirculatingSupplySWP(ctx context.Context, req *QueryCirculatingSupplySWPRequest) (*QueryCirculatingSupplySWPResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CirculatingSupplySWP not implemented") +} +func (*UnimplementedQueryServer) TotalSupplyHARD(ctx context.Context, req *QueryTotalSupplyHARDRequest) (*QueryTotalSupplyHARDResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalSupplyHARD not implemented") +} +func (*UnimplementedQueryServer) TotalSupplyUSDX(ctx context.Context, req *QueryTotalSupplyUSDXRequest) (*QueryTotalSupplyUSDXResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalSupplyUSDX not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_CirculatingSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCirculatingSupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CirculatingSupply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kava.validatorvesting.v1beta1.Query/CirculatingSupply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CirculatingSupply(ctx, req.(*QueryCirculatingSupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalSupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalSupply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kava.validatorvesting.v1beta1.Query/TotalSupply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalSupply(ctx, req.(*QueryTotalSupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CirculatingSupplyHARD_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCirculatingSupplyHARDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CirculatingSupplyHARD(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kava.validatorvesting.v1beta1.Query/CirculatingSupplyHARD", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CirculatingSupplyHARD(ctx, req.(*QueryCirculatingSupplyHARDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CirculatingSupplyUSDX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCirculatingSupplyUSDXRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CirculatingSupplyUSDX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kava.validatorvesting.v1beta1.Query/CirculatingSupplyUSDX", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CirculatingSupplyUSDX(ctx, req.(*QueryCirculatingSupplyUSDXRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CirculatingSupplySWP_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryCirculatingSupplySWPRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CirculatingSupplySWP(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kava.validatorvesting.v1beta1.Query/CirculatingSupplySWP", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CirculatingSupplySWP(ctx, req.(*QueryCirculatingSupplySWPRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalSupplyHARD_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalSupplyHARDRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalSupplyHARD(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kava.validatorvesting.v1beta1.Query/TotalSupplyHARD", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalSupplyHARD(ctx, req.(*QueryTotalSupplyHARDRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalSupplyUSDX_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalSupplyUSDXRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalSupplyUSDX(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/kava.validatorvesting.v1beta1.Query/TotalSupplyUSDX", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalSupplyUSDX(ctx, req.(*QueryTotalSupplyUSDXRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "kava.validatorvesting.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CirculatingSupply", + Handler: _Query_CirculatingSupply_Handler, + }, + { + MethodName: "TotalSupply", + Handler: _Query_TotalSupply_Handler, + }, + { + MethodName: "CirculatingSupplyHARD", + Handler: _Query_CirculatingSupplyHARD_Handler, + }, + { + MethodName: "CirculatingSupplyUSDX", + Handler: _Query_CirculatingSupplyUSDX_Handler, + }, + { + MethodName: "CirculatingSupplySWP", + Handler: _Query_CirculatingSupplySWP_Handler, + }, + { + MethodName: "TotalSupplyHARD", + Handler: _Query_TotalSupplyHARD_Handler, + }, + { + MethodName: "TotalSupplyUSDX", + Handler: _Query_TotalSupplyUSDX_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "kava/validatorvesting/v1beta1/query.proto", +} + +func (m *QueryCirculatingSupplyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCirculatingSupplyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryTotalSupplyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalSupplyRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryTotalSupplyResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalSupplyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryCirculatingSupplyHARDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplyHARDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplyHARDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCirculatingSupplyHARDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplyHARDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplyHARDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryCirculatingSupplyUSDXRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplyUSDXRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplyUSDXRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCirculatingSupplyUSDXResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplyUSDXResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplyUSDXResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryCirculatingSupplySWPRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplySWPRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplySWPRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryCirculatingSupplySWPResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryCirculatingSupplySWPResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCirculatingSupplySWPResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryTotalSupplyHARDRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalSupplyHARDRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyHARDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryTotalSupplyHARDResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalSupplyHARDResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyHARDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryTotalSupplyUSDXRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalSupplyUSDXRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyUSDXRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryTotalSupplyUSDXResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryTotalSupplyUSDXResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTotalSupplyUSDXResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Amount.Size() + i -= size + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryCirculatingSupplyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCirculatingSupplyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTotalSupplyRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryTotalSupplyResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryCirculatingSupplyHARDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCirculatingSupplyHARDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryCirculatingSupplyUSDXRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCirculatingSupplyUSDXResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryCirculatingSupplySWPRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryCirculatingSupplySWPResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTotalSupplyHARDRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryTotalSupplyHARDResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryTotalSupplyUSDXRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryTotalSupplyUSDXResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryCirculatingSupplyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCirculatingSupplyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalSupplyRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalSupplyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCirculatingSupplyHARDRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplyHARDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplyHARDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCirculatingSupplyHARDResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplyHARDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplyHARDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCirculatingSupplyUSDXRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplyUSDXRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplyUSDXRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCirculatingSupplyUSDXResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplyUSDXResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplyUSDXResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCirculatingSupplySWPRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplySWPRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplySWPRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryCirculatingSupplySWPResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryCirculatingSupplySWPResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryCirculatingSupplySWPResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyHARDRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalSupplyHARDRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyHARDRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyHARDResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalSupplyHARDResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyHARDResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyUSDXRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalSupplyUSDXRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyUSDXRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryTotalSupplyUSDXResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryTotalSupplyUSDXResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyUSDXResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/validator-vesting/types/query.pb.gw.go b/x/validator-vesting/types/query.pb.gw.go new file mode 100644 index 00000000..4b9c0d4f --- /dev/null +++ b/x/validator-vesting/types/query.pb.gw.go @@ -0,0 +1,543 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: kava/validatorvesting/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_CirculatingSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplyRequest + var metadata runtime.ServerMetadata + + msg, err := client.CirculatingSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CirculatingSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplyRequest + var metadata runtime.ServerMetadata + + msg, err := server.CirculatingSupply(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyRequest + var metadata runtime.ServerMetadata + + msg, err := client.TotalSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyRequest + var metadata runtime.ServerMetadata + + msg, err := server.TotalSupply(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_CirculatingSupplyHARD_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplyHARDRequest + var metadata runtime.ServerMetadata + + msg, err := client.CirculatingSupplyHARD(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CirculatingSupplyHARD_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplyHARDRequest + var metadata runtime.ServerMetadata + + msg, err := server.CirculatingSupplyHARD(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_CirculatingSupplyUSDX_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplyUSDXRequest + var metadata runtime.ServerMetadata + + msg, err := client.CirculatingSupplyUSDX(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CirculatingSupplyUSDX_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplyUSDXRequest + var metadata runtime.ServerMetadata + + msg, err := server.CirculatingSupplyUSDX(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_CirculatingSupplySWP_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplySWPRequest + var metadata runtime.ServerMetadata + + msg, err := client.CirculatingSupplySWP(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CirculatingSupplySWP_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryCirculatingSupplySWPRequest + var metadata runtime.ServerMetadata + + msg, err := server.CirculatingSupplySWP(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_TotalSupplyHARD_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyHARDRequest + var metadata runtime.ServerMetadata + + msg, err := client.TotalSupplyHARD(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalSupplyHARD_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyHARDRequest + var metadata runtime.ServerMetadata + + msg, err := server.TotalSupplyHARD(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_TotalSupplyUSDX_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyUSDXRequest + var metadata runtime.ServerMetadata + + msg, err := client.TotalSupplyUSDX(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalSupplyUSDX_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyUSDXRequest + var metadata runtime.ServerMetadata + + msg, err := server.TotalSupplyUSDX(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_CirculatingSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CirculatingSupply_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalSupply_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CirculatingSupplyHARD_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CirculatingSupplyHARD_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupplyHARD_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CirculatingSupplyUSDX_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CirculatingSupplyUSDX_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupplyUSDX_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CirculatingSupplySWP_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CirculatingSupplySWP_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupplySWP_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupplyHARD_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalSupplyHARD_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupplyHARD_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupplyUSDX_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalSupplyUSDX_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupplyUSDX_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_CirculatingSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CirculatingSupply_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TotalSupply_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupply_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CirculatingSupplyHARD_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CirculatingSupplyHARD_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupplyHARD_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CirculatingSupplyUSDX_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CirculatingSupplyUSDX_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupplyUSDX_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CirculatingSupplySWP_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CirculatingSupplySWP_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CirculatingSupplySWP_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupplyHARD_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TotalSupplyHARD_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupplyHARD_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_TotalSupplyUSDX_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_TotalSupplyUSDX_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalSupplyUSDX_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_CirculatingSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kava", "validator-vesting", "v1beta1", "circulating_supply"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TotalSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kava", "validator-vesting", "v1beta1", "total_supply"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_CirculatingSupplyHARD_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kava", "validator-vesting", "v1beta1", "circulating_supply_hard"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_CirculatingSupplyUSDX_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kava", "validator-vesting", "v1beta1", "circulating_supply_usdx"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_CirculatingSupplySWP_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kava", "validator-vesting", "v1beta1", "circulating_supply_swp"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TotalSupplyHARD_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kava", "validator-vesting", "v1beta1", "total_supply_hard"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TotalSupplyUSDX_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"kava", "validator-vesting", "v1beta1", "total_supply_usdx"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_CirculatingSupply_0 = runtime.ForwardResponseMessage + + forward_Query_TotalSupply_0 = runtime.ForwardResponseMessage + + forward_Query_CirculatingSupplyHARD_0 = runtime.ForwardResponseMessage + + forward_Query_CirculatingSupplyUSDX_0 = runtime.ForwardResponseMessage + + forward_Query_CirculatingSupplySWP_0 = runtime.ForwardResponseMessage + + forward_Query_TotalSupplyHARD_0 = runtime.ForwardResponseMessage + + forward_Query_TotalSupplyUSDX_0 = runtime.ForwardResponseMessage +)