From 99c5230fad0ca2ede83835cb9ee44f013b2d33ef Mon Sep 17 00:00:00 2001 From: Sai Kumar <17549398+gsk967@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:07:33 +0530 Subject: [PATCH] fix: query account balance by ibc denom (#10394) ## Description Closes: #10381 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 2 + docs/core/proto-docs.md | 2 +- proto/cosmos/bank/v1beta1/query.proto | 12 +-- x/bank/client/testutil/grpc.go | 4 +- x/bank/types/query.pb.go | 122 +++++++++++++------------- x/bank/types/query.pb.gw.go | 30 +++---- 6 files changed, 85 insertions(+), 87 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6565b5cdd74d..01d2f6be17d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -154,6 +154,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/upgrade) [\#10189](https://github.com/cosmos/cosmos-sdk/issues/10189) Removed potential sources of non-determinism in upgrades * [\#10258](https://github.com/cosmos/cosmos-sdk/issues/10258) Fixes issue related to segmentaiton fault on mac m1 arm64 * [\#10466](https://github.com/cosmos/cosmos-sdk/issues/10466) Fixes error with simulation tests when genesis start time is randomly created after the year 2262 +* [\#10394](https://github.com/cosmos/cosmos-sdk/issues/10394) Fixes issue related to grpc-gateway of account balance by + ibc-denom. ### State Machine Breaking diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 7c23a5c4082d..4fb7c12d4524 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -2291,7 +2291,7 @@ Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Balance` | [QueryBalanceRequest](#cosmos.bank.v1beta1.QueryBalanceRequest) | [QueryBalanceResponse](#cosmos.bank.v1beta1.QueryBalanceResponse) | Balance queries the balance of a single coin for a single account. | GET|/cosmos/bank/v1beta1/balances/{address}/{denom}| +| `Balance` | [QueryBalanceRequest](#cosmos.bank.v1beta1.QueryBalanceRequest) | [QueryBalanceResponse](#cosmos.bank.v1beta1.QueryBalanceResponse) | Balance queries the balance of a single coin for a single account. | GET|/cosmos/bank/v1beta1/balances/{address}/by_denom| | `AllBalances` | [QueryAllBalancesRequest](#cosmos.bank.v1beta1.QueryAllBalancesRequest) | [QueryAllBalancesResponse](#cosmos.bank.v1beta1.QueryAllBalancesResponse) | AllBalances queries the balance of all coins for a single account. | GET|/cosmos/bank/v1beta1/balances/{address}| | `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}| diff --git a/proto/cosmos/bank/v1beta1/query.proto b/proto/cosmos/bank/v1beta1/query.proto index bfe4ebaa819c..bc7325e2bb9d 100644 --- a/proto/cosmos/bank/v1beta1/query.proto +++ b/proto/cosmos/bank/v1beta1/query.proto @@ -14,7 +14,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; service Query { // Balance queries the balance of a single coin for a single account. rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/{denom}"; + option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; } // AllBalances queries the balance of all coins for a single account. @@ -57,7 +57,7 @@ service Query { // QueryBalanceRequest is the request type for the Query/Balance RPC method. message QueryBalanceRequest { - option (gogoproto.equal) = false; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // address is the address to query balances for. @@ -75,7 +75,7 @@ message QueryBalanceResponse { // QueryBalanceRequest is the request type for the Query/AllBalances RPC method. message QueryAllBalancesRequest { - option (gogoproto.equal) = false; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // address is the address to query balances for. @@ -90,7 +90,7 @@ message QueryAllBalancesRequest { message QueryAllBalancesResponse { // balances is the balances of all the coins. repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; @@ -99,7 +99,7 @@ message QueryAllBalancesResponse { // QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC // method. message QueryTotalSupplyRequest { - option (gogoproto.equal) = false; + option (gogoproto.equal) = false; option (gogoproto.goproto_getters) = false; // pagination defines an optional pagination for the request. @@ -113,7 +113,7 @@ message QueryTotalSupplyRequest { message QueryTotalSupplyResponse { // supply is the supply of the coins repeated cosmos.base.v1beta1.Coin supply = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; // pagination defines the pagination in the response. // diff --git a/x/bank/client/testutil/grpc.go b/x/bank/client/testutil/grpc.go index cebaa32388bd..f6088d8f6ccc 100644 --- a/x/bank/client/testutil/grpc.go +++ b/x/bank/client/testutil/grpc.go @@ -250,7 +250,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() { }, { "gPRC account balance of a denom", - fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/%s", baseURL, val.Address.String(), s.cfg.BondDenom), + fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/by_denom?denom=%s", baseURL, val.Address.String(), s.cfg.BondDenom), &types.QueryBalanceResponse{}, &types.QueryBalanceResponse{ Balance: &sdk.Coin{ @@ -261,7 +261,7 @@ func (s *IntegrationTestSuite) TestBalancesGRPCHandler() { }, { "gPRC account balance of a bogus denom", - fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/foobar", baseURL, val.Address.String()), + fmt.Sprintf("%s/cosmos/bank/v1beta1/balances/%s/by_denom?denom=foobar", baseURL, val.Address.String()), &types.QueryBalanceResponse{}, &types.QueryBalanceResponse{ Balance: &sdk.Coin{ diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 637218150c0e..feca926ef839 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -877,67 +877,67 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } var fileDescriptor_9c6fc1939682df13 = []byte{ - // 949 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x04, 0xea, 0x24, 0xcf, 0xc0, 0x61, 0x6a, 0x44, 0xb2, 0xa1, 0x36, 0xda, 0x42, 0x93, - 0xb4, 0xc9, 0x6e, 0xed, 0x22, 0x55, 0xe5, 0x82, 0xe2, 0x22, 0x38, 0x20, 0x54, 0xb3, 0xe5, 0x84, - 0x84, 0xa2, 0xb1, 0xbd, 0x2c, 0xab, 0xd8, 0x3b, 0x5b, 0xcf, 0x9a, 0x12, 0x45, 0x95, 0x10, 0x27, - 0x4e, 0x80, 0xc4, 0x81, 0x03, 0x42, 0x94, 0x0b, 0x08, 0xce, 0xfc, 0x11, 0x39, 0x70, 0xa8, 0xca, - 0x85, 0x13, 0xa0, 0x84, 0x03, 0x7f, 0x06, 0xf2, 0xcc, 0x9b, 0xf5, 0xae, 0xbd, 0x5e, 0xaf, 0xc0, - 0x9c, 0xbc, 0x3b, 0xf3, 0x7e, 0x7c, 0xdf, 0x37, 0xf3, 0xde, 0x5b, 0x43, 0xbd, 0xcb, 0xc5, 0x80, - 0x0b, 0xbb, 0xc3, 0x82, 0x23, 0xfb, 0xc3, 0x46, 0xc7, 0x8d, 0x58, 0xc3, 0xbe, 0x37, 0x72, 0x87, - 0xc7, 0x56, 0x38, 0xe4, 0x11, 0xa7, 0x17, 0x95, 0x81, 0x35, 0x36, 0xb0, 0xd0, 0xc0, 0xb8, 0x1a, - 0x7b, 0x09, 0x57, 0x59, 0xc7, 0xbe, 0x21, 0xf3, 0xfc, 0x80, 0x45, 0x3e, 0x0f, 0x54, 0x00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74, 0x77, 0x3e, 0x34, 0xec, 0xa4, 0x5a, 0xc3, 0xd6, 0xed, - 0xd3, 0xb3, 0x1a, 0x79, 0x74, 0x56, 0x23, 0x7f, 0x9e, 0xd5, 0xc8, 0x17, 0xe7, 0xb5, 0xd2, 0xa3, - 0xf3, 0x5a, 0xe9, 0xb7, 0xf3, 0x5a, 0xe9, 0xdd, 0xdd, 0xdc, 0xaf, 0xb2, 0x8f, 0x54, 0x6c, 0xf9, - 0x71, 0xd6, 0x29, 0xcb, 0x7f, 0x2b, 0x37, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x11, 0x1b, 0xa0, - 0xde, 0xa0, 0x0d, 0x00, 0x00, + // 953 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xce, 0x14, 0x36, 0x6d, 0x5f, 0x80, 0xc3, 0x6c, 0x10, 0xad, 0xcb, 0x26, 0xc8, 0x0b, 0xdb, + 0x76, 0xb7, 0xb5, 0xdb, 0x2c, 0x12, 0x2c, 0x17, 0xd4, 0x2c, 0x82, 0x03, 0x42, 0x5b, 0xbc, 0x9c, + 0x90, 0x50, 0x35, 0x49, 0x8c, 0xb1, 0x9a, 0x78, 0xbc, 0x19, 0x87, 0x25, 0xaa, 0x56, 0x42, 0x9c, + 0x38, 0x01, 0x12, 0x17, 0x24, 0x84, 0x58, 0x2e, 0x20, 0x38, 0xf3, 0x47, 0xf4, 0xc0, 0x61, 0x45, + 0x2f, 0x9c, 0x00, 0xb5, 0x1c, 0xf8, 0x33, 0x50, 0x66, 0xde, 0x38, 0x76, 0xe2, 0x38, 0x16, 0x84, + 0x53, 0xec, 0x99, 0xf7, 0xe3, 0xfb, 0xbe, 0x99, 0xf7, 0x9e, 0x03, 0xf5, 0x36, 0x17, 0x3d, 0x2e, + 0xec, 0x16, 0x0b, 0x8e, 0xed, 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x23, 0xf0, 0x54, 0x7a, + 0xd4, 0xd0, 0x79, 0x99, 0x27, 0x67, 0x9f, 0xb1, 0x57, 0xdc, 0x01, 0xb1, 0xee, 0x48, 0xac, 0xd7, + 0xe8, 0xf3, 0x45, 0xb0, 0xd2, 0x6f, 0x08, 0x54, 0x12, 0xad, 0x2d, 0xef, 0xca, 0x4f, 0x37, 0xfe, + 0xbc, 0x2b, 0x9f, 0xd1, 0x2f, 0xcd, 0x7d, 0x09, 0xed, 0x06, 0xdd, 0x9e, 0x0d, 0x0d, 0x5b, 0xa9, + 0xd6, 0xb0, 0x79, 0xfb, 0xf4, 0xbc, 0x46, 0x1e, 0x9d, 0xd7, 0xc8, 0x9f, 0xe7, 0x35, 0xf2, 0xc5, + 0x45, 0xad, 0xf4, 0xe8, 0xa2, 0x56, 0xfa, 0xed, 0xa2, 0x56, 0x7a, 0x77, 0x3b, 0xf7, 0xb3, 0xec, + 0x23, 0x15, 0x5b, 0x7e, 0x9d, 0xb5, 0xca, 0xf2, 0xef, 0xca, 0xcd, 0x7f, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x40, 0x2b, 0xe5, 0x20, 0xa1, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 60ebdb975662..c9b15fdda0de 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -31,6 +31,10 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage +var ( + filter_Query_Balance_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryBalanceRequest var metadata runtime.ServerMetadata @@ -53,15 +57,11 @@ func request_Query_Balance_0(ctx context.Context, marshaler runtime.Marshaler, c return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := client.Balance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -91,15 +91,11 @@ func local_request_Query_Balance_0(ctx context.Context, marshaler runtime.Marsha return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) } - val, ok = pathParams["denom"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Denom, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Balance_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } msg, err := server.Balance(ctx, &protoReq) @@ -820,7 +816,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "bank", "v1beta1", "balances", "address", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Balance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "bank", "v1beta1", "balances", "address", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AllBalances_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", "balances", "address"}, "", runtime.AssumeColonVerbOpt(false)))