diff --git a/x/bank/README.md b/x/bank/README.md index 885a9f1f6f1f..990634b8b3b3 100644 --- a/x/bank/README.md +++ b/x/bank/README.md @@ -280,11 +280,6 @@ During `InputOutputCoins`, the send restriction is applied after the input coins A send restriction function should make use of a custom value in the context to allow bypassing that specific restriction. -Send Restrictions are not placed on `ModuleToAccount` or `ModuleToModule` transfers. This is done due to modules needing to move funds to user accounts and other module accounts. This is a design decision to allow for more flexibility in the state machine. The state machine should be able to move funds between module accounts and user accounts without restrictions. - -Secondly this limitation would limit the usage of the state machine even for itself. users would not be able to receive rewards, not be able to move funds between module accounts. In the case that a user sends funds from a user account to the community pool and then a governance proposal is used to get those tokens into the users account this would fall under the discretion of the app chain developer to what they would like to do here. We can not make strong assumptions here. -Thirdly, this issue could lead into a chain halt if a token is disabled and the token is moved in the begin/endblock. This is the last reason we see the current change and more damaging then beneficial for users. - For example, in your module's keeper package, you'd define the send restriction function: ```golang diff --git a/x/bank/hooks_test.go b/x/bank/hooks_test.go new file mode 100644 index 000000000000..d52737de1523 --- /dev/null +++ b/x/bank/hooks_test.go @@ -0,0 +1,164 @@ +package bank_test + +import ( + "context" + "fmt" + "testing" + + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/bank/keeper" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/testutil" + "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +var _ types.BankHooks = &MockBankHooksReceiver{} + +// BankHooks event hooks for bank (noalias) +type MockBankHooksReceiver struct{} + +// Mock BlockBeforeSend bank hook that doesn't allow the sending of exactly 100 coins of any denom. +func (h *MockBankHooksReceiver) BlockBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) error { + for _, coin := range amount { + if coin.Amount.Equal(math.NewInt(100)) { + return fmt.Errorf("not allowed; expected %v, got: %v", 100, coin.Amount) + } + } + return nil +} + +// variable for counting `TrackBeforeSend` +var ( + countTrackBeforeSend = 0 + expNextCount = 1 +) + +// Mock TrackBeforeSend bank hook that simply tracks the sending of exactly 50 coins of any denom. +func (h *MockBankHooksReceiver) TrackBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) { + for _, coin := range amount { + if coin.Amount.Equal(math.NewInt(50)) { + countTrackBeforeSend++ + } + } +} + +func TestHooks(t *testing.T) { + acc := &authtypes.BaseAccount{ + Address: addr1.String(), + } + + genAccs := []authtypes.GenesisAccount{acc} + app := createTestSuite(t, genAccs) + baseApp := app.App.BaseApp + ctx := baseApp.NewContextLegacy(false, tmproto.Header{}) + + require.NoError(t, banktestutil.FundAccount(ctx, app.BankKeeper, addr1, sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000)))) + require.NoError(t, banktestutil.FundAccount(ctx, app.BankKeeper, addr2, sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 10000)))) + banktestutil.FundModuleAccount(ctx, app.BankKeeper, stakingtypes.BondedPoolName, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1000)))) + + // create a valid send amount which is 1 coin, and an invalidSendAmount which is 100 coins + validSendAmount := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(1))) + triggerTrackSendAmount := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(50))) + invalidBlockSendAmount := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(100))) + + // setup our mock bank hooks receiver that prevents the send of 100 coins + bankHooksReceiver := MockBankHooksReceiver{} + baseBankKeeper, ok := app.BankKeeper.(keeper.BaseKeeper) + require.True(t, ok) + baseBankKeeper.SetHooks( + types.NewMultiBankHooks(&bankHooksReceiver), + ) + app.BankKeeper = baseBankKeeper + + // try sending a validSendAmount and it should work + err := app.BankKeeper.SendCoins(ctx, addr1, addr2, validSendAmount) + require.NoError(t, err) + + // try sending an trigger track send amount and it should work + err = app.BankKeeper.SendCoins(ctx, addr1, addr2, triggerTrackSendAmount) + require.NoError(t, err) + + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ + + // try sending an invalidSendAmount and it should not work + err = app.BankKeeper.SendCoins(ctx, addr1, addr2, invalidBlockSendAmount) + require.Error(t, err) + + // try doing SendManyCoins and make sure if even a single subsend is invalid, the entire function fails + err = app.BankKeeper.SendManyCoins(ctx, addr1, []sdk.AccAddress{addr1, addr2}, []sdk.Coins{invalidBlockSendAmount, validSendAmount}) + require.Error(t, err) + + err = app.BankKeeper.SendManyCoins(ctx, addr1, []sdk.AccAddress{addr1, addr2}, []sdk.Coins{triggerTrackSendAmount, validSendAmount}) + require.NoError(t, err) + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ + + // make sure that account to module doesn't bypass hook + err = app.BankKeeper.SendCoinsFromAccountToModule(ctx, addr1, stakingtypes.BondedPoolName, validSendAmount) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromAccountToModule(ctx, addr1, stakingtypes.BondedPoolName, invalidBlockSendAmount) + require.Error(t, err) + err = app.BankKeeper.SendCoinsFromAccountToModule(ctx, addr1, stakingtypes.BondedPoolName, triggerTrackSendAmount) + require.NoError(t, err) + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ + + // make sure that module to account doesn't bypass hook + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, stakingtypes.BondedPoolName, addr1, validSendAmount) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, stakingtypes.BondedPoolName, addr1, invalidBlockSendAmount) + require.Error(t, err) + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, stakingtypes.BondedPoolName, addr1, triggerTrackSendAmount) + require.NoError(t, err) + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ + + // make sure that module to module doesn't bypass hook + err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, validSendAmount) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, invalidBlockSendAmount) + // there should be no error since module to module does not call block before send hooks + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToModule(ctx, stakingtypes.BondedPoolName, stakingtypes.NotBondedPoolName, triggerTrackSendAmount) + require.NoError(t, err) + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ + + // make sure that module to many accounts doesn't bypass hook + err = app.BankKeeper.SendCoinsFromModuleToManyAccounts(ctx, stakingtypes.BondedPoolName, []sdk.AccAddress{addr1, addr2}, []sdk.Coins{validSendAmount, validSendAmount}) + require.NoError(t, err) + err = app.BankKeeper.SendCoinsFromModuleToManyAccounts(ctx, stakingtypes.BondedPoolName, []sdk.AccAddress{addr1, addr2}, []sdk.Coins{validSendAmount, invalidBlockSendAmount}) + require.Error(t, err) + err = app.BankKeeper.SendCoinsFromModuleToManyAccounts(ctx, stakingtypes.BondedPoolName, []sdk.AccAddress{addr1, addr2}, []sdk.Coins{validSendAmount, triggerTrackSendAmount}) + require.NoError(t, err) + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ + + // make sure that DelegateCoins doesn't bypass the hook + err = app.BankKeeper.DelegateCoins(ctx, addr1, app.AccountKeeper.GetModuleAddress(stakingtypes.BondedPoolName), validSendAmount) + require.NoError(t, err) + err = app.BankKeeper.DelegateCoins(ctx, addr1, app.AccountKeeper.GetModuleAddress(stakingtypes.BondedPoolName), invalidBlockSendAmount) + require.Error(t, err) + err = app.BankKeeper.DelegateCoins(ctx, addr1, app.AccountKeeper.GetModuleAddress(stakingtypes.BondedPoolName), triggerTrackSendAmount) + require.NoError(t, err) + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ + + // make sure that UndelegateCoins doesn't bypass the hook + err = app.BankKeeper.UndelegateCoins(ctx, app.AccountKeeper.GetModuleAddress(stakingtypes.BondedPoolName), addr1, validSendAmount) + require.NoError(t, err) + err = app.BankKeeper.UndelegateCoins(ctx, app.AccountKeeper.GetModuleAddress(stakingtypes.BondedPoolName), addr1, invalidBlockSendAmount) + require.Error(t, err) + + err = app.BankKeeper.UndelegateCoins(ctx, app.AccountKeeper.GetModuleAddress(stakingtypes.BondedPoolName), addr1, triggerTrackSendAmount) + require.NoError(t, err) + require.Equal(t, countTrackBeforeSend, expNextCount) + expNextCount++ +} diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index c172fb24e649..d9703ebc4796 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -139,7 +139,7 @@ func (k BaseKeeper) SpendableBalanceByDenom(ctx context.Context, req *types.Quer // TotalSupply implements the Query/TotalSupply gRPC method func (k BaseKeeper) TotalSupply(ctx context.Context, req *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) { sdkCtx := sdk.UnwrapSDKContext(ctx) - totalSupply, pageRes, err := k.GetPaginatedTotalSupply(sdkCtx, req.Pagination) + totalSupply, pageRes, err := k.GetPaginatedTotalSupplyWithOffsets(sdkCtx, req.Pagination) if err != nil { return nil, status.Error(codes.Internal, err.Error()) } @@ -158,11 +158,38 @@ func (k BaseKeeper) SupplyOf(c context.Context, req *types.QuerySupplyOfRequest) } ctx := sdk.UnwrapSDKContext(c) - supply := k.GetSupply(ctx, req.Denom) + supply := k.GetSupplyWithOffset(ctx, req.Denom) return &types.QuerySupplyOfResponse{Amount: sdk.NewCoin(req.Denom, supply.Amount)}, nil } +// TotalSupply implements the Query/TotalSupplyWithoutOffset gRPC method +func (k BaseKeeper) TotalSupplyWithoutOffset(ctx context.Context, req *types.QueryTotalSupplyWithoutOffsetRequest) (*types.QueryTotalSupplyWithoutOffsetResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + totalSupply, pageRes, err := k.GetPaginatedTotalSupply(sdkCtx, req.Pagination) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryTotalSupplyWithoutOffsetResponse{Supply: totalSupply, Pagination: pageRes}, nil +} + +// SupplyOf implements the Query/SupplyOf gRPC method +func (k BaseKeeper) SupplyOfWithoutOffset(c context.Context, req *types.QuerySupplyOfWithoutOffsetRequest) (*types.QuerySupplyOfWithoutOffsetResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + if req.Denom == "" { + return nil, status.Error(codes.InvalidArgument, "invalid denom") + } + + ctx := sdk.UnwrapSDKContext(c) + supply := k.GetSupply(ctx, req.Denom) + + return &types.QuerySupplyOfWithoutOffsetResponse{Amount: sdk.NewCoin(req.Denom, supply.Amount)}, nil +} + // Params implements the gRPC service handler for querying x/bank parameters. func (k BaseKeeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { if req == nil { diff --git a/x/bank/keeper/grpc_query_test.go b/x/bank/keeper/grpc_query_test.go index b17111db01b0..e44cf2e2293a 100644 --- a/x/bank/keeper/grpc_query_test.go +++ b/x/bank/keeper/grpc_query_test.go @@ -5,6 +5,8 @@ import ( "fmt" "time" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" @@ -279,6 +281,7 @@ func (suite *KeeperTestSuite) TestSpendableBalanceByDenom() { func (suite *KeeperTestSuite) TestQueryTotalSupply() { ctx, queryClient := suite.ctx, suite.queryClient + res, err := queryClient.TotalSupply(gocontext.Background(), &types.QueryTotalSupplyRequest{}) suite.Require().NoError(err) suite.Require().NotNil(res) @@ -294,7 +297,22 @@ func (suite *KeeperTestSuite) TestQueryTotalSupply() { expectedTotalSupply := genesisSupply.Add(testCoins...) suite.Require().Equal(1, len(res.Supply)) - suite.Require().Equal(res.Supply, expectedTotalSupply) + suite.Require().Equal(expectedTotalSupply, res.Supply) + + // test total supply query with supply offset + suite.bankKeeper.AddSupplyOffset(ctx, "test", math.NewInt(-100000000)) + res, err = queryClient.TotalSupply(gocontext.Background(), &types.QueryTotalSupplyRequest{}) + suite.Require().NoError(err) + suite.Require().NotNil(res) + + suite.Require().Equal(expectedTotalSupply.Sub(sdk.NewCoins(sdk.NewInt64Coin("test", 100000000))...), res.Supply) + + // make sure query without offsets hasn't changed + res2, err := queryClient.TotalSupplyWithoutOffset(gocontext.Background(), &types.QueryTotalSupplyWithoutOffsetRequest{}) + suite.Require().NoError(err) + suite.Require().NotNil(res2) + + suite.Require().Equal(expectedTotalSupply, res2.Supply) } func (suite *KeeperTestSuite) TestQueryTotalSupplyOf() { @@ -320,6 +338,29 @@ func (suite *KeeperTestSuite) TestQueryTotalSupplyOf() { suite.Require().NoError(err) suite.Require().NotNil(res) suite.Require().Equal(sdk.NewInt64Coin("bogus", 0), res.Amount) + + // test total supply of query with supply offset + suite.bankKeeper.AddSupplyOffset(ctx, "test1", math.NewInt(-1000000)) + res, err = queryClient.SupplyOf(gocontext.Background(), &types.QuerySupplyOfRequest{Denom: test1Supply.Denom}) + suite.Require().NoError(err) + suite.Require().NotNil(res) + + suite.Require().Equal(test1Supply.Sub(sdk.NewInt64Coin("test1", 1000000)), res.Amount) + + // make sure query without offsets hasn't changed + res2, err := queryClient.SupplyOfWithoutOffset(gocontext.Background(), &types.QuerySupplyOfWithoutOffsetRequest{Denom: test1Supply.Denom}) + suite.Require().NoError(err) + suite.Require().NotNil(res2) + + suite.Require().Equal(test1Supply, res2.Amount) + + // try to make SupplyWithOffset negative, should return as 0 + suite.bankKeeper.AddSupplyOffset(ctx, "test1", math.NewInt(-100000000000)) + res, err = queryClient.SupplyOf(gocontext.Background(), &types.QuerySupplyOfRequest{Denom: test1Supply.Denom}) + suite.Require().NoError(err) + suite.Require().NotNil(res) + + suite.Require().Equal(sdk.NewInt64Coin("test1", 0), res.Amount) } func (suite *KeeperTestSuite) TestQueryParams() { diff --git a/x/bank/keeper/hooks.go b/x/bank/keeper/hooks.go new file mode 100644 index 000000000000..00f1d7ef9c84 --- /dev/null +++ b/x/bank/keeper/hooks.go @@ -0,0 +1,26 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// Implements StakingHooks interface +var _ types.BankHooks = BaseSendKeeper{} + +// TrackBeforeSend executes the TrackBeforeSend hook if registered. +func (k BaseSendKeeper) TrackBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) { + if k.hooks != nil { + k.hooks.TrackBeforeSend(ctx, from, to, amount) + } +} + +// BlockBeforeSend executes the BlockBeforeSend hook if registered. +func (k BaseSendKeeper) BlockBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) error { + if k.hooks != nil { + return k.hooks.BlockBeforeSend(ctx, from, to, amount) + } + return nil +} diff --git a/x/bank/keeper/internal_test.go b/x/bank/keeper/internal_test.go new file mode 100644 index 000000000000..3408248f1a98 --- /dev/null +++ b/x/bank/keeper/internal_test.go @@ -0,0 +1,11 @@ +package keeper + +import "github.com/cosmos/cosmos-sdk/x/bank/types" + +// UnsafeSetHooks updates the x/bank keeper's hooks, overriding any potential +// pre-existing hooks. +// +// WARNING: this function should only be used in tests. +func UnsafeSetHooks(k *BaseKeeper, h types.BankHooks) { + k.hooks = h +} diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index bfa45d23f64e..be0e69462c05 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -32,6 +32,11 @@ type Keeper interface { HasSupply(ctx context.Context, denom string) bool GetPaginatedTotalSupply(ctx context.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) IterateTotalSupply(ctx context.Context, cb func(sdk.Coin) bool) + GetSupplyOffset(ctx context.Context, denom string) math.Int + AddSupplyOffset(ctx context.Context, denom string, offsetAmount math.Int) + GetSupplyWithOffset(ctx context.Context, denom string) sdk.Coin + GetPaginatedTotalSupplyWithOffsets(ctx context.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) + IterateTotalSupplyWithOffsets(ctx context.Context, cb func(sdk.Coin) bool) GetDenomMetaData(ctx context.Context, denom string) (types.Metadata, bool) HasDenomMetaData(ctx context.Context, denom string) bool SetDenomMetaData(ctx context.Context, denomMetaData types.Metadata) @@ -45,6 +50,7 @@ type Keeper interface { UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + SendCoinsFromModuleToManyAccounts(ctx context.Context, senderModule string, recipientAddrs []sdk.AccAddress, amts []sdk.Coins) error DelegateCoins(ctx context.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx context.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error @@ -131,6 +137,13 @@ func (k BaseKeeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccA return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, amt.String()) } + err := k.BlockBeforeSend(ctx, delegatorAddr, moduleAccAddr, amt) + if err != nil { + return err + } + // call the TrackBeforeSend hooks and the BlockBeforeSend hooks + k.TrackBeforeSend(ctx, delegatorAddr, moduleAccAddr, amt) + balances := sdk.NewCoins() for _, coin := range amt { @@ -157,7 +170,7 @@ func (k BaseKeeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccA types.NewCoinSpentEvent(delegatorAddr, amt), ) - err := k.addCoins(ctx, moduleAccAddr, amt) + err = k.addCoins(ctx, moduleAccAddr, amt) if err != nil { return err } @@ -180,7 +193,15 @@ func (k BaseKeeper) UndelegateCoins(ctx context.Context, moduleAccAddr, delegato return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, amt.String()) } - err := k.subUnlockedCoins(ctx, moduleAccAddr, amt) + // call the TrackBeforeSend hooks and the BlockBeforeSend hooks + err := k.BlockBeforeSend(ctx, moduleAccAddr, delegatorAddr, amt) + if err != nil { + return err + } + + k.TrackBeforeSend(ctx, moduleAccAddr, delegatorAddr, amt) + + err = k.subUnlockedCoins(ctx, moduleAccAddr, amt) if err != nil { return err } @@ -256,9 +277,7 @@ func (k BaseKeeper) SetDenomMetaData(ctx context.Context, denomMetaData types.Me // SendCoinsFromModuleToAccount transfers coins from a ModuleAccount to an AccAddress. // It will panic if the module account does not exist. An error is returned if // the recipient address is black-listed or if sending the tokens fails. -func (k BaseKeeper) SendCoinsFromModuleToAccount( - ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, -) error { +func (k BaseKeeper) SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error { senderAddr := k.ak.GetModuleAddress(senderModule) if senderAddr == nil { panic(errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", senderModule)) @@ -271,8 +290,32 @@ func (k BaseKeeper) SendCoinsFromModuleToAccount( return k.SendCoins(ctx, senderAddr, recipientAddr, amt) } +// SendCoinsFromModuleToManyAccounts transfers coins from a ModuleAccount to multiple AccAddresses. +// It will panic if the module account does not exist. An error is returned if +// the recipient address is black-listed or if sending the tokens fails. +func (k BaseKeeper) SendCoinsFromModuleToManyAccounts(ctx context.Context, senderModule string, recipientAddrs []sdk.AccAddress, amts []sdk.Coins) error { + if len(recipientAddrs) != len(amts) { + panic(fmt.Errorf("addresses and amounts numbers does not match")) + } + + senderAddr := k.ak.GetModuleAddress(senderModule) + if senderAddr == nil { + panic(errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", senderModule)) + } + + for _, recipientAddr := range recipientAddrs { + if k.BlockedAddr(recipientAddr) { + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", recipientAddr) + } + } + + return k.SendManyCoins(ctx, senderAddr, recipientAddrs, amts) +} + // SendCoinsFromModuleToModule transfers coins from a ModuleAccount to another. // It will panic if either module account does not exist. +// SendCoinsFromModuleToModule is the only send method that does not call both BlockBeforeSend and TrackBeforeSend hook. +// It only calls the TrackBeforeSend hook. func (k BaseKeeper) SendCoinsFromModuleToModule( ctx context.Context, senderModule, recipientModule string, amt sdk.Coins, ) error { @@ -286,7 +329,7 @@ func (k BaseKeeper) SendCoinsFromModuleToModule( panic(errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", recipientModule)) } - return k.SendCoins(ctx, senderAddr, recipientAcc.GetAddress(), amt) + return k.SendCoinsWithoutBlockHook(ctx, senderAddr, recipientAcc.GetAddress(), amt) } // SendCoinsFromAccountToModule transfers coins from an AccAddress to a ModuleAccount. diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 4bb11862eb62..ac8a30b84f25 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -238,7 +238,7 @@ func (suite *KeeperTestSuite) mockDelegateCoins(ctx context.Context, acc, mAcc s if ok { suite.authKeeper.EXPECT().SetAccount(ctx, vacc) } - suite.authKeeper.EXPECT().GetAccount(ctx, acc.GetAddress()).Return(acc) + suite.authKeeper.EXPECT().GetAccount(ctx, acc.GetAddress()).Return(acc).Times(2) suite.authKeeper.EXPECT().GetAccount(ctx, mAcc.GetAddress()).Return(mAcc) } @@ -1689,18 +1689,22 @@ func (suite *KeeperTestSuite) TestDelegateCoins_Invalid() { origCoins := sdk.NewCoins(newFooCoin(100)) delCoins := sdk.NewCoins(newFooCoin(50)) + acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) suite.authKeeper.EXPECT().GetAccount(ctx, holderAcc.GetAddress()).Return(nil) require.Error(suite.bankKeeper.DelegateCoins(ctx, accAddrs[0], holderAcc.GetAddress(), delCoins)) suite.authKeeper.EXPECT().GetAccount(ctx, holderAcc.GetAddress()).Return(holderAcc) + suite.authKeeper.EXPECT().GetAccount(ctx, acc0.GetAddress()).Return(acc0) invalidCoins := sdk.Coins{sdk.Coin{Denom: "fooDenom", Amount: math.NewInt(-50)}} require.Error(suite.bankKeeper.DelegateCoins(ctx, accAddrs[0], holderAcc.GetAddress(), invalidCoins)) suite.authKeeper.EXPECT().GetAccount(ctx, holderAcc.GetAddress()).Return(holderAcc) + suite.authKeeper.EXPECT().GetAccount(ctx, acc0.GetAddress()).Return(acc0) require.Error(suite.bankKeeper.DelegateCoins(ctx, accAddrs[0], holderAcc.GetAddress(), delCoins)) suite.authKeeper.EXPECT().GetAccount(ctx, holderAcc.GetAddress()).Return(holderAcc) + suite.authKeeper.EXPECT().GetAccount(ctx, acc0.GetAddress()).Return(acc0) require.Error(suite.bankKeeper.DelegateCoins(ctx, accAddrs[0], holderAcc.GetAddress(), origCoins.Add(origCoins...))) } diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index c8aad5446f3b..9bdb922618a3 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -28,6 +28,7 @@ type SendKeeper interface { InputOutputCoins(ctx context.Context, input types.Input, outputs []types.Output) error SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error + SendManyCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddrs []sdk.AccAddress, amts []sdk.Coins) error GetParams(ctx context.Context) types.Params SetParams(ctx context.Context, params types.Params) error @@ -60,6 +61,7 @@ type BaseSendKeeper struct { ak types.AccountKeeper storeService store.KVStoreService logger log.Logger + hooks types.BankHooks // list of addresses that are restricted from receiving transactions blockedAddrs map[string]bool @@ -115,6 +117,17 @@ func (k BaseSendKeeper) GetAuthority() string { return k.authority } +// Set the bank hooks +func (k *BaseSendKeeper) SetHooks(bh types.BankHooks) *BaseSendKeeper { + if k.hooks != nil { + panic("cannot set bank hooks twice") + } + + k.hooks = bh + + return k +} + // GetParams returns the total set of bank parameters. func (k BaseSendKeeper) GetParams(ctx context.Context) (params types.Params) { p, _ := k.Params.Get(ctx) @@ -203,11 +216,29 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, return nil } +// SendCoinsWithoutBlockHook calls sendCoins without calling the `BlockBeforeSend` hook. +func (k BaseSendKeeper) SendCoinsWithoutBlockHook(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { + return k.sendCoins(ctx, fromAddr, toAddr, amt) +} + // SendCoins transfers amt coins from a sending account to a receiving account. // An error is returned upon failure. func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { - var err error - err = k.subUnlockedCoins(ctx, fromAddr, amt) + // BlockBeforeSend hook should always be called before the TrackBeforeSend hook. + err := k.BlockBeforeSend(ctx, fromAddr, toAddr, amt) + if err != nil { + return err + } + + return k.sendCoins(ctx, fromAddr, toAddr, amt) +} + +// sendCoins has the internal logic for sending coins. +func (k BaseSendKeeper) sendCoins(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { + // call the TrackBeforeSend hooks + k.TrackBeforeSend(ctx, fromAddr, toAddr, amt) + + err := k.subUnlockedCoins(ctx, fromAddr, amt) if err != nil { return err } @@ -251,6 +282,65 @@ func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccA return nil } +// SendManyCoins transfer multiple amt coins from a sending account to multiple receiving accounts. +// An error is returned upon failure. +func (k BaseSendKeeper) SendManyCoins(ctx context.Context, fromAddr sdk.AccAddress, toAddrs []sdk.AccAddress, amts []sdk.Coins) error { + if len(toAddrs) != len(amts) { + return fmt.Errorf("addresses and amounts numbers does not match") + } + + totalAmt := sdk.Coins{} + for i, amt := range amts { + // make sure to trigger the BeforeSend hooks for all the sends that are about to occur + k.TrackBeforeSend(ctx, fromAddr, toAddrs[i], amts[i]) + + err := k.BlockBeforeSend(ctx, fromAddr, toAddrs[i], amts[i]) + if err != nil { + return err + } + + totalAmt = sdk.Coins.Add(totalAmt, amt...) + } + + err := k.subUnlockedCoins(ctx, fromAddr, totalAmt) + if err != nil { + return err + } + + fromAddrString := fromAddr.String() + sdkCtx := sdk.UnwrapSDKContext(ctx) + for i, toAddr := range toAddrs { + amt := amts[i] + + err := k.addCoinsImproved(ctx, toAddr, amt) + if err != nil { + return err + } + + // Not needed for epoch code, every user must have an account + // acc := k.ak.GetAccount(ctx, toAddr) + // if acc == nil { + // defer telemetry.IncrCounter(1, "new", "account") + // k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, toAddr)) + // } + + sdkCtx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeTransfer, + sdk.NewAttribute(types.AttributeKeyRecipient, toAddr.String()), + sdk.NewAttribute(types.AttributeKeySender, fromAddrString), + sdk.NewAttribute(sdk.AttributeKeyAmount, amt.String()), + ), + }) + } + sdkCtx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(types.AttributeKeySender, fromAddr.String()), + )) + + return nil +} + // subUnlockedCoins removes the unlocked amt coins of the given account. An error is // returned if the resulting balance is negative or the initial amount is invalid. // A coin_spent event is emitted after. @@ -297,6 +387,27 @@ func (k BaseSendKeeper) subUnlockedCoins(ctx context.Context, addr sdk.AccAddres return nil } +// Better add coins implementation for code that is not gas metered. Reduces I/O overhead. +// Used in osmosis epoch. +// Also removes event that should not exist. +func (k BaseSendKeeper) addCoinsImproved(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) error { + if !amt.IsValid() { + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, amt.String()) + } + + for _, coin := range amt { + balance := k.GetBalance(ctx, addr, coin.Denom) + newBalance := balance.Add(coin) + + err := k.setBalance(ctx, addr, newBalance) + if err != nil { + return err + } + } + + return nil +} + // addCoins increase the addr balance by the given amt. Fails if the provided // amt is invalid. It emits a coin received event. func (k BaseSendKeeper) addCoins(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) error { diff --git a/x/bank/keeper/supply_offset.go b/x/bank/keeper/supply_offset.go new file mode 100644 index 000000000000..155a19fdc074 --- /dev/null +++ b/x/bank/keeper/supply_offset.go @@ -0,0 +1,127 @@ +package keeper + +import ( + "context" + "fmt" + + "cosmossdk.io/math" + "cosmossdk.io/store/prefix" + + "github.com/cosmos/cosmos-sdk/runtime" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/bank/types" +) + +// GetSupplyOffset retrieves the SupplyOffset from store for a specific denom +func (k BaseViewKeeper) GetSupplyOffset(ctx context.Context, denom string) math.Int { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + supplyOffsetStore := prefix.NewStore(store, types.SupplyOffsetKey) + + bz := supplyOffsetStore.Get([]byte(denom)) + if bz == nil { + return math.NewInt(0) + } + + var amount math.Int + err := amount.Unmarshal(bz) + if err != nil { + panic(fmt.Errorf("unable to unmarshal supply offset value %v", err)) + } + + return amount +} + +// setSupplyOffset sets the supply offset for the given denom +func (k BaseKeeper) setSupplyOffset(ctx context.Context, denom string, offsetAmount math.Int) { + intBytes, err := offsetAmount.Marshal() + if err != nil { + panic(fmt.Errorf("unable to marshal amount value %v", err)) + } + + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + supplyOffsetStore := prefix.NewStore(store, types.SupplyOffsetKey) + + // Bank invariants and IBC requires to remove zero coins. + if offsetAmount.IsZero() { + supplyOffsetStore.Delete([]byte(denom)) + } else { + supplyOffsetStore.Set([]byte(denom), intBytes) + } +} + +// AddSupplyOffset adjusts the current supply offset of a denom by the inputted offsetAmount +func (k BaseKeeper) AddSupplyOffset(ctx context.Context, denom string, offsetAmount math.Int) { + k.setSupplyOffset(ctx, denom, k.GetSupplyOffset(ctx, denom).Add(offsetAmount)) +} + +// GetSupplyWithOffset retrieves the Supply of a denom and offsets it by SupplyOffset +// If SupplyWithOffset is negative, it returns 0. This is because sdk.Coin is not valid +// with a negative amount +func (k BaseKeeper) GetSupplyWithOffset(ctx context.Context, denom string) sdk.Coin { + supply := k.GetSupply(ctx, denom) + supply.Amount = supply.Amount.Add(k.GetSupplyOffset(ctx, denom)) + + if supply.Amount.IsNegative() { + supply.Amount = math.ZeroInt() + } + + return supply +} + +// GetPaginatedTotalSupplyWithOffsets queries for the supply with offset, ignoring 0 coins, with a given pagination +func (k BaseKeeper) GetPaginatedTotalSupplyWithOffsets(ctx context.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + supplyStore := prefix.NewStore(store, types.SupplyKey) + + supply := sdk.NewCoins() + + pageRes, err := query.Paginate(supplyStore, pagination, func(key, value []byte) error { + denom := string(key) + + var amount math.Int + err := amount.Unmarshal(value) + if err != nil { + return fmt.Errorf("unable to convert amount string to Int %v", err) + } + + amount = amount.Add(k.GetSupplyOffset(ctx, denom)) + + // `Add` omits the 0 coins addition to the `supply`. + supply = supply.Add(sdk.NewCoin(denom, amount)) + return nil + }) + if err != nil { + return nil, nil, err + } + + return supply, pageRes, nil +} + +// IterateTotalSupplyWithOffsets iterates over the total supply with offsets calling the given cb (callback) function +// with the balance of each coin. +// The iteration stops if the callback returns true. +func (k BaseViewKeeper) IterateTotalSupplyWithOffsets(ctx context.Context, cb func(sdk.Coin) bool) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + supplyStore := prefix.NewStore(store, types.SupplyKey) + + iterator := supplyStore.Iterator(nil, nil) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var amount math.Int + err := amount.Unmarshal(iterator.Value()) + if err != nil { + panic(fmt.Errorf("unable to unmarshal supply value %v", err)) + } + + balance := sdk.Coin{ + Denom: string(iterator.Key()), + Amount: amount.Add(k.GetSupplyOffset(ctx, string(iterator.Key()))), + } + + if cb(balance) { + break + } + } +} diff --git a/x/bank/migrations/v1/types.go b/x/bank/migrations/v1/types.go index 851f7e317a95..dbe318536241 100644 --- a/x/bank/migrations/v1/types.go +++ b/x/bank/migrations/v1/types.go @@ -29,6 +29,7 @@ var ( BalancesPrefix = []byte("balances") SupplyKey = []byte{0x00} DenomMetadataPrefix = []byte{0x1} + SupplyOffsetKey = []byte{0x88} ) // DenomMetadataKey returns the denomination metadata key. diff --git a/x/bank/migrations/v2/keys.go b/x/bank/migrations/v2/keys.go index eadb02e9d8d8..a21cd17d2647 100644 --- a/x/bank/migrations/v2/keys.go +++ b/x/bank/migrations/v2/keys.go @@ -15,6 +15,7 @@ var ( SupplyKey = []byte{0x00} BalancesPrefix = []byte{0x02} DenomMetadataPrefix = []byte{0x1} + SupplyOffsetKey = []byte{0x88} ErrInvalidKey = errors.New("invalid key") ) diff --git a/x/bank/migrations/v4/gen_state_test.go b/x/bank/migrations/v4/gen_state_test.go index 1283e65b7842..1314ce8fd4b8 100644 --- a/x/bank/migrations/v4/gen_state_test.go +++ b/x/bank/migrations/v4/gen_state_test.go @@ -156,6 +156,6 @@ func TestMigrateGenState(t *testing.T) { }, } _ = v4.MigrateGenState(&origState) - assert.Len(t, origState.Params.SendEnabled, 2) //nolint:staticcheck // keep for test (linter sometimes fails) + assert.Len(t, origState.Params.SendEnabled, 2) }) } diff --git a/x/bank/testutil/expected_keepers_mocks.go b/x/bank/testutil/expected_keepers_mocks.go index fcdfd8a472e6..b8df326a09b6 100644 --- a/x/bank/testutil/expected_keepers_mocks.go +++ b/x/bank/testutil/expected_keepers_mocks.go @@ -242,3 +242,52 @@ func (mr *MockAccountKeeperMockRecorder) ValidatePermissions(macc interface{}) * mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePermissions", reflect.TypeOf((*MockAccountKeeper)(nil).ValidatePermissions), macc) } + +// MockBankHooks is a mock of BankHooks interface. +type MockBankHooks struct { + ctrl *gomock.Controller + recorder *MockBankHooksMockRecorder +} + +// MockBankHooksMockRecorder is the mock recorder for MockBankHooks. +type MockBankHooksMockRecorder struct { + mock *MockBankHooks +} + +// NewMockBankHooks creates a new mock instance. +func NewMockBankHooks(ctrl *gomock.Controller) *MockBankHooks { + mock := &MockBankHooks{ctrl: ctrl} + mock.recorder = &MockBankHooksMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockBankHooks) EXPECT() *MockBankHooksMockRecorder { + return m.recorder +} + +// BlockBeforeSend mocks base method. +func (m *MockBankHooks) BlockBeforeSend(ctx context.Context, from, to types.AccAddress, amount types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockBeforeSend", ctx, from, to, amount) + ret0, _ := ret[0].(error) + return ret0 +} + +// BlockBeforeSend indicates an expected call of BlockBeforeSend. +func (mr *MockBankHooksMockRecorder) BlockBeforeSend(ctx, from, to, amount interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockBeforeSend", reflect.TypeOf((*MockBankHooks)(nil).BlockBeforeSend), ctx, from, to, amount) +} + +// TrackBeforeSend mocks base method. +func (m *MockBankHooks) TrackBeforeSend(ctx context.Context, from, to types.AccAddress, amount types.Coins) { + m.ctrl.T.Helper() + m.ctrl.Call(m, "TrackBeforeSend", ctx, from, to, amount) +} + +// TrackBeforeSend indicates an expected call of TrackBeforeSend. +func (mr *MockBankHooksMockRecorder) TrackBeforeSend(ctx, from, to, amount interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TrackBeforeSend", reflect.TypeOf((*MockBankHooks)(nil).TrackBeforeSend), ctx, from, to, amount) +} diff --git a/x/bank/types/expected_keepers.go b/x/bank/types/expected_keepers.go index ebd5eb9a657e..ef251be18aeb 100644 --- a/x/bank/types/expected_keepers.go +++ b/x/bank/types/expected_keepers.go @@ -33,3 +33,15 @@ type AccountKeeper interface { SetModuleAccount(ctx context.Context, macc sdk.ModuleAccountI) GetModulePermissions() map[string]types.PermissionsForAddress } + +// Event Hooks +// These can be utilized to communicate between a bank keeper and another +// keeper which must take particular actions when sends happen. +// The second keeper must implement this interface, which then the +// bank keeper can call. + +// BankHooks event hooks for bank sends +type BankHooks interface { + TrackBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) // Must be before any send is executed + BlockBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) error // Must be before any send is executed +} diff --git a/x/bank/types/hooks.go b/x/bank/types/hooks.go new file mode 100644 index 000000000000..6f76208ef1d0 --- /dev/null +++ b/x/bank/types/hooks.go @@ -0,0 +1,33 @@ +package types + +import ( + context "context" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// MultiBankHooks combine multiple bank hooks, all hook functions are run in array sequence +type MultiBankHooks []BankHooks + +// NewMultiBankHooks takes a list of BankHooks and returns a MultiBankHooks +func NewMultiBankHooks(hooks ...BankHooks) MultiBankHooks { + return hooks +} + +// TrackBeforeSend runs the TrackBeforeSend hooks in order for each BankHook in a MultiBankHooks struct +func (h MultiBankHooks) TrackBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) { + for i := range h { + h[i].TrackBeforeSend(ctx, from, to, amount) + } +} + +// BlockBeforeSend runs the BlockBeforeSend hooks in order for each BankHook in a MultiBankHooks struct +func (h MultiBankHooks) BlockBeforeSend(ctx context.Context, from, to sdk.AccAddress, amount sdk.Coins) error { + for i := range h { + err := h[i].BlockBeforeSend(ctx, from, to, amount) + if err != nil { + return err + } + } + return nil +} diff --git a/x/bank/types/keys.go b/x/bank/types/keys.go index b4ea683d4b69..68eb56a0538e 100644 --- a/x/bank/types/keys.go +++ b/x/bank/types/keys.go @@ -32,6 +32,8 @@ var ( // ParamsKey is the prefix for x/bank parameters ParamsKey = collections.NewPrefix(5) + + SupplyOffsetKey = collections.NewPrefix(88) ) // BalanceValueCodec is a codec for encoding bank balances in a backwards compatible way. diff --git a/x/bank/types/query.pb.go b/x/bank/types/query.pb.go index 7ad551138110..bb6192d9df4c 100644 --- a/x/bank/types/query.pb.go +++ b/x/bank/types/query.pb.go @@ -609,6 +609,198 @@ func (m *QuerySupplyOfResponse) GetAmount() types.Coin { return types.Coin{} } +// QueryTotalSupplyWithoutOffsetRequest is the request type for the Query/TotalSupplyWithoutOffset RPC +// method. +type QueryTotalSupplyWithoutOffsetRequest struct { + // pagination defines an optional pagination for the request. + // + // Since: cosmos-sdk 0.43 + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTotalSupplyWithoutOffsetRequest) Reset() { *m = QueryTotalSupplyWithoutOffsetRequest{} } +func (m *QueryTotalSupplyWithoutOffsetRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyWithoutOffsetRequest) ProtoMessage() {} +func (*QueryTotalSupplyWithoutOffsetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{12} +} +func (m *QueryTotalSupplyWithoutOffsetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyWithoutOffsetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyWithoutOffsetRequest.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 *QueryTotalSupplyWithoutOffsetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyWithoutOffsetRequest.Merge(m, src) +} +func (m *QueryTotalSupplyWithoutOffsetRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyWithoutOffsetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyWithoutOffsetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyWithoutOffsetRequest proto.InternalMessageInfo + +// QueryTotalSupplyWithoutOffsetResponse is the response type for the Query/TotalSupplyWithoutOffset RPC +// method +type QueryTotalSupplyWithoutOffsetResponse struct { + // supply is the supply of the coins + Supply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=supply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"supply"` + // pagination defines the pagination in the response. + // + // Since: cosmos-sdk 0.43 + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryTotalSupplyWithoutOffsetResponse) Reset() { *m = QueryTotalSupplyWithoutOffsetResponse{} } +func (m *QueryTotalSupplyWithoutOffsetResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTotalSupplyWithoutOffsetResponse) ProtoMessage() {} +func (*QueryTotalSupplyWithoutOffsetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{13} +} +func (m *QueryTotalSupplyWithoutOffsetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTotalSupplyWithoutOffsetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTotalSupplyWithoutOffsetResponse.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 *QueryTotalSupplyWithoutOffsetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTotalSupplyWithoutOffsetResponse.Merge(m, src) +} +func (m *QueryTotalSupplyWithoutOffsetResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTotalSupplyWithoutOffsetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTotalSupplyWithoutOffsetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTotalSupplyWithoutOffsetResponse proto.InternalMessageInfo + +func (m *QueryTotalSupplyWithoutOffsetResponse) GetSupply() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Supply + } + return nil +} + +func (m *QueryTotalSupplyWithoutOffsetResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QuerySupplyOfWithoutOffsetRequest is the request type for the Query/SupplyOfWithoutOffset RPC method. +type QuerySupplyOfWithoutOffsetRequest struct { + // denom is the coin denom to query balances for. + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QuerySupplyOfWithoutOffsetRequest) Reset() { *m = QuerySupplyOfWithoutOffsetRequest{} } +func (m *QuerySupplyOfWithoutOffsetRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySupplyOfWithoutOffsetRequest) ProtoMessage() {} +func (*QuerySupplyOfWithoutOffsetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{14} +} +func (m *QuerySupplyOfWithoutOffsetRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyOfWithoutOffsetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyOfWithoutOffsetRequest.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 *QuerySupplyOfWithoutOffsetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyOfWithoutOffsetRequest.Merge(m, src) +} +func (m *QuerySupplyOfWithoutOffsetRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyOfWithoutOffsetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyOfWithoutOffsetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyOfWithoutOffsetRequest proto.InternalMessageInfo + +func (m *QuerySupplyOfWithoutOffsetRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QuerySupplyOfWithoutOffsetResponse is the response type for the Query/SupplyOfWithoutOffset RPC method. +type QuerySupplyOfWithoutOffsetResponse struct { + // amount is the supply of the coin. + Amount types.Coin `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount"` +} + +func (m *QuerySupplyOfWithoutOffsetResponse) Reset() { *m = QuerySupplyOfWithoutOffsetResponse{} } +func (m *QuerySupplyOfWithoutOffsetResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySupplyOfWithoutOffsetResponse) ProtoMessage() {} +func (*QuerySupplyOfWithoutOffsetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9c6fc1939682df13, []int{15} +} +func (m *QuerySupplyOfWithoutOffsetResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySupplyOfWithoutOffsetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySupplyOfWithoutOffsetResponse.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 *QuerySupplyOfWithoutOffsetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySupplyOfWithoutOffsetResponse.Merge(m, src) +} +func (m *QuerySupplyOfWithoutOffsetResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySupplyOfWithoutOffsetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySupplyOfWithoutOffsetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySupplyOfWithoutOffsetResponse proto.InternalMessageInfo + +func (m *QuerySupplyOfWithoutOffsetResponse) GetAmount() types.Coin { + if m != nil { + return m.Amount + } + return types.Coin{} +} + // QueryParamsRequest defines the request type for querying x/bank parameters. type QueryParamsRequest struct { } @@ -617,7 +809,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{16} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -656,7 +848,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{17} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -702,7 +894,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{18} } func (m *QueryDenomsMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -751,7 +943,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{19} } func (m *QueryDenomsMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -804,7 +996,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{20} } func (m *QueryDenomMetadataRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -851,7 +1043,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{21} } func (m *QueryDenomMetadataResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -900,7 +1092,7 @@ func (m *QueryDenomMetadataByQueryStringRequest) Reset() { func (m *QueryDenomMetadataByQueryStringRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomMetadataByQueryStringRequest) ProtoMessage() {} func (*QueryDenomMetadataByQueryStringRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{18} + return fileDescriptor_9c6fc1939682df13, []int{22} } func (m *QueryDenomMetadataByQueryStringRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -949,7 +1141,7 @@ func (m *QueryDenomMetadataByQueryStringResponse) Reset() { func (m *QueryDenomMetadataByQueryStringResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomMetadataByQueryStringResponse) ProtoMessage() {} func (*QueryDenomMetadataByQueryStringResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{19} + return fileDescriptor_9c6fc1939682df13, []int{23} } func (m *QueryDenomMetadataByQueryStringResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -999,7 +1191,7 @@ func (m *QueryDenomOwnersRequest) Reset() { *m = QueryDenomOwnersRequest func (m *QueryDenomOwnersRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomOwnersRequest) ProtoMessage() {} func (*QueryDenomOwnersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{20} + return fileDescriptor_9c6fc1939682df13, []int{24} } func (m *QueryDenomOwnersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1058,7 +1250,7 @@ func (m *DenomOwner) Reset() { *m = DenomOwner{} } func (m *DenomOwner) String() string { return proto.CompactTextString(m) } func (*DenomOwner) ProtoMessage() {} func (*DenomOwner) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{21} + return fileDescriptor_9c6fc1939682df13, []int{25} } func (m *DenomOwner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1114,7 +1306,7 @@ func (m *QueryDenomOwnersResponse) Reset() { *m = QueryDenomOwnersRespon func (m *QueryDenomOwnersResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomOwnersResponse) ProtoMessage() {} func (*QueryDenomOwnersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{22} + return fileDescriptor_9c6fc1939682df13, []int{26} } func (m *QueryDenomOwnersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1173,7 +1365,7 @@ func (m *QueryDenomOwnersByQueryRequest) Reset() { *m = QueryDenomOwners func (m *QueryDenomOwnersByQueryRequest) String() string { return proto.CompactTextString(m) } func (*QueryDenomOwnersByQueryRequest) ProtoMessage() {} func (*QueryDenomOwnersByQueryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{23} + return fileDescriptor_9c6fc1939682df13, []int{27} } func (m *QueryDenomOwnersByQueryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1229,7 +1421,7 @@ func (m *QueryDenomOwnersByQueryResponse) Reset() { *m = QueryDenomOwner func (m *QueryDenomOwnersByQueryResponse) String() string { return proto.CompactTextString(m) } func (*QueryDenomOwnersByQueryResponse) ProtoMessage() {} func (*QueryDenomOwnersByQueryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{24} + return fileDescriptor_9c6fc1939682df13, []int{28} } func (m *QueryDenomOwnersByQueryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1287,7 +1479,7 @@ func (m *QuerySendEnabledRequest) Reset() { *m = QuerySendEnabledRequest func (m *QuerySendEnabledRequest) String() string { return proto.CompactTextString(m) } func (*QuerySendEnabledRequest) ProtoMessage() {} func (*QuerySendEnabledRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{25} + return fileDescriptor_9c6fc1939682df13, []int{29} } func (m *QuerySendEnabledRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1344,7 +1536,7 @@ func (m *QuerySendEnabledResponse) Reset() { *m = QuerySendEnabledRespon func (m *QuerySendEnabledResponse) String() string { return proto.CompactTextString(m) } func (*QuerySendEnabledResponse) ProtoMessage() {} func (*QuerySendEnabledResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9c6fc1939682df13, []int{26} + return fileDescriptor_9c6fc1939682df13, []int{30} } func (m *QuerySendEnabledResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1400,6 +1592,10 @@ func init() { 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((*QueryTotalSupplyWithoutOffsetRequest)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetRequest") + proto.RegisterType((*QueryTotalSupplyWithoutOffsetResponse)(nil), "cosmos.bank.v1beta1.QueryTotalSupplyWithoutOffsetResponse") + proto.RegisterType((*QuerySupplyOfWithoutOffsetRequest)(nil), "cosmos.bank.v1beta1.QuerySupplyOfWithoutOffsetRequest") + proto.RegisterType((*QuerySupplyOfWithoutOffsetResponse)(nil), "cosmos.bank.v1beta1.QuerySupplyOfWithoutOffsetResponse") proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.bank.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.bank.v1beta1.QueryParamsResponse") proto.RegisterType((*QueryDenomsMetadataRequest)(nil), "cosmos.bank.v1beta1.QueryDenomsMetadataRequest") @@ -1420,91 +1616,98 @@ func init() { func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) } var fileDescriptor_9c6fc1939682df13 = []byte{ - // 1336 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x58, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0xa4, 0xaa, 0x93, 0x3c, 0xa7, 0x48, 0x99, 0x06, 0x9a, 0x6c, 0x88, 0x1d, 0x36, 0x55, - 0xe2, 0x84, 0x64, 0xb7, 0x71, 0xa2, 0x42, 0x4b, 0x88, 0x14, 0xa7, 0xa4, 0x07, 0x84, 0x5a, 0x1c, - 0x7a, 0x81, 0x83, 0xb5, 0xf6, 0x0e, 0xc6, 0x8a, 0xbd, 0xeb, 0x7a, 0x36, 0x2d, 0xab, 0x2a, 0x08, - 0x21, 0x21, 0xf5, 0x88, 0x44, 0x4f, 0x95, 0x90, 0x22, 0x24, 0xa0, 0x02, 0xa9, 0xea, 0x81, 0x03, - 0x07, 0x8e, 0x1c, 0x2a, 0x4e, 0x15, 0x1c, 0x40, 0x1c, 0x0a, 0x4a, 0x90, 0xda, 0x9f, 0x81, 0x3c, - 0x33, 0xeb, 0xdd, 0xb5, 0xd7, 0xeb, 0x8d, 0x6b, 0xaa, 0xaa, 0x97, 0xc4, 0x9e, 0x79, 0x6f, 0xde, - 0xf7, 0xbe, 0x79, 0xf3, 0xe6, 0x1b, 0x43, 0xaa, 0x68, 0xd2, 0xaa, 0x49, 0xd5, 0x82, 0x66, 0xec, - 0xa8, 0xd7, 0x96, 0x0b, 0xc4, 0xd2, 0x96, 0xd5, 0xab, 0xbb, 0xa4,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, 0x69, 0x50, 0x82, 0x57, 0x60, 0xb0, 0xc0, 0x87, 0x58, 0xac, 0x44, 0x66, 0x42, 0x69, 0x6e, - 0x0a, 0x25, 0xce, 0xa6, 0x28, 0x9b, 0x66, 0xd9, 0xc8, 0x39, 0x96, 0xf2, 0x2f, 0x08, 0x4e, 0xb1, - 0xd5, 0x36, 0x2a, 0x15, 0xb1, 0x20, 0x7d, 0x12, 0xf0, 0x5b, 0x00, 0xee, 0xd6, 0xb2, 0x0c, 0x12, - 0x99, 0x59, 0x1f, 0x0e, 0x4e, 0xa4, 0x83, 0xe6, 0xb2, 0x56, 0x72, 0xc8, 0xca, 0x79, 0x3c, 0xf1, - 0x0c, 0x9c, 0xa8, 0x13, 0x6a, 0x56, 0xae, 0x91, 0x3c, 0x27, 0xe3, 0xd8, 0x34, 0x4a, 0x0f, 0xe5, - 0x46, 0xc4, 0xe0, 0x85, 0x16, 0x4e, 0x0e, 0x10, 0x8c, 0xb7, 0xa7, 0x21, 0x88, 0xd9, 0x83, 0x21, - 0x91, 0x6e, 0x23, 0x91, 0x63, 0xa1, 0xcc, 0x64, 0xb7, 0xee, 0x3f, 0x4c, 0xc5, 0xbe, 0xff, 0x3b, - 0x95, 0x2e, 0x95, 0xad, 0x8f, 0x76, 0x0b, 0x4a, 0xd1, 0xac, 0x8a, 0xca, 0x10, 0xff, 0x96, 0xa8, - 0xbe, 0xa3, 0x5a, 0x76, 0x8d, 0x50, 0xe6, 0x40, 0x6f, 0x3f, 0xba, 0xb7, 0x30, 0x52, 0x21, 0x25, - 0xad, 0x68, 0xe7, 0x1b, 0xb5, 0x47, 0xef, 0x3c, 0xba, 0xb7, 0x80, 0x72, 0xcd, 0x90, 0xf8, 0x62, - 0x00, 0x25, 0x73, 0x5d, 0x29, 0xe1, 0xd8, 0xbd, 0x9c, 0xc8, 0xdf, 0x20, 0x98, 0x62, 0x49, 0x6e, - 0xd7, 0x88, 0xa1, 0x6b, 0x85, 0x0a, 0x79, 0x86, 0x76, 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4, 0xe8, 0x7e, 0xd5, 0x27, 0xad, 0x1e, 0xcd, 0x49, 0x20, 0x7f, 0xcd, 0x45, 0xbe, 0x88, 0x17, - 0xba, 0x22, 0x6f, 0xd6, 0x03, 0xbe, 0x8d, 0x20, 0xe1, 0x51, 0x25, 0x61, 0xfc, 0xb6, 0x0b, 0xaf, - 0x30, 0x7e, 0x03, 0xa4, 0x92, 0xac, 0xb8, 0x28, 0x67, 0xf0, 0x2b, 0xc1, 0xbd, 0xcb, 0x23, 0xa5, - 0xb2, 0x9b, 0xf7, 0x0f, 0x92, 0xe8, 0xc1, 0x41, 0x12, 0xfd, 0x73, 0x90, 0x44, 0x5f, 0x1c, 0x26, - 0x63, 0x0f, 0x0e, 0x93, 0xb1, 0x3f, 0x0f, 0x93, 0xb1, 0xf7, 0xe7, 0x43, 0x7f, 0xc5, 0xf8, 0x98, - 0xaf, 0xc9, 0x7e, 0xcc, 0x28, 0xc4, 0xd9, 0x6f, 0xd0, 0x2b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, - 0x46, 0x5f, 0xc6, 0x98, 0xa6, 0x17, 0x00, 0x00, + // 1454 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xf6, 0xb4, 0xd4, 0x4d, 0x9e, 0x53, 0xa4, 0x4e, 0x5d, 0x9a, 0x6e, 0xa8, 0xdd, 0x6e, 0x4b, + 0xe3, 0x84, 0xd4, 0xdb, 0x38, 0x51, 0x43, 0x42, 0x08, 0x8a, 0x53, 0xd2, 0x03, 0x42, 0x29, 0x0e, + 0x15, 0x12, 0x08, 0xad, 0xd6, 0xf6, 0xc6, 0xb5, 0x62, 0xef, 0xba, 0x9e, 0x75, 0x53, 0xab, 0x0a, + 0x42, 0x48, 0x48, 0x3d, 0x22, 0xd1, 0x53, 0x25, 0xa4, 0x08, 0x09, 0xa8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0xbd, 0xb8, 0x44, 0x7e, 0xbf, 0x68, 0x5d, 0x36, 0x6b, 0xd6, 0xca, 0xda, 0x1a, 0xd1, 0xad, 0x27, + 0x97, 0xdf, 0xff, 0x10, 0xbc, 0xd2, 0x25, 0xf4, 0x73, 0x94, 0xec, 0x59, 0x38, 0xe1, 0x49, 0x9f, + 0x50, 0x64, 0x71, 0xe6, 0x3f, 0x02, 0xd9, 0xcf, 0x95, 0x8b, 0x34, 0x13, 0xbc, 0x0c, 0x5e, 0x68, + 0x88, 0xd4, 0xac, 0x80, 0x28, 0x60, 0xba, 0xfd, 0x45, 0xad, 0xaa, 0x95, 0xed, 0x3b, 0x43, 0xbe, + 0xc4, 0x3b, 0x17, 0x7b, 0x95, 0x47, 0x59, 0x80, 0x70, 0x85, 0xae, 0xf0, 0x28, 0x23, 0x49, 0x41, + 0x87, 0x97, 0x64, 0x4e, 0x9e, 0x72, 0x63, 0x5e, 0x72, 0x1e, 0x24, 0xba, 0x2d, 0x3d, 0x8c, 0xc8, + 0x3b, 0xba, 0xa5, 0xe5, 0x35, 0x4b, 0xeb, 0x73, 0x91, 0xc9, 0x77, 0x10, 0x8c, 0x08, 0xc3, 0x70, + 0x16, 0xcb, 0x30, 0x58, 0xe6, 0x6b, 0xf6, 0x45, 0x73, 0x4c, 0x48, 0xc4, 0xf6, 0x74, 0x53, 0x71, + 0x5c, 0xfb, 0x57, 0x1d, 0x93, 0x70, 0xd4, 0xc1, 0xdb, 0xaa, 0x8a, 0xb8, 0x2a, 0xb2, 0x6e, 0x25, + 0xdb, 0x18, 0x9e, 0x87, 0x01, 0x1b, 0x26, 0xd7, 0x31, 0x38, 0xc1, 0xa6, 0xa7, 0xbc, 0x00, 0xa7, + 0xdb, 0x63, 0xa4, 0xeb, 0xac, 0x1a, 0xd9, 0xc5, 0xe4, 0x8b, 0xd1, 0x84, 0xd1, 0xae, 0xfe, 0x7d, + 0x05, 0xbc, 0xc1, 0x2f, 0x28, 0x1a, 0x70, 0x65, 0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, 0x8a, 0xee, 0x6d, 0xc7, 0xa5, + 0xe9, 0xdd, 0x39, 0x05, 0x3f, 0xe7, 0xdc, 0xc8, 0x9b, 0xf5, 0x80, 0x6f, 0x21, 0x88, 0xb8, 0xda, + 0x45, 0x3f, 0x7d, 0xdb, 0x3b, 0x62, 0x3f, 0x7d, 0x05, 0x3d, 0xac, 0x9c, 0x74, 0x50, 0x9e, 0xc4, + 0x27, 0xc4, 0x27, 0x99, 0xab, 0xc7, 0x4d, 0x2f, 0xdd, 0xdb, 0x8e, 0xa1, 0xfb, 0xdb, 0x31, 0xf4, + 0xcf, 0x76, 0x0c, 0x7d, 0xbe, 0x13, 0x0b, 0xdd, 0xdf, 0x89, 0x85, 0xfe, 0xdc, 0x89, 0x85, 0x3e, + 0x18, 0xf3, 0xfd, 0xcd, 0xe9, 0x1a, 0xdb, 0x93, 0xfe, 0xf4, 0x94, 0x0d, 0xd3, 0x3f, 0x0f, 0x4d, + 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x44, 0x9e, 0xca, 0xd8, 0x41, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1552,6 +1755,10 @@ type QueryClient interface { // When called from another module, this query might consume a high amount of // gas if the pagination field is incorrectly set. SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, opts ...grpc.CallOption) (*QuerySupplyOfResponse, error) + // TotalSupplyWithoutOffset queries the total supply of all coins. + TotalSupplyWithoutOffset(ctx context.Context, in *QueryTotalSupplyWithoutOffsetRequest, opts ...grpc.CallOption) (*QueryTotalSupplyWithoutOffsetResponse, error) + // SupplyOf queries the supply of a single coin. + SupplyOfWithoutOffset(ctx context.Context, in *QuerySupplyOfWithoutOffsetRequest, opts ...grpc.CallOption) (*QuerySupplyOfWithoutOffsetResponse, error) // Params queries the parameters of x/bank module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // DenomMetadata queries the client metadata of a given coin denomination. @@ -1646,6 +1853,24 @@ func (c *queryClient) SupplyOf(ctx context.Context, in *QuerySupplyOfRequest, op return out, nil } +func (c *queryClient) TotalSupplyWithoutOffset(ctx context.Context, in *QueryTotalSupplyWithoutOffsetRequest, opts ...grpc.CallOption) (*QueryTotalSupplyWithoutOffsetResponse, error) { + out := new(QueryTotalSupplyWithoutOffsetResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/TotalSupplyWithoutOffset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SupplyOfWithoutOffset(ctx context.Context, in *QuerySupplyOfWithoutOffsetRequest, opts ...grpc.CallOption) (*QuerySupplyOfWithoutOffsetResponse, error) { + out := new(QuerySupplyOfWithoutOffsetResponse) + err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/SupplyOfWithoutOffset", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { out := new(QueryParamsResponse) err := c.cc.Invoke(ctx, "/cosmos.bank.v1beta1.Query/Params", in, out, opts...) @@ -1744,6 +1969,10 @@ type QueryServer interface { // When called from another module, this query might consume a high amount of // gas if the pagination field is incorrectly set. SupplyOf(context.Context, *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) + // TotalSupplyWithoutOffset queries the total supply of all coins. + TotalSupplyWithoutOffset(context.Context, *QueryTotalSupplyWithoutOffsetRequest) (*QueryTotalSupplyWithoutOffsetResponse, error) + // SupplyOf queries the supply of a single coin. + SupplyOfWithoutOffset(context.Context, *QuerySupplyOfWithoutOffsetRequest) (*QuerySupplyOfWithoutOffsetResponse, error) // Params queries the parameters of x/bank module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // DenomMetadata queries the client metadata of a given coin denomination. @@ -1798,6 +2027,12 @@ func (*UnimplementedQueryServer) TotalSupply(ctx context.Context, req *QueryTota func (*UnimplementedQueryServer) SupplyOf(ctx context.Context, req *QuerySupplyOfRequest) (*QuerySupplyOfResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SupplyOf not implemented") } +func (*UnimplementedQueryServer) TotalSupplyWithoutOffset(ctx context.Context, req *QueryTotalSupplyWithoutOffsetRequest) (*QueryTotalSupplyWithoutOffsetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalSupplyWithoutOffset not implemented") +} +func (*UnimplementedQueryServer) SupplyOfWithoutOffset(ctx context.Context, req *QuerySupplyOfWithoutOffsetRequest) (*QuerySupplyOfWithoutOffsetResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SupplyOfWithoutOffset not implemented") +} func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } @@ -1932,6 +2167,42 @@ func _Query_SupplyOf_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Query_TotalSupplyWithoutOffset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTotalSupplyWithoutOffsetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalSupplyWithoutOffset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/TotalSupplyWithoutOffset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalSupplyWithoutOffset(ctx, req.(*QueryTotalSupplyWithoutOffsetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SupplyOfWithoutOffset_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySupplyOfWithoutOffsetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SupplyOfWithoutOffset(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.bank.v1beta1.Query/SupplyOfWithoutOffset", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SupplyOfWithoutOffset(ctx, req.(*QuerySupplyOfWithoutOffsetRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryParamsRequest) if err := dec(in); err != nil { @@ -2086,6 +2357,14 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "SupplyOf", Handler: _Query_SupplyOf_Handler, }, + { + MethodName: "TotalSupplyWithoutOffset", + Handler: _Query_TotalSupplyWithoutOffset_Handler, + }, + { + MethodName: "SupplyOfWithoutOffset", + Handler: _Query_SupplyOfWithoutOffset_Handler, + }, { MethodName: "Params", Handler: _Query_Params_Handler, @@ -2602,7 +2881,7 @@ func (m *QuerySupplyOfResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryTotalSupplyWithoutOffsetRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2612,20 +2891,32 @@ func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryTotalSupplyWithoutOffsetRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryTotalSupplyWithoutOffsetRequest) 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] = 0xa + } return len(dAtA) - i, nil } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryTotalSupplyWithoutOffsetResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2635,30 +2926,46 @@ func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryTotalSupplyWithoutOffsetResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryTotalSupplyWithoutOffsetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + 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.Supply) > 0 { + for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Supply[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryDenomsMetadataRequest) Marshal() (dAtA []byte, err error) { +func (m *QuerySupplyOfWithoutOffsetRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2668,19 +2975,138 @@ func (m *QueryDenomsMetadataRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryDenomsMetadataRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QuerySupplyOfWithoutOffsetRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryDenomsMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QuerySupplyOfWithoutOffsetRequest) 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 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 *QuerySupplyOfWithoutOffsetResponse) 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 *QuerySupplyOfWithoutOffsetResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySupplyOfWithoutOffsetResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Amount.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 *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.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 *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 dAtA[:n], nil +} + +func (m *QueryDenomsMetadataRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDenomsMetadataRequest) 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 } @@ -3389,6 +3815,62 @@ func (m *QuerySupplyOfResponse) Size() (n int) { return n } +func (m *QueryTotalSupplyWithoutOffsetRequest) 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 *QueryTotalSupplyWithoutOffsetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Supply) > 0 { + for _, e := range m.Supply { + 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 *QuerySupplyOfWithoutOffsetRequest) 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 *QuerySupplyOfWithoutOffsetResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 @@ -4887,6 +5369,377 @@ func (m *QuerySupplyOfResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryTotalSupplyWithoutOffsetRequest) 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: QueryTotalSupplyWithoutOffsetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyWithoutOffsetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 *QueryTotalSupplyWithoutOffsetResponse) 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: QueryTotalSupplyWithoutOffsetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTotalSupplyWithoutOffsetResponse: 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) + } + 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.Supply = append(m.Supply, types.Coin{}) + if err := m.Supply[len(m.Supply)-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 *QuerySupplyOfWithoutOffsetRequest) 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: QuerySupplyOfWithoutOffsetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyOfWithoutOffsetRequest: 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:]) + 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 *QuerySupplyOfWithoutOffsetResponse) 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: QuerySupplyOfWithoutOffsetResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySupplyOfWithoutOffsetResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var 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 err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/bank/types/query.pb.gw.go b/x/bank/types/query.pb.gw.go index 58bc742a7322..9a44b2aa6122 100644 --- a/x/bank/types/query.pb.gw.go +++ b/x/bank/types/query.pb.gw.go @@ -393,6 +393,96 @@ func local_request_Query_SupplyOf_0(ctx context.Context, marshaler runtime.Marsh } +var ( + filter_Query_TotalSupplyWithoutOffset_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_TotalSupplyWithoutOffset_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyWithoutOffsetRequest + 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_TotalSupplyWithoutOffset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TotalSupplyWithoutOffset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalSupplyWithoutOffset_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTotalSupplyWithoutOffsetRequest + 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_TotalSupplyWithoutOffset_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TotalSupplyWithoutOffset(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_SupplyOfWithoutOffset_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySupplyOfWithoutOffsetRequest + 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.SupplyOfWithoutOffset(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SupplyOfWithoutOffset_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySupplyOfWithoutOffsetRequest + 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.SupplyOfWithoutOffset(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest var metadata runtime.ServerMetadata @@ -825,6 +915,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TotalSupplyWithoutOffset_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_TotalSupplyWithoutOffset_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_TotalSupplyWithoutOffset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SupplyOfWithoutOffset_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_SupplyOfWithoutOffset_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_SupplyOfWithoutOffset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1147,6 +1283,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TotalSupplyWithoutOffset_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_TotalSupplyWithoutOffset_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_TotalSupplyWithoutOffset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SupplyOfWithoutOffset_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_SupplyOfWithoutOffset_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_SupplyOfWithoutOffset_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1303,6 +1479,10 @@ var ( 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))) + pattern_Query_TotalSupplyWithoutOffset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "bank", "v1beta1", "supply_without_offset"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SupplyOfWithoutOffset_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_without_offset", "denom"}, "", runtime.AssumeColonVerbOpt(false))) + 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(false))) 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(false))) @@ -1331,6 +1511,10 @@ var ( forward_Query_SupplyOf_0 = runtime.ForwardResponseMessage + forward_Query_TotalSupplyWithoutOffset_0 = runtime.ForwardResponseMessage + + forward_Query_SupplyOfWithoutOffset_0 = runtime.ForwardResponseMessage + forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_DenomMetadata_0 = runtime.ForwardResponseMessage