Skip to content

Commit

Permalink
feat: supply by denom as param (#11170)
Browse files Browse the repository at this point in the history
* change to param

* generate proto and fix tests

* changelog entry

* move changelog
  • Loading branch information
tac0turtle committed Feb 11, 2022
1 parent 5fbd225 commit d98503b
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 152 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [\#9995](https://github.com/cosmos/cosmos-sdk/pull/9995) Increased gas cost for creating proposals.
* [\#11029](https://github.com/cosmos/cosmos-sdk/pull/11029) The deprecated Vote Option field is removed in gov v1beta2 and nil in v1beta1. Use Options instead.
* [\#11013](https://github.com/cosmos/cosmos-sdk/pull/) The `tx gov submit-proposal` command has changed syntax to support the new Msg-based gov proposals. To access the old CLI command, please use `tx gov submit-legacy-proposal`.
* [\#11170](https://github.com/cosmos/cosmos-sdk/issues/11170) Fixes issue related to grpc-gateway of supply by ibc-denom.

### CLI Breaking Changes

Expand Down
112 changes: 56 additions & 56 deletions api/cosmos/bank/v1beta1/query.pulsar.go

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

2 changes: 1 addition & 1 deletion proto/cosmos/bank/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ service Query {

// SupplyOf queries the supply of a single coin.
rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) {
option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}";
option (google.api.http).get = "/cosmos/bank/v1beta1/supply/by_denom";
}

// Params queries the parameters of x/bank module.
Expand Down
8 changes: 4 additions & 4 deletions x/bank/client/testutil/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (s *IntegrationTestSuite) TestTotalSupplyGRPCHandler() {
},
{
"GRPC total supply of a specific denom",
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/%s", baseURL, s.cfg.BondDenom),
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/by_denom?denom=%s", baseURL, s.cfg.BondDenom),
map[string]string{
grpctypes.GRPCBlockHeightHeader: "1",
},
Expand All @@ -54,7 +54,7 @@ func (s *IntegrationTestSuite) TestTotalSupplyGRPCHandler() {
},
{
"Query for `height` > 1",
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/%s", baseURL, s.cfg.BondDenom),
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/by_denom?denom=%s", baseURL, s.cfg.BondDenom),
map[string]string{
grpctypes.GRPCBlockHeightHeader: "2",
},
Expand All @@ -65,7 +65,7 @@ func (s *IntegrationTestSuite) TestTotalSupplyGRPCHandler() {
},
{
"Query params shouldn't be considered as height",
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/%s?height=2", baseURL, s.cfg.BondDenom),
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/by_denom?denom=%s&height=2", baseURL, s.cfg.BondDenom),
map[string]string{
grpctypes.GRPCBlockHeightHeader: "1",
},
Expand All @@ -76,7 +76,7 @@ func (s *IntegrationTestSuite) TestTotalSupplyGRPCHandler() {
},
{
"GRPC total supply of a bogus denom",
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/foobar", baseURL),
fmt.Sprintf("%s/cosmos/bank/v1beta1/supply/by_denom?denom=foobar", baseURL),
map[string]string{
grpctypes.GRPCBlockHeightHeader: "1",
},
Expand Down

0 comments on commit d98503b

Please sign in to comment.