From 3e7e7f48847ac03e389985c93e02b90bd50dd04d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sat, 26 Mar 2022 20:47:01 -0400 Subject: [PATCH] feat: add support for spendable balances gRPC query (backport #11417) (#11459) --- CHANGELOG.md | 1 + x/bank/keeper/grpc_query.go | 36 ++ x/bank/keeper/grpc_query_test.go | 75 +-- x/bank/keeper/keeper_test.go | 16 +- x/bank/types/querier.go | 7 + x/bank/types/query.pb.go | 824 +++++++++++++++++++++++-------- x/bank/types/query.pb.gw.go | 122 ----- 7 files changed, 722 insertions(+), 359 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e447b0f06099..19f6053d8a03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* (x/bank) [\#11417](https://github.com/cosmos/cosmos-sdk/pull/11417) Introduce a new `SpendableBalances` gRPC query that retrieves an account's total (paginated) spendable balances. * (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add safety check on bank module perms to allow module-specific mint restrictions (e.g. only minting a certain denom). * (x/bank) [\#10771](https://github.com/cosmos/cosmos-sdk/pull/10771) Add `bank.BankKeeper.WithMintCoinsRestriction` function to restrict use of bank `MintCoins` usage. This function is not on the bank `Keeper` interface, so it's not API-breaking, but only additive on the keeper implementation. * [\#11124](https://github.com/cosmos/cosmos-sdk/pull/11124) Add `GetAllVersions` to application store diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index c6d499143d83..1dc8d7b0069d 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -134,6 +134,42 @@ func (k BaseKeeper) SpendableBalanceByDenom(ctx context.Context, req *types.Quer return &types.QuerySpendableBalanceByDenomResponse{Balance: &spendable}, nil } +// SpendableBalances implements a gRPC query handler for retrieving an account's +// spendable balances. +func (k BaseKeeper) SpendableBalances(ctx context.Context, req *types.QuerySpendableBalancesRequest) (*types.QuerySpendableBalancesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + addr, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid address: %s", err.Error()) + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + + balances := sdk.NewCoins() + accountStore := k.getAccountStore(sdkCtx, addr) + zeroAmt := sdk.ZeroInt() + + pageRes, err := query.Paginate(accountStore, req.Pagination, func(key, value []byte) error { + balances = append(balances, sdk.NewCoin(string(key), zeroAmt)) + return nil + }) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "paginate: %v", err) + } + + result := sdk.NewCoins() + spendable := k.SpendableCoins(sdkCtx, addr) + + for _, c := range balances { + result = append(result, sdk.NewCoin(c.Denom, spendable.AmountOf(c.Denom))) + } + + return &types.QuerySpendableBalancesResponse{Balances: result, Pagination: pageRes}, nil +} + // TotalSupply implements the Query/TotalSupply gRPC method func (k BaseKeeper) TotalSupply(ctx context.Context, req *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) { totalSupply, pageRes, err := k.GetPaginatedTotalSupply(ctx, req.Pagination) diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index 6de9321d404c..9bd79d0c3b00 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -5,16 +5,15 @@ import ( "fmt" "time" - v1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - "cosmossdk.io/core/header" - "cosmossdk.io/x/bank/testutil" - "cosmossdk.io/x/bank/types" - + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/bank/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) func (suite *KeeperTestSuite) TestQueryBalance() { @@ -231,46 +230,62 @@ func (suite *KeeperTestSuite) TestSpendableBalances() { suite.EqualValues(25, res.Balances[1].Amount.Int64()) } -func (suite *KeeperTestSuite) TestSpendableBalanceByDenom() { +func (suite *IntegrationTestSuite) TestSpendableBalances() { + app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient _, _, addr := testdata.KeyTestPubAddr() + ctx = ctx.WithBlockTime(time.Now()) - ctx := sdk.UnwrapSDKContext(suite.ctx) - ctx = ctx.WithHeaderInfo(header.Info{Time: time.Now()}) - queryClient := suite.mockQueryClient(ctx) - - _, err := queryClient.SpendableBalanceByDenom(ctx, &types.QuerySpendableBalanceByDenomRequest{}) + _, err := queryClient.SpendableBalances(sdk.WrapSDKContext(ctx), &types.QuerySpendableBalancesRequest{}) suite.Require().Error(err) - addrStr, err := suite.authKeeper.AddressCodec().BytesToString(addr) - suite.Require().NoError(err) - - req := types.NewQuerySpendableBalanceByDenomRequest(addrStr, fooDenom) - acc := authtypes.NewBaseAccountWithAddress(addr) + pageReq := &query.PageRequest{ + Key: nil, + Limit: 2, + CountTotal: false, + } + req := types.NewQuerySpendableBalancesRequest(addr, pageReq) - suite.mockSpendableCoins(ctx, acc) - res, err := queryClient.SpendableBalanceByDenom(ctx, req) + res, err := queryClient.SpendableBalances(sdk.WrapSDKContext(ctx), req) suite.Require().NoError(err) suite.Require().NotNil(res) - suite.True(res.Balance.IsZero()) + suite.True(res.Balances.IsZero()) - fooCoins := newFooCoin(100) + fooCoins := newFooCoin(50) barCoins := newBarCoin(30) origCoins := sdk.NewCoins(fooCoins, barCoins) - vacc, err := vestingtypes.NewContinuousVestingAccount( - acc, + acc := app.AccountKeeper.NewAccountWithAddress(ctx, addr) + acc = vestingtypes.NewContinuousVestingAccount( + acc.(*authtypes.BaseAccount), sdk.NewCoins(fooCoins), - ctx.HeaderInfo().Time.Unix(), - ctx.HeaderInfo().Time.Add(time.Hour).Unix(), + ctx.BlockTime().Unix(), + ctx.BlockTime().Add(time.Hour).Unix(), ) - suite.Require().NoError(err) - suite.mockFundAccount(addr) - suite.Require().NoError(testutil.FundAccount(suite.ctx, suite.bankKeeper, addr, origCoins)) + app.AccountKeeper.SetAccount(ctx, acc) + suite.Require().NoError(simapp.FundAccount(app.BankKeeper, ctx, acc.GetAddress(), origCoins)) - // move time forward for half of the tokens to vest - ctx = ctx.WithHeaderInfo(header.Info{Time: ctx.HeaderInfo().Time.Add(30 * time.Minute)}) - queryClient = suite.mockQueryClient(ctx) + // move time forward for some tokens to vest + ctx = ctx.WithBlockTime(ctx.BlockTime().Add(30 * time.Minute)) + queryHelper := baseapp.NewQueryServerTestHelper(ctx, app.InterfaceRegistry()) + types.RegisterQueryServer(queryHelper, app.BankKeeper) + queryClient = types.NewQueryClient(queryHelper) + + res, err = queryClient.SpendableBalances(sdk.WrapSDKContext(ctx), req) + suite.Require().NoError(err) + suite.Require().NotNil(res) + suite.Equal(2, res.Balances.Len()) + suite.Nil(res.Pagination.NextKey) + suite.EqualValues(30, res.Balances[0].Amount.Int64()) + suite.EqualValues(25, res.Balances[1].Amount.Int64()) +} + +func (suite *IntegrationTestSuite) TestQueryTotalSupply() { + app, ctx, queryClient := suite.app, suite.ctx, suite.queryClient + expectedTotalSupply := sdk.NewCoins(sdk.NewInt64Coin("test", 400000000)) + suite. + Require(). + NoError(app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, expectedTotalSupply)) // check fooCoins first, it has some vested and some vesting suite.mockSpendableCoins(ctx, vacc) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 7ff28dd91c2a..97c50b7f4ed7 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -5,7 +5,6 @@ import ( "testing" "time" - "github.com/golang/mock/gomock" "github.com/stretchr/testify/suite" coreevent "cosmossdk.io/core/event" @@ -24,11 +23,14 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/types/query" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported" vesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types" + "github.com/cosmos/cosmos-sdk/x/bank/keeper" + "github.com/cosmos/cosmos-sdk/x/bank/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" ) const ( @@ -125,11 +127,9 @@ func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } -func (suite *KeeperTestSuite) SetupTest() { - key := storetypes.NewKVStoreKey(banktypes.StoreKey) - testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithHeaderInfo(header.Info{Time: time.Now()}) - encCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}) +func (suite *IntegrationTestSuite) SetupTest() { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{Time: time.Now()}) env := runtime.NewEnvironment(runtime.NewKVStoreService(key), coretesting.NewNopLogger()) diff --git a/x/bank/types/querier.go b/x/bank/types/querier.go index 532676c084ab..5870ea9eb33a 100644 --- a/x/bank/types/querier.go +++ b/x/bank/types/querier.go @@ -34,6 +34,13 @@ func NewQuerySpendableBalanceByDenomRequest(addr, denom string) *QuerySpendableB return &QuerySpendableBalanceByDenomRequest{Address: addr, Denom: denom} } +// NewQuerySpendableBalancesRequest creates a new instance of a +// QuerySpendableBalancesRequest. +// nolint:interfacer +func NewQuerySpendableBalancesRequest(addr sdk.AccAddress, req *query.PageRequest) *QuerySpendableBalancesRequest { + return &QuerySpendableBalancesRequest{Address: addr.String(), Pagination: req} +} + // QueryTotalSupplyParams defines the params for the following queries: // - 'custom/bank/totalSupply' type QueryTotalSupplyParams struct { diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index cd96d78a03e3..92aef9c3bcd7 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -318,95 +318,6 @@ func (m *QuerySpendableBalancesResponse) GetPagination() *query.PageResponse { return nil } -// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for -// querying an account's spendable balance for a specific denom. -type QuerySpendableBalanceByDenomRequest struct { - // address is the address to query balances for. - Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // denom is the coin denom to query balances for. - Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` -} - -func (m *QuerySpendableBalanceByDenomRequest) Reset() { *m = QuerySpendableBalanceByDenomRequest{} } -func (m *QuerySpendableBalanceByDenomRequest) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalanceByDenomRequest) ProtoMessage() {} -func (*QuerySpendableBalanceByDenomRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{6} -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalanceByDenomRequest.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 *QuerySpendableBalanceByDenomRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalanceByDenomRequest.Merge(m, src) -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalanceByDenomRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalanceByDenomRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalanceByDenomRequest proto.InternalMessageInfo - -// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for -// querying an account's spendable balance for a specific denom. -type QuerySpendableBalanceByDenomResponse struct { - // balance is the balance of the coin. - Balance *types.Coin `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` -} - -func (m *QuerySpendableBalanceByDenomResponse) Reset() { *m = QuerySpendableBalanceByDenomResponse{} } -func (m *QuerySpendableBalanceByDenomResponse) String() string { return proto.CompactTextString(m) } -func (*QuerySpendableBalanceByDenomResponse) ProtoMessage() {} -func (*QuerySpendableBalanceByDenomResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{7} -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QuerySpendableBalanceByDenomResponse.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 *QuerySpendableBalanceByDenomResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuerySpendableBalanceByDenomResponse.Merge(m, src) -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_Size() int { - return m.Size() -} -func (m *QuerySpendableBalanceByDenomResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QuerySpendableBalanceByDenomResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QuerySpendableBalanceByDenomResponse proto.InternalMessageInfo - -func (m *QuerySpendableBalanceByDenomResponse) GetBalance() *types.Coin { - if m != nil { - return m.Balance - } - return nil -} - // QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC // method. type QueryTotalSupplyRequest struct { @@ -420,7 +331,7 @@ func (m *QueryTotalSupplyRequest) Reset() { *m = QueryTotalSupplyRequest func (m *QueryTotalSupplyRequest) String() string { return proto.CompactTextString(m) } func (*QueryTotalSupplyRequest) ProtoMessage() {} func (*QueryTotalSupplyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{8} + return fileDescriptor_9c6fc1939682df13, []int{6} } func (m *QueryTotalSupplyRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +375,7 @@ func (m *QueryTotalSupplyResponse) Reset() { *m = QueryTotalSupplyRespon func (m *QueryTotalSupplyResponse) String() string { return proto.CompactTextString(m) } func (*QueryTotalSupplyResponse) ProtoMessage() {} func (*QueryTotalSupplyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{9} + return fileDescriptor_9c6fc1939682df13, []int{7} } func (m *QueryTotalSupplyResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -517,7 +428,7 @@ func (m *QuerySupplyOfRequest) Reset() { *m = QuerySupplyOfRequest{} } func (m *QuerySupplyOfRequest) String() string { return proto.CompactTextString(m) } func (*QuerySupplyOfRequest) ProtoMessage() {} func (*QuerySupplyOfRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{10} + return fileDescriptor_9c6fc1939682df13, []int{8} } func (m *QuerySupplyOfRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,7 +474,7 @@ func (m *QuerySupplyOfResponse) Reset() { *m = QuerySupplyOfResponse{} } func (m *QuerySupplyOfResponse) String() string { return proto.CompactTextString(m) } func (*QuerySupplyOfResponse) ProtoMessage() {} func (*QuerySupplyOfResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{11} + return fileDescriptor_9c6fc1939682df13, []int{9} } func (m *QuerySupplyOfResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -607,7 +518,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{12} + return fileDescriptor_9c6fc1939682df13, []int{10} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -646,7 +557,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{13} + return fileDescriptor_9c6fc1939682df13, []int{11} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -692,7 +603,7 @@ func (m *QueryDenomsMetadataRequest) Reset() { *m = QueryDenomsMetadataR func (m *QueryDenomsMetadataRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomsMetadataRequest) ProtoMessage() {} func (*QueryDenomsMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{14} + return fileDescriptor_9c6fc1939682df13, []int{12} } func (m *QueryDenomsMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -741,7 +652,7 @@ func (m *QueryDenomsMetadataResponse) Reset() { *m = QueryDenomsMetadata func (m *QueryDenomsMetadataResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomsMetadataResponse) ProtoMessage() {} func (*QueryDenomsMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{15} + return fileDescriptor_9c6fc1939682df13, []int{13} } func (m *QueryDenomsMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -794,7 +705,7 @@ func (m *QueryDenomMetadataRequest) Reset() { *m = QueryDenomMetadataReq func (m *QueryDenomMetadataRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomMetadataRequest) ProtoMessage() {} func (*QueryDenomMetadataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{16} + return fileDescriptor_9c6fc1939682df13, []int{14} } func (m *QueryDenomMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -841,7 +752,7 @@ func (m *QueryDenomMetadataResponse) Reset() { *m = QueryDenomMetadataRe func (m *QueryDenomMetadataResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomMetadataResponse) ProtoMessage() {} func (*QueryDenomMetadataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{17} + return fileDescriptor_9c6fc1939682df13, []int{15} } func (m *QueryDenomMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -877,78 +788,110 @@ func (m *QueryDenomMetadataResponse) GetMetadata() Metadata { return Metadata{} } -// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. -// Identical with QueryDenomMetadataRequest but receives denom as query string. -type QueryDenomMetadataByQueryStringRequest struct { - // denom is the coin denom to query the metadata for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +func init() { + proto.RegisterType((*QueryBalanceRequest)(nil), "cosmos.bank.v1beta1.QueryBalanceRequest") + proto.RegisterType((*QueryBalanceResponse)(nil), "cosmos.bank.v1beta1.QueryBalanceResponse") + proto.RegisterType((*QueryAllBalancesRequest)(nil), "cosmos.bank.v1beta1.QueryAllBalancesRequest") + proto.RegisterType((*QueryAllBalancesResponse)(nil), "cosmos.bank.v1beta1.QueryAllBalancesResponse") + proto.RegisterType((*QuerySpendableBalancesRequest)(nil), "cosmos.bank.v1beta1.QuerySpendableBalancesRequest") + proto.RegisterType((*QuerySpendableBalancesResponse)(nil), "cosmos.bank.v1beta1.QuerySpendableBalancesResponse") + proto.RegisterType((*QueryTotalSupplyRequest)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyRequest") + proto.RegisterType((*QueryTotalSupplyResponse)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyResponse") + proto.RegisterType((*QuerySupplyOfRequest)(nil), "cosmos.bank.v1beta1.QuerySupplyOfRequest") + 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{ - // 829 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6b, 0x13, 0x5b, - 0x18, 0xce, 0xe9, 0xbd, 0x4d, 0xd3, 0x37, 0xdc, 0xbb, 0x38, 0xcd, 0xe5, 0xa6, 0xd3, 0xdb, 0xe4, - 0x32, 0xd5, 0x36, 0xad, 0xe9, 0x4c, 0x9b, 0x0a, 0x7e, 0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, 0x28, 0xed, 0xba, 0xa6, 0x49, 0xed, 0xca, 0x10, - 0x65, 0x3c, 0xf2, 0x3b, 0x94, 0x93, 0xad, 0x47, 0xa7, 0x5b, 0x56, 0xbe, 0xdb, 0x82, 0xc4, 0xe6, - 0x7d, 0x25, 0x5a, 0x67, 0x27, 0x90, 0x6f, 0x27, 0xf4, 0x02, 0xfc, 0xd3, 0x93, 0x2d, 0x49, 0x5f, - 0x80, 0x28, 0xa9, 0xd3, 0xa6, 0xe3, 0x0d, 0xdd, 0x84, 0xfc, 0x9f, 0x6d, 0xd2, 0x45, 0x99, 0xae, - 0x27, 0x00, 0xf3, 0x8e, 0x05, 0xd2, 0x20, 0x75, 0xb5, 0x08, 0x7a, 0x41, 0xae, 0xb0, 0x8a, 0xca, - 0x29, 0x97, 0x20, 0xea, 0xf2, 0x88, 0x9c, 0x32, 0x63, 0x04, 0xf8, 0x93, 0x21, 0x8a, 0xd4, 0x1c, - 0x51, 0xa0, 0x57, 0x40, 0xe3, 0x1d, 0xaf, 0xb6, 0x79, 0xb0, 0x9b, 0x96, 0x47, 0x2a, 0xc4, 0x23, - 0x23, 0x7e, 0x45, 0xf4, 0xf7, 0x08, 0x66, 0x02, 0xc7, 0x48, 0x02, 0xeb, 0x30, 0x59, 0x97, 0x31, - 0xb5, 0x58, 0xb3, 0x81, 0x1c, 0x54, 0xa5, 0x64, 0x71, 0x52, 0x35, 0xba, 0x93, 0x5f, 0x85, 0xe9, - 0x13, 0xa8, 0xbd, 0x82, 0x04, 0x1f, 0xff, 0x3d, 0xbf, 0x88, 0x7d, 0xe4, 0xae, 0x40, 0x4c, 0xc1, - 0x94, 0x12, 0x86, 0xe2, 0xd6, 0x29, 0xca, 0x7d, 0x8c, 0xc1, 0x38, 0xef, 0x8f, 0x5f, 0x23, 0x98, - 0x90, 0xa6, 0x84, 0x33, 0x81, 0x4d, 0x02, 0x1c, 0x5e, 0x5b, 0x0c, 0x91, 0x29, 0xb0, 0xea, 0x17, - 0x9f, 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c1, 0x9a, 0xdf, 0x38, 0x38, 0x4a, 0xa1, 0xc3, 0xa3, 0x14, - 0xfa, 0x7e, 0x94, 0x42, 0x2f, 0x8f, 0x53, 0x91, 0xc3, 0xe3, 0x54, 0xe4, 0xcb, 0x71, 0x2a, 0x72, - 0x77, 0x71, 0xe0, 0x67, 0xf5, 0x91, 0x68, 0xcb, 0xbf, 0xae, 0xa5, 0x28, 0xff, 0xeb, 0xb8, 0xf6, - 0x2b, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x6f, 0x29, 0xd7, 0x12, 0x0b, 0x00, 0x00, + // 896 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x97, 0x5d, 0x6b, 0x23, 0x55, + 0x18, 0xc7, 0x73, 0xaa, 0x4d, 0xd3, 0x27, 0x28, 0x78, 0x1a, 0x31, 0x9d, 0xda, 0x89, 0x4c, 0xb5, + 0x4d, 0x6b, 0x3a, 0xd3, 0x24, 0x82, 0xd6, 0x1b, 0x69, 0x2a, 0x7a, 0x21, 0xd2, 0x98, 0x7a, 0x25, + 0x48, 0x39, 0x49, 0xc6, 0x31, 0x34, 0x99, 0x33, 0xcd, 0x99, 0x88, 0xa1, 0x14, 0x44, 0x10, 0x04, + 0x41, 0x05, 0x6f, 0x04, 0x6f, 0xea, 0x8d, 0xa0, 0x5f, 0xc0, 0xaf, 0xd0, 0x8b, 0xbd, 0x28, 0xbb, + 0x37, 0x7b, 0xb5, 0xbb, 0xb4, 0x7b, 0xb1, 0x37, 0xfb, 0x1d, 0x96, 0x9c, 0x97, 0x74, 0x92, 0x4c, + 0x92, 0x59, 0xc8, 0xb2, 0xec, 0x55, 0x93, 0x33, 0xcf, 0xcb, 0xef, 0xf9, 0x9f, 0x33, 0xff, 0x93, + 0x42, 0xa6, 0x46, 0x59, 0x8b, 0x32, 0xab, 0x4a, 0xdc, 0x63, 0xeb, 0xbb, 0x7c, 0xd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 0xa3, 0xdf, 0xaf, 0xf5, 0xd8, 0xe5, 0xb5, 0x1e, 0xbb, 0x7b, 0xad, + 0xc7, 0xbe, 0xda, 0x9c, 0xf8, 0x83, 0xe0, 0x7b, 0x51, 0x96, 0xff, 0x2e, 0xa8, 0xc6, 0xf9, 0xff, + 0x15, 0xc5, 0x27, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd1, 0xfd, 0x88, 0xa1, 0x2f, 0x0d, 0x00, 0x00, } var xxx_messageInfo_QueryDenomMetadataByQueryStringRequest proto.InternalMessageInfo -func (m *QueryDenomMetadataByQueryStringRequest) GetDenom() string { - if m != nil { - return m.Denom - } - return "" +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Balance queries the balance of a single coin for a single account. + Balance(ctx context.Context, in *QueryBalanceRequest, opts ...grpc.CallOption) (*QueryBalanceResponse, error) + // AllBalances queries the balance of all coins for a single account. + AllBalances(ctx context.Context, in *QueryAllBalancesRequest, opts ...grpc.CallOption) (*QueryAllBalancesResponse, error) + // SpendableBalances queries the spenable balance of all coins for a single + // account. + SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) + // TotalSupply queries the total supply of all coins. + TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) + // SupplyOf queries the supply of a single coin. + 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) } // QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC @@ -1041,11 +984,20 @@ func (m *QueryDenomOwnersRequest) XXX_DiscardUnknown() { xxx_messageInfo_QueryDenomOwnersRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryDenomOwnersRequest proto.InternalMessageInfo +func (c *queryClient) SpendableBalances(ctx context.Context, in *QuerySpendableBalancesRequest, opts ...grpc.CallOption) (*QuerySpendableBalancesResponse, error) { + out := new(QuerySpendableBalancesResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SpendableBalances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} -func (m *QueryDenomOwnersRequest) GetDenom() string { - if m != nil { - return m.Denom +func (c *queryClient) TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) { + out := new(QueryTotalSupplyResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/TotalSupply", in, out, opts...) + if err != nil { + return nil, err } return "" } @@ -1107,11 +1059,25 @@ func (m *DenomOwner) GetAddress() string { return "" } -func (m *DenomOwner) GetBalance() types.Coin { - if m != nil { - return m.Balance - } - return types.Coin{} +// QueryServer is the server API for Query service. +type QueryServer interface { + // Balance queries the balance of a single coin for a single account. + Balance(context.Context, *QueryBalanceRequest) (*QueryBalanceResponse, error) + // AllBalances queries the balance of all coins for a single account. + AllBalances(context.Context, *QueryAllBalancesRequest) (*QueryAllBalancesResponse, error) + // SpendableBalances queries the spenable balance of all coins for a single + // account. + SpendableBalances(context.Context, *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) + // TotalSupply queries the total supply of all coins. + TotalSupply(context.Context, *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) + // SupplyOf queries the supply of a single coin. + 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) } // QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. @@ -1127,8 +1093,11 @@ func (*QueryDenomOwnersResponse) ProtoMessage() {} func (*QueryDenomOwnersResponse) Descriptor() ([]byte, []int) { return fileDescriptor_9c6fc1939682df13, []int{22} } -func (m *QueryDenomOwnersResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (*UnimplementedQueryServer) SpendableBalances(ctx context.Context, req *QuerySpendableBalancesRequest) (*QuerySpendableBalancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpendableBalances not implemented") +} +func (*UnimplementedQueryServer) TotalSupply(ctx context.Context, req *QueryTotalSupplyRequest) (*QueryTotalSupplyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalSupply not implemented") } func (m *QueryDenomOwnersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { @@ -1168,14 +1137,40 @@ func (m *QueryDenomOwnersResponse) GetPagination() *query.PageResponse { return nil } -// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, -// which queries for a paginated set of all account holders of a particular -// denomination. -type QueryDenomOwnersByQueryRequest struct { - // denom defines the coin denomination to query all account holders for. - Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` - // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +func _Query_SpendableBalances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpendableBalancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SpendableBalances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SpendableBalances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SpendableBalances(ctx, req.(*QuerySpendableBalancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_TotalSupply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalSupplyRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalSupply(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/TotalSupply", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalSupply(ctx, req.(*QueryTotalSupplyRequest)) + } + return interceptor(ctx, in, info, handler) } func (m *QueryDenomOwnersByQueryRequest) Reset() { *m = QueryDenomOwnersByQueryRequest{} } @@ -1279,13 +1274,45 @@ func (m *QueryDenomOwnersByQueryResponse) GetPagination() *query.PageResponse { return nil } -// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. -type QuerySendEnabledRequest struct { - // denoms is the specific denoms you want look up. Leave empty to get all entries. - Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty"` - // pagination defines an optional pagination for the request. This field is - // only read if the denoms field is empty. - Pagination *query.PageRequest `protobuf:"bytes,99,opt,name=pagination,proto3" json:"pagination,omitempty"` +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.bank.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Balance", + Handler: _Query_Balance_Handler, + }, + { + MethodName: "AllBalances", + Handler: _Query_AllBalances_Handler, + }, + { + MethodName: "SpendableBalances", + Handler: _Query_SpendableBalances_Handler, + }, + { + MethodName: "TotalSupply", + Handler: _Query_TotalSupply_Handler, + }, + { + MethodName: "SupplyOf", + Handler: _Query_SupplyOf_Handler, + }, + { + 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", } func (m *QuerySendEnabledRequest) Reset() { *m = QuerySendEnabledRequest{} } @@ -1626,9 +1653,135 @@ func (c *queryClient) SpendableBalanceByDenom(ctx context.Context, in *QuerySpen return out, nil } -func (c *queryClient) TotalSupply(ctx context.Context, in *QueryTotalSupplyRequest, opts ...grpc.CallOption) (*QueryTotalSupplyResponse, error) { - out := new(QueryTotalSupplyResponse) - err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/TotalSupply", in, out, opts...) +func (m *QueryAllBalancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + 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.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[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 *QuerySpendableBalancesRequest) 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 *QuerySpendableBalancesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableBalancesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + 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.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySpendableBalancesResponse) 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 *QuerySpendableBalancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpendableBalancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + 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.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[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 *QueryTotalSupplyRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -1895,16 +2048,51 @@ func _Query_TotalSupply_Handler(srv interface{}, ctx context.Context, dec func(i Server: srv, FullMethod: "/cosmos.bank.v1beta1.Query/TotalSupply", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).TotalSupply(ctx, req.(*QueryTotalSupplyRequest)) + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalSupply(ctx, req.(*QueryTotalSupplyRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func (m *QuerySpendableBalancesRequest) 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 *QuerySpendableBalancesResponse) 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 interceptor(ctx, in, info, handler) + return n } -func _Query_SupplyOf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QuerySupplyOfRequest) - if err := dec(in); err != nil { - return nil, err +func (m *QueryTotalSupplyRequest) Size() (n int) { + if m == nil { + return 0 } if interceptor == nil { return srv.(QueryServer).SupplyOf(ctx, in) @@ -5296,7 +5484,245 @@ func (m *QueryDenomMetadataRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryDenomMetadataResponse) Unmarshal(dAtA []byte) error { +func (m *QuerySpendableBalancesRequest) 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: QuerySpendableBalancesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableBalancesRequest: 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 *QuerySpendableBalancesResponse) 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: QuerySpendableBalancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpendableBalancesResponse: 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 { diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 8fa236899116..ccabd7c40432 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -253,78 +253,6 @@ func local_request_Query_SpendableBalances_0(ctx context.Context, marshaler runt } -var ( - filter_Query_SpendableBalanceByDenom_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} -) - -func request_Query_SpendableBalanceByDenom_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalanceByDenomRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalanceByDenom_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SpendableBalanceByDenom(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SpendableBalanceByDenom_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySpendableBalanceByDenomRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["address"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "address") - } - - protoReq.Address, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err) - } - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_SpendableBalanceByDenom_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SpendableBalanceByDenom(ctx, &protoReq) - return msg, metadata, err - -} - var ( filter_Query_TotalSupply_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -740,8 +668,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_SpendableBalances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -749,7 +675,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_SpendableBalances_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) @@ -760,29 +685,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_SpendableBalanceByDenom_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SpendableBalanceByDenom_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SpendableBalanceByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1091,26 +993,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_SpendableBalanceByDenom_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_SpendableBalanceByDenom_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_SpendableBalanceByDenom_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_TotalSupply_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1301,8 +1183,6 @@ var ( pattern_Query_SpendableBalances_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", "spendable_balances", "address"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_SpendableBalanceByDenom_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", "spendable_balances", "address", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_TotalSupply_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "supply"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_SupplyOf_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmos", "bank", "v1beta1", "supply", "by_denom"}, "", runtime.AssumeColonVerbOpt(false))) @@ -1329,8 +1209,6 @@ var ( forward_Query_SpendableBalances_0 = runtime.ForwardResponseMessage - forward_Query_SpendableBalanceByDenom_0 = runtime.ForwardResponseMessage - forward_Query_TotalSupply_0 = runtime.ForwardResponseMessage forward_Query_SupplyOf_0 = runtime.ForwardResponseMessage