diff --git a/CHANGELOG.md b/CHANGELOG.md
index a23b3dfd3b0d..7d3ef0891128 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,15 +38,16 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements
+* (x/bank) [\#8302](https://github.com/cosmos/cosmos-sdk/issues/8302) Add gRPC and CLI queries for client denomination metadata.
* (tendermint) [\#8316](https://github.com/cosmos/cosmos-sdk/pull/8316) Bump Tendermint version to [v0.34.2](https://github.com/tendermint/tendermint/releases/tag/v0.34.2)
### Bug Fixes
+* (x/bank) [\#8317](https://github.com/cosmos/cosmos-sdk/pull/8317) Fix panic when querying for a not found client denomination metadata.
* (x/auth) [\#8287](https://github.com/cosmos/cosmos-sdk/pull/8287) Fix `tx sign --signature-only` to return correct sequence value in signature.
* (x/ibc) [\#8341](https://github.com/cosmos/cosmos-sdk/pull/8341) Fix query latest consensus state.
* (types/errors) [\#8355][https://github.com/cosmos/cosmos-sdk/pull/8355] Fix errorWrap `Is` method.
-
## [v0.40.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.0) - 2021-01-08
v0.40.0, known as the Stargate release of the Cosmos SDK, is one of the largest releases
diff --git a/docs/architecture/adr-024-coin-metadata.md b/docs/architecture/adr-024-coin-metadata.md
index 4f266fa0ec8c..5195a9c40008 100644
--- a/docs/architecture/adr-024-coin-metadata.md
+++ b/docs/architecture/adr-024-coin-metadata.md
@@ -34,7 +34,7 @@ UX and remove the requirement for making any assumptions on the unit of denomina
The `x/bank` module will be updated to store and index metadata by `denom`, specifically the "base" or
smallest unit -- the unit the Cosmos SDK state-machine works with.
-Metadata may also include a non-zero length list of denominations. Each entry containts the name of
+Metadata may also include a non-zero length list of denominations. Each entry contains the name of
the denomination `denom`, the exponent to the base and a list of aliases. An entry is to be
interpreted as `1 denom = 10^exponent base_denom` (e.g. `1 ETH = 10^18 wei` and `1 uatom = 10^0 uatom`).
@@ -92,6 +92,7 @@ As an example, the ATOM's metadata can be defined as follows:
```
Given the above metadata, a client may infer the following things:
+
- 4.3atom = 4.3 * (10^6) = 4,300,000uatom
- The string "atom" can be used as a display name in a list of tokens.
- The balance 4300000 can be displayed as 4,300,000uatom or 4,300matom or 4.3atom.
diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md
index e8857f2a784a..d49cf8634bce 100644
--- a/docs/core/proto-docs.md
+++ b/docs/core/proto-docs.md
@@ -48,6 +48,10 @@
- [QueryAllBalancesResponse](#cosmos.bank.v1beta1.QueryAllBalancesResponse)
- [QueryBalanceRequest](#cosmos.bank.v1beta1.QueryBalanceRequest)
- [QueryBalanceResponse](#cosmos.bank.v1beta1.QueryBalanceResponse)
+ - [QueryDenomMetadataRequest](#cosmos.bank.v1beta1.QueryDenomMetadataRequest)
+ - [QueryDenomMetadataResponse](#cosmos.bank.v1beta1.QueryDenomMetadataResponse)
+ - [QueryDenomsMetadataRequest](#cosmos.bank.v1beta1.QueryDenomsMetadataRequest)
+ - [QueryDenomsMetadataResponse](#cosmos.bank.v1beta1.QueryDenomsMetadataResponse)
- [QueryParamsRequest](#cosmos.bank.v1beta1.QueryParamsRequest)
- [QueryParamsResponse](#cosmos.bank.v1beta1.QueryParamsResponse)
- [QuerySupplyOfRequest](#cosmos.bank.v1beta1.QuerySupplyOfRequest)
@@ -1274,6 +1278,69 @@ QueryBalanceResponse is the response type for the Query/Balance RPC method.
+
+
+### QueryDenomMetadataRequest
+QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `denom` | [string](#string) | | denom is the coin denom to query the metadata for. |
+
+
+
+
+
+
+
+
+### QueryDenomMetadataResponse
+QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC
+method.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `metadata` | [Metadata](#cosmos.bank.v1beta1.Metadata) | | metadata describes and provides all the client information for the requested token. |
+
+
+
+
+
+
+
+
+### QueryDenomsMetadataRequest
+QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
+
+
+
+
+
+
+
+
+### QueryDenomsMetadataResponse
+QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC
+method.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `metadatas` | [Metadata](#cosmos.bank.v1beta1.Metadata) | repeated | metadata provides the client information for all the registered tokens. |
+| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
+
+
+
+
+
+
### QueryParamsRequest
@@ -1374,6 +1441,8 @@ Query defines the gRPC querier service.
| `TotalSupply` | [QueryTotalSupplyRequest](#cosmos.bank.v1beta1.QueryTotalSupplyRequest) | [QueryTotalSupplyResponse](#cosmos.bank.v1beta1.QueryTotalSupplyResponse) | TotalSupply queries the total supply of all coins. | GET|/cosmos/bank/v1beta1/supply|
| `SupplyOf` | [QuerySupplyOfRequest](#cosmos.bank.v1beta1.QuerySupplyOfRequest) | [QuerySupplyOfResponse](#cosmos.bank.v1beta1.QuerySupplyOfResponse) | SupplyOf queries the supply of a single coin. | GET|/cosmos/bank/v1beta1/supply/{denom}|
| `Params` | [QueryParamsRequest](#cosmos.bank.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.bank.v1beta1.QueryParamsResponse) | Params queries the parameters of x/bank module. | GET|/cosmos/bank/v1beta1/params|
+| `DenomMetadata` | [QueryDenomMetadataRequest](#cosmos.bank.v1beta1.QueryDenomMetadataRequest) | [QueryDenomMetadataResponse](#cosmos.bank.v1beta1.QueryDenomMetadataResponse) | DenomsMetadata queries the client metadata of a given coin denomination. | GET|/cosmos/bank/v1beta1/denoms_metadata/{denom}|
+| `DenomsMetadata` | [QueryDenomsMetadataRequest](#cosmos.bank.v1beta1.QueryDenomsMetadataRequest) | [QueryDenomsMetadataResponse](#cosmos.bank.v1beta1.QueryDenomsMetadataResponse) | DenomsMetadata queries the client metadata for all registered coin denominations. | GET|/cosmos/bank/v1beta1/denoms_metadata|
diff --git a/go.sum b/go.sum
index 066d94520d06..30275e7ac493 100644
--- a/go.sum
+++ b/go.sum
@@ -544,7 +544,6 @@ github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoH
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@@ -562,7 +561,6 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tendermint/tendermint v0.34.0-rc4/go.mod h1:yotsojf2C1QBOw4dZrTcxbyxmPUrT4hNuOQWX9XUwB4=
github.com/tendermint/tendermint v0.34.0-rc6/go.mod h1:ugzyZO5foutZImv0Iyx/gOFCX6mjJTgbLHTwi17VDVg=
-github.com/tendermint/tendermint v0.34.0 h1:eXCfMgoqVSzrjzOj6clI9GAejcHH0LvOlRjpCmMJksU=
github.com/tendermint/tendermint v0.34.0/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ=
github.com/tendermint/tendermint v0.34.2 h1:bB4xReGw4jalTDeNg0npYoONuZrD55F90LrWPF4m/PQ=
github.com/tendermint/tendermint v0.34.2/go.mod h1:Aj3PIipBFSNO21r+Lq3TtzQ+uKESxkbA3yo/INM4QwQ=
@@ -618,7 +616,6 @@ golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPh
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o=
golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
@@ -797,7 +794,6 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
-google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 h1:Rt0FRalMgdSlXAVJvX4pr65KfqaxHXSLkSJRD9pw6g0=
google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f h1:izedQ6yVIc5mZsRuXzmSreCOlzI0lCU1HpG8yEdMiKw=
google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto
index 8f8cfe126330..bc5e29137a95 100644
--- a/proto/cosmos/bank/v1beta1/query.proto
+++ b/proto/cosmos/bank/v1beta1/query.proto
@@ -35,6 +35,16 @@ service Query {
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/cosmos/bank/v1beta1/params";
}
+
+ // DenomsMetadata queries the client metadata of a given coin denomination.
+ rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}";
+ }
+
+ // DenomsMetadata queries the client metadata for all registered coin denominations.
+ rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) {
+ option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata";
+ }
}
// QueryBalanceRequest is the request type for the Query/Balance RPC method.
@@ -109,3 +119,32 @@ message QueryParamsRequest {}
message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];
}
+
+// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.
+message QueryDenomsMetadataRequest {
+ // pagination defines an optional pagination for the request.
+ cosmos.base.query.v1beta1.PageRequest pagination = 1;
+}
+
+// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC
+// method.
+message QueryDenomsMetadataResponse {
+ // metadata provides the client information for all the registered tokens.
+ repeated Metadata metadatas = 1 [(gogoproto.nullable) = false];
+
+ // pagination defines the pagination in the response.
+ cosmos.base.query.v1beta1.PageResponse pagination = 2;
+}
+
+// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method.
+message QueryDenomMetadataRequest {
+ // denom is the coin denom to query the metadata for.
+ string denom = 1;
+}
+
+// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC
+// method.
+message QueryDenomMetadataResponse {
+ // metadata describes and provides all the client information for the requested token.
+ Metadata metadata = 1 [(gogoproto.nullable) = false];
+}
diff --git a/x/bank/client/cli/cli_test.go b/x/bank/client/cli/cli_test.go
index a8e94d24569f..952390fe774b 100644
--- a/x/bank/client/cli/cli_test.go
+++ b/x/bank/client/cli/cli_test.go
@@ -32,12 +32,57 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite")
cfg := network.DefaultConfig()
+ genesisState := cfg.GenesisState
cfg.NumValidators = 1
+ var bankGenesis types.GenesisState
+ s.Require().NoError(cfg.Codec.UnmarshalJSON(genesisState[types.ModuleName], &bankGenesis))
+
+ bankGenesis.DenomMetadata = []types.Metadata{
+ {
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ },
+ {
+ Description: "Ethereum mainnet token",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "wei",
+ Exponent: 0,
+ },
+ {
+ Denom: "eth",
+ Exponent: 6,
+ Aliases: []string{"ETH"},
+ },
+ },
+ Base: "wei",
+ Display: "eth",
+ },
+ }
+
+ bankGenesisBz, err := cfg.Codec.MarshalJSON(&bankGenesis)
+ s.Require().NoError(err)
+ genesisState[types.ModuleName] = bankGenesisBz
+ cfg.GenesisState = genesisState
+
s.cfg = cfg
s.network = network.New(s.T(), cfg)
- _, err := s.network.WaitForHeight(1)
+ _, err = s.network.WaitForHeight(1)
s.Require().NoError(err)
}
@@ -181,6 +226,127 @@ func (s *IntegrationTestSuite) TestGetCmdQueryTotalSupply() {
}
}
+func (s *IntegrationTestSuite) TestGetCmdQueryDenomsMetadata() {
+ val := s.network.Validators[0]
+
+ testCases := []struct {
+ name string
+ args []string
+ expectErr bool
+ respType proto.Message
+ expected proto.Message
+ }{
+ {
+ name: "all denoms client metadata",
+ args: []string{
+ fmt.Sprintf("--%s=1", flags.FlagHeight),
+ fmt.Sprintf("--%s=json", tmcli.OutputFlag),
+ },
+ respType: &types.QueryDenomsMetadataResponse{},
+ expected: &types.QueryDenomsMetadataResponse{
+ Metadatas: []types.Metadata{
+ {
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ },
+ {
+ Description: "Ethereum mainnet token",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "wei",
+ Exponent: 0,
+ Aliases: []string{},
+ },
+ {
+ Denom: "eth",
+ Exponent: 6,
+ Aliases: []string{"ETH"},
+ },
+ },
+ Base: "wei",
+ Display: "eth",
+ },
+ },
+ Pagination: &query.PageResponse{Total: 2},
+ },
+ },
+ {
+ name: "client metadata of a specific denomination",
+ args: []string{
+ fmt.Sprintf("--%s=1", flags.FlagHeight),
+ fmt.Sprintf("--%s=%s", cli.FlagDenom, "uatom"),
+ fmt.Sprintf("--%s=json", tmcli.OutputFlag),
+ },
+ respType: &types.QueryDenomMetadataResponse{},
+ expected: &types.QueryDenomMetadataResponse{
+ Metadata: types.Metadata{
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ },
+ },
+ },
+ {
+ name: "client metadata of a bogus denom",
+ args: []string{
+ fmt.Sprintf("--%s=1", flags.FlagHeight),
+ fmt.Sprintf("--%s=foobar", cli.FlagDenom),
+ fmt.Sprintf("--%s=json", tmcli.OutputFlag),
+ },
+ expectErr: true,
+ respType: &types.QueryDenomMetadataResponse{},
+ expected: &types.QueryDenomMetadataResponse{
+ Metadata: types.Metadata{
+ DenomUnits: []*types.DenomUnit{},
+ },
+ },
+ },
+ }
+
+ for _, tc := range testCases {
+ tc := tc
+
+ s.Run(tc.name, func() {
+ cmd := cli.GetCmdDenomsMetadata()
+ clientCtx := val.ClientCtx
+
+ out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
+ if tc.expectErr {
+ s.Require().Error(err)
+ } else {
+ s.Require().NoError(err)
+ s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), tc.respType))
+ s.Require().Equal(tc.expected, tc.respType)
+ }
+ })
+ }
+}
+
func (s *IntegrationTestSuite) TestNewSendTxCmdGenOnly() {
val := s.network.Validators[0]
diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go
index 38badd7332d0..fbb9ba43825d 100644
--- a/x/bank/client/cli/query.go
+++ b/x/bank/client/cli/query.go
@@ -1,7 +1,6 @@
package cli
import (
- "context"
"fmt"
"strings"
@@ -33,6 +32,7 @@ func GetQueryCmd() *cobra.Command {
cmd.AddCommand(
GetBalancesCmd(),
GetCmdQueryTotalSupply(),
+ GetCmdDenomsMetadata(),
)
return cmd
@@ -78,7 +78,7 @@ Example:
if denom == "" {
params := types.NewQueryAllBalancesRequest(addr, pageReq)
- res, err := queryClient.AllBalances(context.Background(), params)
+ res, err := queryClient.AllBalances(cmd.Context(), params)
if err != nil {
return err
}
@@ -86,7 +86,7 @@ Example:
}
params := types.NewQueryBalanceRequest(addr, denom)
- res, err := queryClient.Balance(context.Background(), params)
+ res, err := queryClient.Balance(cmd.Context(), params)
if err != nil {
return err
}
@@ -102,6 +102,60 @@ Example:
return cmd
}
+// GetCmdDenomsMetadata defines the cobra command to query client denomination metadata.
+func GetCmdDenomsMetadata() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "denom-metadata",
+ Short: "Query the client metadata for coin denominations",
+ Long: strings.TrimSpace(
+ fmt.Sprintf(`Query the client metadata for all the registered coin denominations
+
+Example:
+ To query for the client metadata of all coin denominations use:
+ $ %s query %s denom-metadata
+
+To query for the client metadata of a specific coin denomination use:
+ $ %s query %s denom-metadata --denom=[denom]
+`,
+ version.AppName, types.ModuleName, version.AppName, types.ModuleName,
+ ),
+ ),
+ RunE: func(cmd *cobra.Command, _ []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+ denom, err := cmd.Flags().GetString(FlagDenom)
+ if err != nil {
+ return err
+ }
+
+ queryClient := types.NewQueryClient(clientCtx)
+
+ if denom == "" {
+ res, err := queryClient.DenomsMetadata(cmd.Context(), &types.QueryDenomsMetadataRequest{})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ }
+
+ res, err := queryClient.DenomMetadata(cmd.Context(), &types.QueryDenomMetadataRequest{Denom: denom})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ cmd.Flags().String(FlagDenom, "", "The specific denomination to query client metadata for")
+ flags.AddQueryFlagsToCmd(cmd)
+
+ return cmd
+}
+
func GetCmdQueryTotalSupply() *cobra.Command {
cmd := &cobra.Command{
Use: "total",
@@ -131,7 +185,7 @@ To query for the total supply of a specific coin denomination use:
queryClient := types.NewQueryClient(clientCtx)
if denom == "" {
- res, err := queryClient.TotalSupply(context.Background(), &types.QueryTotalSupplyRequest{})
+ res, err := queryClient.TotalSupply(cmd.Context(), &types.QueryTotalSupplyRequest{})
if err != nil {
return err
}
@@ -139,7 +193,7 @@ To query for the total supply of a specific coin denomination use:
return clientCtx.PrintProto(res)
}
- res, err := queryClient.SupplyOf(context.Background(), &types.QuerySupplyOfRequest{Denom: denom})
+ res, err := queryClient.SupplyOf(cmd.Context(), &types.QuerySupplyOfRequest{Denom: denom})
if err != nil {
return err
}
diff --git a/x/bank/client/rest/grpc_query_test.go b/x/bank/client/rest/grpc_query_test.go
index 6274946705ae..d6290a1fef94 100644
--- a/x/bank/client/rest/grpc_query_test.go
+++ b/x/bank/client/rest/grpc_query_test.go
@@ -98,6 +98,109 @@ func (s *IntegrationTestSuite) TestTotalSupplyGRPCHandler() {
}
}
+func (s *IntegrationTestSuite) TestDenomMetadataGRPCHandler() {
+ val := s.network.Validators[0]
+ baseURL := val.APIAddress
+
+ testCases := []struct {
+ name string
+ url string
+ headers map[string]string
+ expErr bool
+ respType proto.Message
+ expected proto.Message
+ }{
+ {
+ "test GRPC client metadata",
+ fmt.Sprintf("%s/cosmos/bank/v1beta1/denoms_metadata", baseURL),
+ map[string]string{
+ grpctypes.GRPCBlockHeightHeader: "1",
+ },
+ false,
+ &types.QueryDenomsMetadataResponse{},
+ &types.QueryDenomsMetadataResponse{
+ Metadatas: []types.Metadata{
+ {
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ },
+ },
+ Pagination: &query.PageResponse{Total: 1},
+ },
+ },
+ {
+ "GRPC client metadata of a specific denom",
+ fmt.Sprintf("%s/cosmos/bank/v1beta1/denoms_metadata/uatom", baseURL),
+ map[string]string{
+ grpctypes.GRPCBlockHeightHeader: "1",
+ },
+ false,
+ &types.QueryDenomMetadataResponse{},
+ &types.QueryDenomMetadataResponse{
+ Metadata: types.Metadata{
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ },
+ },
+ },
+ {
+ "GRPC client metadata of a bogus denom",
+ fmt.Sprintf("%s/cosmos/bank/v1beta1/denoms_metadata/foobar", baseURL),
+ map[string]string{
+ grpctypes.GRPCBlockHeightHeader: "1",
+ },
+ true,
+ &types.QueryDenomMetadataResponse{},
+ &types.QueryDenomMetadataResponse{
+ Metadata: types.Metadata{
+ DenomUnits: []*types.DenomUnit{},
+ },
+ },
+ },
+ }
+
+ for _, tc := range testCases {
+ tc := tc
+ s.Run(tc.name, func() {
+ resp, err := testutil.GetRequestWithHeaders(tc.url, tc.headers)
+ s.Require().NoError(err)
+
+ if tc.expErr {
+ s.Require().Error(val.ClientCtx.JSONMarshaler.UnmarshalJSON(resp, tc.respType))
+ } else {
+ s.Require().NoError(val.ClientCtx.JSONMarshaler.UnmarshalJSON(resp, tc.respType))
+ s.Require().Equal(tc.expected.String(), tc.respType.String())
+ }
+ })
+ }
+}
+
func (s *IntegrationTestSuite) TestBalancesGRPCHandler() {
val := s.network.Validators[0]
baseURL := val.APIAddress
diff --git a/x/bank/client/rest/query_test.go b/x/bank/client/rest/query_test.go
index 5ca3a15be506..11d731b6dcba 100644
--- a/x/bank/client/rest/query_test.go
+++ b/x/bank/client/rest/query_test.go
@@ -11,6 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/network"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/rest"
+ "github.com/cosmos/cosmos-sdk/x/bank/types"
)
type IntegrationTestSuite struct {
@@ -24,12 +25,41 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite")
cfg := network.DefaultConfig()
+ genesisState := cfg.GenesisState
cfg.NumValidators = 1
+ var bankGenesis types.GenesisState
+ s.Require().NoError(cfg.Codec.UnmarshalJSON(genesisState[types.ModuleName], &bankGenesis))
+
+ bankGenesis.DenomMetadata = []types.Metadata{
+ {
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ },
+ }
+
+ bankGenesisBz, err := cfg.Codec.MarshalJSON(&bankGenesis)
+ s.Require().NoError(err)
+ genesisState[types.ModuleName] = bankGenesisBz
+ cfg.GenesisState = genesisState
+
s.cfg = cfg
s.network = network.New(s.T(), cfg)
- _, err := s.network.WaitForHeight(2)
+ _, err = s.network.WaitForHeight(2)
s.Require().NoError(err)
}
diff --git a/x/bank/keeper/genesis_test.go b/x/bank/keeper/genesis_test.go
index bdb8cdc304e1..0e66da54e94d 100644
--- a/x/bank/keeper/genesis_test.go
+++ b/x/bank/keeper/genesis_test.go
@@ -44,13 +44,13 @@ func (suite *IntegrationTestSuite) getTestBalances() []types.Balance {
}
func (suite *IntegrationTestSuite) TestInitGenesis() {
- require := suite.Require()
m := types.Metadata{Description: sdk.DefaultBondDenom, Base: sdk.DefaultBondDenom, Display: sdk.DefaultBondDenom}
g := types.DefaultGenesisState()
g.DenomMetadata = []types.Metadata{m}
bk := suite.app.BankKeeper
bk.InitGenesis(suite.ctx, g)
- m2 := bk.GetDenomMetaData(suite.ctx, m.Base)
- require.Equal(m, m2)
+ m2, found := bk.GetDenomMetaData(suite.ctx, m.Base)
+ suite.Require().True(found)
+ suite.Require().Equal(m, m2)
}
diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go
index bcf143b8aa14..ae00d1b8734a 100644
--- a/x/bank/keeper/grpc_query.go
+++ b/x/bank/keeper/grpc_query.go
@@ -61,7 +61,7 @@ func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalances
balancesStore := prefix.NewStore(store, types.BalancesPrefix)
accountStore := prefix.NewStore(balancesStore, addr.Bytes())
- pageRes, err := query.Paginate(accountStore, req.Pagination, func(key []byte, value []byte) error {
+ pageRes, err := query.Paginate(accountStore, req.Pagination, func(_, value []byte) error {
var result sdk.Coin
err := k.cdc.UnmarshalBinaryBare(value, &result)
if err != nil {
@@ -113,3 +113,53 @@ func (k BaseKeeper) Params(ctx context.Context, req *types.QueryParamsRequest) (
return &types.QueryParamsResponse{Params: params}, nil
}
+
+// DenomsMetadata implements Query/DenomsMetadata gRPC method.
+func (k BaseKeeper) DenomsMetadata(c context.Context, req *types.QueryDenomsMetadataRequest) (*types.QueryDenomsMetadataResponse, error) {
+ if req == nil {
+ return nil, status.Errorf(codes.InvalidArgument, "empty request")
+ }
+
+ ctx := sdk.UnwrapSDKContext(c)
+ store := prefix.NewStore(ctx.KVStore(k.storeKey), types.DenomMetadataPrefix)
+
+ metadatas := []types.Metadata{}
+ pageRes, err := query.Paginate(store, req.Pagination, func(_, value []byte) error {
+ var metadata types.Metadata
+ k.cdc.MustUnmarshalBinaryBare(value, &metadata)
+
+ metadatas = append(metadatas, metadata)
+ return nil
+ })
+
+ if err != nil {
+ return nil, status.Error(codes.Internal, err.Error())
+ }
+
+ return &types.QueryDenomsMetadataResponse{
+ Metadatas: metadatas,
+ Pagination: pageRes,
+ }, nil
+}
+
+// DenomMetadata implements Query/DenomMetadata gRPC method.
+func (k BaseKeeper) DenomMetadata(c context.Context, req *types.QueryDenomMetadataRequest) (*types.QueryDenomMetadataResponse, error) {
+ if req == nil {
+ return nil, status.Errorf(codes.InvalidArgument, "empty request")
+ }
+
+ if req.Denom == "" {
+ return nil, status.Error(codes.InvalidArgument, "invalid denom")
+ }
+
+ ctx := sdk.UnwrapSDKContext(c)
+
+ metadata, found := k.GetDenomMetaData(ctx, req.Denom)
+ if !found {
+ return nil, status.Errorf(codes.NotFound, "client metadata for denom %s", req.Denom)
+ }
+
+ return &types.QueryDenomMetadataResponse{
+ Metadata: metadata,
+ }, nil
+}
diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go
index 27c29fd9e730..e178f1301751 100644
--- a/x/bank/keeper/grpc_query_test.go
+++ b/x/bank/keeper/grpc_query_test.go
@@ -4,6 +4,7 @@ package keeper_test
import (
gocontext "context"
+ "fmt"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -119,3 +120,182 @@ func (suite *IntegrationTestSuite) TestQueryParams() {
suite.Require().NotNil(res)
suite.Require().Equal(suite.app.BankKeeper.GetParams(suite.ctx), res.GetParams())
}
+
+func (suite *IntegrationTestSuite) QueryDenomsMetadataRequest() {
+ var (
+ req *types.QueryDenomsMetadataRequest
+ expMetadata = []types.Metadata{}
+ )
+
+ testCases := []struct {
+ msg string
+ malleate func()
+ expPass bool
+ }{
+ {
+ "empty pagination",
+ func() {
+ req = &types.QueryDenomsMetadataRequest{}
+ },
+ true,
+ },
+ {
+ "success, no results",
+ func() {
+ req = &types.QueryDenomsMetadataRequest{
+ Pagination: &query.PageRequest{
+ Limit: 3,
+ CountTotal: true,
+ },
+ }
+ },
+ true,
+ },
+ {
+ "success",
+ func() {
+ metadataAtom := types.Metadata{
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ }
+
+ metadataEth := types.Metadata{
+ Description: "Ethereum native token",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "wei",
+ Exponent: 0,
+ },
+ {
+ Denom: "eth",
+ Exponent: 18,
+ Aliases: []string{"ETH", "ether"},
+ },
+ },
+ Base: "wei",
+ Display: "eth",
+ }
+
+ suite.app.BankKeeper.SetDenomMetaData(suite.ctx, metadataAtom)
+ suite.app.BankKeeper.SetDenomMetaData(suite.ctx, metadataEth)
+ expMetadata = []types.Metadata{metadataAtom, metadataEth}
+ req = &types.QueryDenomsMetadataRequest{
+ Pagination: &query.PageRequest{
+ Limit: 7,
+ CountTotal: true,
+ },
+ }
+ },
+ true,
+ },
+ }
+
+ for _, tc := range testCases {
+ suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
+ suite.SetupTest() // reset
+
+ tc.malleate()
+ ctx := sdk.WrapSDKContext(suite.ctx)
+
+ res, err := suite.queryClient.DenomsMetadata(ctx, req)
+
+ if tc.expPass {
+ suite.Require().NoError(err)
+ suite.Require().NotNil(res)
+ suite.Require().Equal(expMetadata, res.Metadatas)
+ } else {
+ suite.Require().Error(err)
+ }
+ })
+ }
+}
+
+func (suite *IntegrationTestSuite) QueryDenomMetadataRequest() {
+ var (
+ req *types.QueryDenomMetadataRequest
+ expMetadata = types.Metadata{}
+ )
+
+ testCases := []struct {
+ msg string
+ malleate func()
+ expPass bool
+ }{
+ {
+ "empty denom",
+ func() {
+ req = &types.QueryDenomMetadataRequest{}
+ },
+ false,
+ },
+ {
+ "not found denom",
+ func() {
+ req = &types.QueryDenomMetadataRequest{
+ Denom: "foo",
+ }
+ },
+ false,
+ },
+ {
+ "success",
+ func() {
+ expMetadata := types.Metadata{
+ Description: "The native staking token of the Cosmos Hub.",
+ DenomUnits: []*types.DenomUnit{
+ {
+ Denom: "uatom",
+ Exponent: 0,
+ Aliases: []string{"microatom"},
+ },
+ {
+ Denom: "atom",
+ Exponent: 6,
+ Aliases: []string{"ATOM"},
+ },
+ },
+ Base: "uatom",
+ Display: "atom",
+ }
+
+ suite.app.BankKeeper.SetDenomMetaData(suite.ctx, expMetadata)
+ req = &types.QueryDenomMetadataRequest{
+ Denom: expMetadata.Base,
+ }
+ },
+ true,
+ },
+ }
+
+ for _, tc := range testCases {
+ suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
+ suite.SetupTest() // reset
+
+ tc.malleate()
+ ctx := sdk.WrapSDKContext(suite.ctx)
+
+ res, err := suite.queryClient.DenomMetadata(ctx, req)
+
+ if tc.expPass {
+ suite.Require().NoError(err)
+ suite.Require().NotNil(res)
+ suite.Require().Equal(expMetadata, res.Metadata)
+ } else {
+ suite.Require().Error(err)
+ }
+ })
+ }
+}
diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go
index 016537221f89..e5f221e4e204 100644
--- a/x/bank/keeper/keeper.go
+++ b/x/bank/keeper/keeper.go
@@ -27,7 +27,7 @@ type Keeper interface {
GetSupply(ctx sdk.Context) exported.SupplyI
SetSupply(ctx sdk.Context, supply exported.SupplyI)
- GetDenomMetaData(ctx sdk.Context, denom string) types.Metadata
+ GetDenomMetaData(ctx sdk.Context, denom string) (types.Metadata, bool)
SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata)
IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool)
@@ -180,15 +180,19 @@ func (k BaseKeeper) SetSupply(ctx sdk.Context, supply exported.SupplyI) {
}
// GetDenomMetaData retrieves the denomination metadata
-func (k BaseKeeper) GetDenomMetaData(ctx sdk.Context, denom string) types.Metadata {
+func (k BaseKeeper) GetDenomMetaData(ctx sdk.Context, denom string) (types.Metadata, bool) {
store := ctx.KVStore(k.storeKey)
store = prefix.NewStore(store, types.DenomMetadataKey(denom))
bz := store.Get([]byte(denom))
+ if bz == nil {
+ return types.Metadata{}, false
+ }
+
var metadata types.Metadata
k.cdc.MustUnmarshalBinaryBare(bz, &metadata)
- return metadata
+ return metadata, true
}
// GetAllDenomMetaData retrieves all denominations metadata
diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go
index 2f5c5055d2c8..80b4b070c278 100644
--- a/x/bank/keeper/keeper_test.go
+++ b/x/bank/keeper/keeper_test.go
@@ -981,8 +981,8 @@ func (suite *IntegrationTestSuite) TestSetDenomMetaData() {
app.BankKeeper.SetDenomMetaData(ctx, metadata[i])
}
- actualMetadata := app.BankKeeper.GetDenomMetaData(ctx, metadata[1].Base)
-
+ actualMetadata, found := app.BankKeeper.GetDenomMetaData(ctx, metadata[1].Base)
+ suite.Require().True(found)
suite.Require().Equal(metadata[1].GetBase(), actualMetadata.GetBase())
suite.Require().Equal(metadata[1].GetDisplay(), actualMetadata.GetDisplay())
suite.Require().Equal(metadata[1].GetDescription(), actualMetadata.GetDescription())
diff --git a/x/bank/types/errors.go b/x/bank/types/errors.go
index dce69d0ac6bf..ab88b40e9b1d 100644
--- a/x/bank/types/errors.go
+++ b/x/bank/types/errors.go
@@ -6,8 +6,9 @@ import (
// x/bank module sentinel errors
var (
- ErrNoInputs = sdkerrors.Register(ModuleName, 2, "no inputs to send transaction")
- ErrNoOutputs = sdkerrors.Register(ModuleName, 3, "no outputs to send transaction")
- ErrInputOutputMismatch = sdkerrors.Register(ModuleName, 4, "sum inputs != sum outputs")
- ErrSendDisabled = sdkerrors.Register(ModuleName, 5, "send transactions are disabled")
+ ErrNoInputs = sdkerrors.Register(ModuleName, 2, "no inputs to send transaction")
+ ErrNoOutputs = sdkerrors.Register(ModuleName, 3, "no outputs to send transaction")
+ ErrInputOutputMismatch = sdkerrors.Register(ModuleName, 4, "sum inputs != sum outputs")
+ ErrSendDisabled = sdkerrors.Register(ModuleName, 5, "send transactions are disabled")
+ ErrDenomMetadataNotFound = sdkerrors.Register(ModuleName, 6, "client denom metadata not found")
)
diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go
index 8d07c80787fc..c4bedb0098c5 100644
--- a/x/bank/types/query.pb.go
+++ b/x/bank/types/query.pb.go
@@ -475,6 +475,201 @@ func (m *QueryParamsResponse) GetParams() Params {
return Params{}
}
+// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method.
+type QueryDenomsMetadataRequest struct {
+ // pagination defines an optional pagination for the request.
+ Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
+}
+
+func (m *QueryDenomsMetadataRequest) Reset() { *m = QueryDenomsMetadataRequest{} }
+func (m *QueryDenomsMetadataRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomsMetadataRequest) ProtoMessage() {}
+func (*QueryDenomsMetadataRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9c6fc1939682df13, []int{10}
+}
+func (m *QueryDenomsMetadataRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomsMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomsMetadataRequest.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 *QueryDenomsMetadataRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomsMetadataRequest.Merge(m, src)
+}
+func (m *QueryDenomsMetadataRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomsMetadataRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomsMetadataRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomsMetadataRequest proto.InternalMessageInfo
+
+func (m *QueryDenomsMetadataRequest) GetPagination() *query.PageRequest {
+ if m != nil {
+ return m.Pagination
+ }
+ return nil
+}
+
+// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC
+// method.
+type QueryDenomsMetadataResponse struct {
+ // metadata provides the client information for all the registered tokens.
+ Metadatas []Metadata `protobuf:"bytes,1,rep,name=metadatas,proto3" json:"metadatas"`
+ // pagination defines the pagination in the response.
+ Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
+}
+
+func (m *QueryDenomsMetadataResponse) Reset() { *m = QueryDenomsMetadataResponse{} }
+func (m *QueryDenomsMetadataResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomsMetadataResponse) ProtoMessage() {}
+func (*QueryDenomsMetadataResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9c6fc1939682df13, []int{11}
+}
+func (m *QueryDenomsMetadataResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomsMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomsMetadataResponse.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 *QueryDenomsMetadataResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomsMetadataResponse.Merge(m, src)
+}
+func (m *QueryDenomsMetadataResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomsMetadataResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomsMetadataResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomsMetadataResponse proto.InternalMessageInfo
+
+func (m *QueryDenomsMetadataResponse) GetMetadatas() []Metadata {
+ if m != nil {
+ return m.Metadatas
+ }
+ return nil
+}
+
+func (m *QueryDenomsMetadataResponse) GetPagination() *query.PageResponse {
+ if m != nil {
+ return m.Pagination
+ }
+ return nil
+}
+
+// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method.
+type QueryDenomMetadataRequest struct {
+ // denom is the coin denom to query the metadata for.
+ Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
+}
+
+func (m *QueryDenomMetadataRequest) Reset() { *m = QueryDenomMetadataRequest{} }
+func (m *QueryDenomMetadataRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomMetadataRequest) ProtoMessage() {}
+func (*QueryDenomMetadataRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9c6fc1939682df13, []int{12}
+}
+func (m *QueryDenomMetadataRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomMetadataRequest.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 *QueryDenomMetadataRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomMetadataRequest.Merge(m, src)
+}
+func (m *QueryDenomMetadataRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomMetadataRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomMetadataRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomMetadataRequest proto.InternalMessageInfo
+
+func (m *QueryDenomMetadataRequest) GetDenom() string {
+ if m != nil {
+ return m.Denom
+ }
+ return ""
+}
+
+// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC
+// method.
+type QueryDenomMetadataResponse struct {
+ // metadata describes and provides all the client information for the requested token.
+ Metadata Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata"`
+}
+
+func (m *QueryDenomMetadataResponse) Reset() { *m = QueryDenomMetadataResponse{} }
+func (m *QueryDenomMetadataResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomMetadataResponse) ProtoMessage() {}
+func (*QueryDenomMetadataResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_9c6fc1939682df13, []int{13}
+}
+func (m *QueryDenomMetadataResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomMetadataResponse.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 *QueryDenomMetadataResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomMetadataResponse.Merge(m, src)
+}
+func (m *QueryDenomMetadataResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomMetadataResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomMetadataResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomMetadataResponse proto.InternalMessageInfo
+
+func (m *QueryDenomMetadataResponse) GetMetadata() Metadata {
+ if m != nil {
+ return m.Metadata
+ }
+ return Metadata{}
+}
+
func init() {
proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest")
proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse")
@@ -486,55 +681,68 @@ func init() {
proto.RegisterType((*QuerySupplyOfResponse)(nil), "cosmos.bank.v1beta1.QuerySupplyOfResponse")
proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.bank.v1beta1.QueryParamsRequest")
proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.bank.v1beta1.QueryParamsResponse")
+ proto.RegisterType((*QueryDenomsMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataRequest")
+ proto.RegisterType((*QueryDenomsMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataResponse")
+ proto.RegisterType((*QueryDenomMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataRequest")
+ proto.RegisterType((*QueryDenomMetadataResponse)(nil), "cosmos.bank.v1beta1.QueryDenomMetadataResponse")
}
func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) }
var fileDescriptor_9c6fc1939682df13 = []byte{
- // 675 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x31, 0x6f, 0xd3, 0x40,
- 0x14, 0xf6, 0x15, 0x9a, 0x96, 0xcb, 0x76, 0x0d, 0x22, 0x75, 0xc1, 0x41, 0xae, 0xa0, 0x49, 0x69,
- 0x7d, 0x24, 0x1d, 0x2a, 0xd8, 0x48, 0x25, 0x18, 0x18, 0x1a, 0x0c, 0x13, 0xdb, 0x25, 0x39, 0x8c,
- 0x55, 0xc7, 0xe7, 0xe6, 0x1c, 0x44, 0x54, 0x55, 0x20, 0x24, 0x24, 0x26, 0x40, 0x62, 0x60, 0x60,
- 0xe9, 0xcc, 0x2f, 0xe9, 0xc0, 0x50, 0x89, 0x85, 0x09, 0x50, 0x02, 0x12, 0x3f, 0x03, 0xe5, 0xee,
- 0x6c, 0x9c, 0xc6, 0x75, 0xb2, 0x30, 0xc5, 0xf7, 0xee, 0xbd, 0xef, 0x7d, 0xdf, 0xbb, 0xef, 0x2e,
- 0xb0, 0xd4, 0x62, 0xbc, 0xc3, 0x38, 0x6e, 0x12, 0x7f, 0x0f, 0x3f, 0xab, 0x36, 0x69, 0x48, 0xaa,
- 0x78, 0xbf, 0x47, 0xbb, 0x7d, 0x2b, 0xe8, 0xb2, 0x90, 0xa1, 0x25, 0x99, 0x60, 0x8d, 0x12, 0x2c,
- 0x95, 0xa0, 0xaf, 0xc7, 0x55, 0x9c, 0xca, 0xec, 0xb8, 0x36, 0x20, 0x8e, 0xeb, 0x93, 0xd0, 0x65,
-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0x7d, 0xfd, 0xf5, 0x61, 0xae, 0x8a, 0x30, 0x4e, 0x7f,
- 0x0c, 0xa4, 0xbd, 0xf0, 0x81, 0xba, 0x3f, 0x87, 0xf8, 0x40, 0x0c, 0xf7, 0x10, 0x7d, 0x02, 0x30,
- 0x9f, 0x70, 0x3c, 0xda, 0x38, 0xbb, 0xe7, 0xe4, 0x05, 0xd5, 0x37, 0x67, 0xcc, 0x56, 0x2c, 0xb1,
- 0x60, 0x59, 0x41, 0x6b, 0x33, 0xb2, 0x44, 0xef, 0x00, 0xcc, 0x27, 0x6c, 0x9a, 0xc5, 0x6e, 0xd2,
- 0xe8, 0x59, 0xec, 0x52, 0xbc, 0x6f, 0xae, 0x0a, 0x76, 0x57, 0xd0, 0x4a, 0x2a, 0x3b, 0xe9, 0x5d,
- 0xf4, 0x16, 0xc0, 0xc5, 0xc8, 0x89, 0x28, 0xe3, 0x80, 0x4e, 0x79, 0x5b, 0x5f, 0x9f, 0x25, 0x55,
- 0x11, 0xb9, 0x21, 0x88, 0x5c, 0x43, 0xab, 0x19, 0x44, 0xe2, 0x03, 0x7c, 0x09, 0x60, 0x4e, 0xba,
- 0x0f, 0xad, 0x9d, 0xdd, 0x63, 0xcc, 0xea, 0x7a, 0x79, 0x7a, 0xe2, 0x4c, 0x33, 0x91, 0x3e, 0xaf,
- 0xef, 0x1c, 0x0f, 0x0c, 0x70, 0x32, 0x30, 0xc0, 0xcf, 0x81, 0x01, 0xde, 0x0f, 0x0d, 0xed, 0x64,
- 0x68, 0x68, 0xdf, 0x86, 0x86, 0xf6, 0xb8, 0x92, 0xf9, 0x36, 0x3c, 0x97, 0x68, 0xe2, 0x89, 0x68,
- 0xe6, 0xc4, 0x9f, 0xd5, 0xd6, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0x99, 0x37, 0x9b, 0x84,
- 0x07, 0x00, 0x00,
+ // 824 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0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 0x20, 0xec, 0x7a, 0x6a, 0x66, 0xe4, 0x78, 0xc9, 0xeb, 0x2c, 0xe7, 0x65, 0xe0, 0x7c,
+ 0x28, 0x2f, 0xde, 0x1a, 0x76, 0x5b, 0x5d, 0x44, 0xbf, 0x57, 0xaf, 0x11, 0xfc, 0xdd, 0xed, 0x64,
+ 0x78, 0x58, 0xe5, 0x5e, 0x6b, 0xd5, 0x96, 0xa2, 0x27, 0x48, 0xae, 0x79, 0xce, 0x75, 0x16, 0x9f,
+ 0x8a, 0xc2, 0xb5, 0xb8, 0xbe, 0x7f, 0x98, 0x41, 0x07, 0x87, 0x19, 0xf4, 0xf5, 0x30, 0x83, 0x9e,
+ 0x1f, 0x65, 0x62, 0x07, 0x47, 0x99, 0xd8, 0xa7, 0xa3, 0x4c, 0xec, 0xe6, 0xfc, 0xc0, 0x8f, 0xe1,
+ 0x7d, 0x01, 0xcb, 0xbf, 0x89, 0x95, 0x38, 0xff, 0x77, 0xb6, 0xf2, 0x23, 0x00, 0x00, 0xff, 0xff,
+ 0xb4, 0xd4, 0xb0, 0xfc, 0x75, 0x0a, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -559,6 +767,10 @@ type QueryClient interface {
SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error)
// Params queries the parameters of x/bank module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
+ // DenomsMetadata queries the client metadata of a given coin denomination.
+ DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error)
+ // DenomsMetadata queries the client metadata for all registered coin denominations.
+ DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error)
}
type queryClient struct {
@@ -614,6 +826,24 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil
}
+func (c *queryClient) DenomMetadata(ctx context.Context, in *QueryDenomMetadataRequest, opts ...grpc.CallOption) (*QueryDenomMetadataResponse, error) {
+ out := new(QueryDenomMetadataResponse)
+ err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomMetadata", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *queryClient) DenomsMetadata(ctx context.Context, in *QueryDenomsMetadataRequest, opts ...grpc.CallOption) (*QueryDenomsMetadataResponse, error) {
+ out := new(QueryDenomsMetadataResponse)
+ err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/DenomsMetadata", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// QueryServer is the server API for Query service.
type QueryServer interface {
// Balance queries the balance of a single coin for a single account.
@@ -626,6 +856,10 @@ type QueryServer interface {
SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error)
// Params queries the parameters of x/bank module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
+ // DenomsMetadata queries the client metadata of a given coin denomination.
+ DenomMetadata(context.Context, *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error)
+ // DenomsMetadata queries the client metadata for all registered coin denominations.
+ DenomsMetadata(context.Context, *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error)
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
@@ -647,6 +881,12 @@ func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyO
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
+func (*UnimplementedQueryServer) DenomMetadata(ctx context.Context, req *QueryDenomMetadataRequest) (*QueryDenomMetadataResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DenomMetadata not implemented")
+}
+func (*UnimplementedQueryServer) DenomsMetadata(ctx context.Context, req *QueryDenomsMetadataRequest) (*QueryDenomsMetadataResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DenomsMetadata not implemented")
+}
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
s.RegisterService(&_Query_serviceDesc, srv)
@@ -742,6 +982,42 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler)
}
+func _Query_DenomMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryDenomMetadataRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).DenomMetadata(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmos.bank.v1beta1.Query/DenomMetadata",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).DenomMetadata(ctx, req.(*QueryDenomMetadataRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Query_DenomsMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryDenomsMetadataRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).DenomsMetadata(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmos.bank.v1beta1.Query/DenomsMetadata",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).DenomsMetadata(ctx, req.(*QueryDenomsMetadataRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
var _Query_serviceDesc = grpc.ServiceDesc{
ServiceName: "cosmos.bank.v1beta1.Query",
HandlerType: (*QueryServer)(nil),
@@ -766,6 +1042,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
+ {
+ MethodName: "DenomMetadata",
+ Handler: _Query_DenomMetadata_Handler,
+ },
+ {
+ MethodName: "DenomsMetadata",
+ Handler: _Query_DenomsMetadata_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/bank/v1beta1/query.proto",
@@ -1113,81 +1397,228 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
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 *QueryBalanceRequest) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- l = len(m.Address)
- if l > 0 {
- n += 1 + l + sovQuery(uint64(l))
- }
- l = len(m.Denom)
- if l > 0 {
- n += 1 + l + sovQuery(uint64(l))
+func (m *QueryDenomsMetadataRequest) 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 n
+ return dAtA[:n], nil
}
-func (m *QueryBalanceResponse) Size() (n int) {
- if m == nil {
- return 0
- }
- var l int
- _ = l
- if m.Balance != nil {
- l = m.Balance.Size()
- n += 1 + l + sovQuery(uint64(l))
- }
- return n
+func (m *QueryDenomsMetadataRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
}
-func (m *QueryAllBalancesRequest) Size() (n int) {
- if m == nil {
- return 0
- }
+func (m *QueryDenomsMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- l = len(m.Address)
- if l > 0 {
- n += 1 + l + sovQuery(uint64(l))
- }
if m.Pagination != nil {
- l = m.Pagination.Size()
- n += 1 + l + sovQuery(uint64(l))
+ {
+ size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
}
- return n
+ return len(dAtA) - i, nil
}
-func (m *QueryAllBalancesResponse) Size() (n int) {
- if m == nil {
- return 0
+func (m *QueryDenomsMetadataResponse) 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 *QueryDenomsMetadataResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryDenomsMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
var l int
_ = l
- if len(m.Balances) > 0 {
- for _, e := range m.Balances {
- l = e.Size()
- n += 1 + l + sovQuery(uint64(l))
- }
- }
if m.Pagination != nil {
- l = m.Pagination.Size()
- n += 1 + l + sovQuery(uint64(l))
- }
- return n
+ {
+ size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ if len(m.Metadatas) > 0 {
+ for iNdEx := len(m.Metadatas) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.Metadatas[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryDenomMetadataRequest) 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 *QueryDenomMetadataRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryDenomMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Denom) > 0 {
+ i -= len(m.Denom)
+ copy(dAtA[i:], m.Denom)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryDenomMetadataResponse) 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 *QueryDenomMetadataResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryDenomMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ 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 *QueryBalanceRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Address)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ l = len(m.Denom)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryBalanceResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Balance != nil {
+ l = m.Balance.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryAllBalancesRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Address)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ if m.Pagination != nil {
+ l = m.Pagination.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryAllBalancesResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Balances) > 0 {
+ for _, e := range m.Balances {
+ l = e.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ }
+ if m.Pagination != nil {
+ l = m.Pagination.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
}
func (m *QueryTotalSupplyRequest) Size() (n int) {
@@ -1258,6 +1689,62 @@ func (m *QueryParamsResponse) Size() (n int) {
return n
}
+func (m *QueryDenomsMetadataRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Pagination != nil {
+ l = m.Pagination.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryDenomsMetadataResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Metadatas) > 0 {
+ for _, e := range m.Metadatas {
+ l = e.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ }
+ if m.Pagination != nil {
+ l = m.Pagination.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryDenomMetadataRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Denom)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryDenomMetadataResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.Metadata.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ return n
+}
+
func sovQuery(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -1352,11 +1839,385 @@ func (m *QueryBalanceRequest) Unmarshal(dAtA []byte) error {
if postIndex < 0 {
return ErrInvalidLengthQuery
}
- if postIndex > l {
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Denom = string(dAtA[iNdEx:postIndex])
+ 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 *QueryBalanceResponse) 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: QueryBalanceResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Balance", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Balance == nil {
+ m.Balance = &types.Coin{}
+ }
+ if err := m.Balance.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 *QueryAllBalancesRequest) 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: QueryAllBalancesRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryAllBalancesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Address", 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
+ }
+ m.Address = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Pagination == nil {
+ m.Pagination = &query.PageRequest{}
+ }
+ if err := m.Pagination.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 *QueryAllBalancesResponse) 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: QueryAllBalancesResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryAllBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Balances", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Balances = append(m.Balances, types.Coin{})
+ if err := m.Balances[len(m.Balances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Pagination == nil {
+ m.Pagination = &query.PageResponse{}
+ }
+ if err := m.Pagination.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
}
- m.Denom = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
+ 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:])
@@ -1378,7 +2239,7 @@ func (m *QueryBalanceRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryBalanceResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1401,15 +2262,15 @@ func (m *QueryBalanceResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryBalanceResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryTotalSupplyResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ 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 Balance", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -1436,10 +2297,8 @@ func (m *QueryBalanceResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.Balance == nil {
- m.Balance = &types.Coin{}
- }
- if err := m.Balance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Supply = append(m.Supply, types.Coin{})
+ if err := m.Supply[len(m.Supply)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -1464,7 +2323,7 @@ func (m *QueryBalanceResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryAllBalancesRequest) Unmarshal(dAtA []byte) error {
+func (m *QuerySupplyOfRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1487,15 +2346,15 @@ func (m *QueryAllBalancesRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryAllBalancesRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QuerySupplyOfRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryAllBalancesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QuerySupplyOfRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
@@ -1523,43 +2382,7 @@ func (m *QueryAllBalancesRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Address = string(dAtA[iNdEx:postIndex])
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowQuery
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthQuery
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthQuery
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- if m.Pagination == nil {
- m.Pagination = &query.PageRequest{}
- }
- if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
+ m.Denom = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -1582,7 +2405,7 @@ func (m *QueryAllBalancesRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryAllBalancesResponse) Unmarshal(dAtA []byte) error {
+func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1605,49 +2428,15 @@ func (m *QueryAllBalancesResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryAllBalancesResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QuerySupplyOfResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryAllBalancesResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QuerySupplyOfResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Balances", wireType)
- }
- var msglen int
- for shift := uint(0); ; shift += 7 {
- if shift >= 64 {
- return ErrIntOverflowQuery
- }
- if iNdEx >= l {
- return io.ErrUnexpectedEOF
- }
- b := dAtA[iNdEx]
- iNdEx++
- msglen |= int(b&0x7F) << shift
- if b < 0x80 {
- break
- }
- }
- if msglen < 0 {
- return ErrInvalidLengthQuery
- }
- postIndex := iNdEx + msglen
- if postIndex < 0 {
- return ErrInvalidLengthQuery
- }
- if postIndex > l {
- return io.ErrUnexpectedEOF
- }
- m.Balances = append(m.Balances, types.Coin{})
- if err := m.Balances[len(m.Balances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
- return err
- }
- iNdEx = postIndex
- case 2:
- if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -1674,10 +2463,7 @@ func (m *QueryAllBalancesResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if m.Pagination == nil {
- m.Pagination = &query.PageResponse{}
- }
- if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -1702,7 +2488,7 @@ func (m *QueryAllBalancesResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryTotalSupplyRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1725,10 +2511,10 @@ func (m *QueryTotalSupplyRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryTotalSupplyRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryTotalSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
@@ -1752,7 +2538,7 @@ func (m *QueryTotalSupplyRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1775,15 +2561,15 @@ func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryTotalSupplyResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryTotalSupplyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Supply", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -1810,8 +2596,7 @@ func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Supply = append(m.Supply, types.Coin{})
- if err := m.Supply[len(m.Supply)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -1836,7 +2621,7 @@ func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QuerySupplyOfRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryDenomsMetadataRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1859,17 +2644,17 @@ func (m *QuerySupplyOfRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QuerySupplyOfRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryDenomsMetadataRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QuerySupplyOfRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryDenomsMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
}
- var stringLen uint64
+ var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQuery
@@ -1879,23 +2664,27 @@ func (m *QuerySupplyOfRequest) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
- stringLen |= uint64(b&0x7F) << shift
+ msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
- intStringLen := int(stringLen)
- if intStringLen < 0 {
+ if msglen < 0 {
return ErrInvalidLengthQuery
}
- postIndex := iNdEx + intStringLen
+ postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQuery
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
- m.Denom = string(dAtA[iNdEx:postIndex])
+ if m.Pagination == nil {
+ m.Pagination = &query.PageRequest{}
+ }
+ if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
iNdEx = postIndex
default:
iNdEx = preIndex
@@ -1918,7 +2707,7 @@ func (m *QuerySupplyOfRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryDenomsMetadataResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -1941,15 +2730,15 @@ func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QuerySupplyOfResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryDenomsMetadataResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QuerySupplyOfResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryDenomsMetadataResponse: 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)
+ return fmt.Errorf("proto: wrong wireType = %d for field Metadatas", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -1976,7 +2765,44 @@ func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ m.Metadatas = append(m.Metadatas, Metadata{})
+ if err := m.Metadatas[len(m.Metadatas)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Pagination == nil {
+ m.Pagination = &query.PageResponse{}
+ }
+ if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
@@ -2001,7 +2827,7 @@ func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
+func (m *QueryDenomMetadataRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2024,12 +2850,44 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryDenomMetadataRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryDenomMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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
+ }
+ m.Denom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQuery(dAtA[iNdEx:])
@@ -2051,7 +2909,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
+func (m *QueryDenomMetadataResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
@@ -2074,15 +2932,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
- return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group")
+ return fmt.Errorf("proto: QueryDenomMetadataResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
- return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ return fmt.Errorf("proto: QueryDenomMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
- return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType)
+ return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
@@ -2109,7 +2967,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
- if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go
index b1c6372ab7c1..06c7e2d04aa5 100644
--- a/x/bank/types/query.pb.gw.go
+++ b/x/bank/types/query.pb.gw.go
@@ -269,6 +269,96 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
}
+func request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomMetadataRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["denom"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom")
+ }
+
+ protoReq.Denom, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err)
+ }
+
+ msg, err := client.DenomMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_DenomMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomMetadataRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["denom"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom")
+ }
+
+ protoReq.Denom, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err)
+ }
+
+ msg, err := server.DenomMetadata(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_Query_DenomsMetadata_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomsMetadataRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomsMetadata_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.DenomsMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_DenomsMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomsMetadataRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_DenomsMetadata_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.DenomsMetadata(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.
@@ -375,6 +465,46 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
})
+ mux.Handle("GET", pattern_Query_DenomMetadata_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.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_DenomMetadata_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_DenomMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_DenomsMetadata_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.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_DenomsMetadata_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -516,6 +646,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
})
+ mux.Handle("GET", pattern_Query_DenomMetadata_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_DenomMetadata_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_DenomMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_DenomsMetadata_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_DenomsMetadata_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_DenomsMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -529,6 +699,10 @@ var (
pattern_Query_SupplyOf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "supply", "denom"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(true)))
+
+ pattern_Query_DenomMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata", "denom"}, "", runtime.AssumeColonVerbOpt(true)))
+
+ pattern_Query_DenomsMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "denoms_metadata"}, "", runtime.AssumeColonVerbOpt(true)))
)
var (
@@ -541,4 +715,8 @@ var (
forward_Query_SupplyOf_0 = runtime.ForwardResponseMessage
forward_Query_Params_0 = runtime.ForwardResponseMessage
+
+ forward_Query_DenomMetadata_0 = runtime.ForwardResponseMessage
+
+ forward_Query_DenomsMetadata_0 = runtime.ForwardResponseMessage
)