Paginate supply queries (#8798)
* paginate grpc query * fix lint * update tests * remove GetTotalSupply * fix test * remove GetTotalSupply * add changelog * update changelog * update rosetta data * update limit * update genesis * add max limit to query * fix lint * go imports * Update types/query/pagination.go * update supply Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
parent
4b2fc3bd43
commit
0effd3a9d3
|
@ -80,6 +80,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||||
* `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`.
|
* `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`.
|
||||||
* (client) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) `client/tx.PrepareFactory` has been converted to a private function, as it's only used internally.
|
* (client) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) `client/tx.PrepareFactory` has been converted to a private function, as it's only used internally.
|
||||||
* (auth/tx) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `ProtoTxProvider` interface used as a workaround for transaction simulation has been removed.
|
* (auth/tx) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `ProtoTxProvider` interface used as a workaround for transaction simulation has been removed.
|
||||||
|
* (x/bank) [\#8798](https://github.com/cosmos/cosmos-sdk/pull/8798) `GetTotalSupply` is removed in favour of `GetPaginatedTotalSupply`
|
||||||
|
|
||||||
### State Machine Breaking
|
### State Machine Breaking
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"account_identifier": {
|
"account_identifier": {
|
||||||
"address":"cosmos1gykh2dsytj0lde8wr9msl9xd2nyj88duvmsnn7"
|
"address":"cosmos1trf09zvqeuc722zyeg34pra8qaqll9ddw0qy8q"
|
||||||
},
|
},
|
||||||
"currency":{
|
"currency":{
|
||||||
"symbol":"stake",
|
"symbol":"stake",
|
||||||
|
|
Binary file not shown.
|
@ -90,7 +90,13 @@ message QueryAllBalancesResponse {
|
||||||
|
|
||||||
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
|
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
|
||||||
// method.
|
// method.
|
||||||
message QueryTotalSupplyRequest {}
|
message QueryTotalSupplyRequest {
|
||||||
|
option (gogoproto.equal) = false;
|
||||||
|
option (gogoproto.goproto_getters) = false;
|
||||||
|
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
|
// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC
|
||||||
// method
|
// method
|
||||||
|
@ -98,6 +104,9 @@ message QueryTotalSupplyResponse {
|
||||||
// supply is the supply of the coins
|
// supply is the supply of the coins
|
||||||
repeated cosmos.base.v1beta1.Coin supply = 1
|
repeated cosmos.base.v1beta1.Coin supply = 1
|
||||||
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
|
||||||
|
|
||||||
|
// pagination defines the pagination in the response.
|
||||||
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
|
// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
|
||||||
|
|
|
@ -2,6 +2,7 @@ package query
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
|
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
@ -14,6 +15,10 @@ import (
|
||||||
// if the `limit` is not supplied, paginate will use `DefaultLimit`
|
// if the `limit` is not supplied, paginate will use `DefaultLimit`
|
||||||
const DefaultLimit = 100
|
const DefaultLimit = 100
|
||||||
|
|
||||||
|
// MaxLimit is the maximum limit the paginate function can handle
|
||||||
|
// which equals the maximum value that can be stored in uint64
|
||||||
|
const MaxLimit = math.MaxUint64
|
||||||
|
|
||||||
// ParsePagination validate PageRequest and returns page number & limit.
|
// ParsePagination validate PageRequest and returns page number & limit.
|
||||||
func ParsePagination(pageReq *PageRequest) (page, limit int, err error) {
|
func ParsePagination(pageReq *PageRequest) (page, limit int, err error) {
|
||||||
offset := 0
|
offset := 0
|
||||||
|
|
|
@ -187,7 +187,9 @@ func (s *IntegrationTestSuite) TestGetCmdQueryTotalSupply() {
|
||||||
Supply: sdk.NewCoins(
|
Supply: sdk.NewCoins(
|
||||||
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
|
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
|
||||||
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))),
|
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))),
|
||||||
)},
|
),
|
||||||
|
Pagination: &query.PageResponse{Total: 2},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "total supply of a specific denomination",
|
name: "total supply of a specific denomination",
|
||||||
|
|
|
@ -183,8 +183,13 @@ To query for the total supply of a specific coin denomination use:
|
||||||
|
|
||||||
queryClient := types.NewQueryClient(clientCtx)
|
queryClient := types.NewQueryClient(clientCtx)
|
||||||
ctx := cmd.Context()
|
ctx := cmd.Context()
|
||||||
|
|
||||||
|
pageReq, err := client.ReadPageRequest(cmd.Flags())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if denom == "" {
|
if denom == "" {
|
||||||
res, err := queryClient.TotalSupply(ctx, &types.QueryTotalSupplyRequest{})
|
res, err := queryClient.TotalSupply(ctx, &types.QueryTotalSupplyRequest{Pagination: pageReq})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,9 @@ func (s *IntegrationTestSuite) TestTotalSupplyGRPCHandler() {
|
||||||
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
|
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
|
||||||
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))),
|
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))),
|
||||||
),
|
),
|
||||||
|
Pagination: &query.PageResponse{
|
||||||
|
Total: 2,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/testutil/network"
|
"github.com/cosmos/cosmos-sdk/testutil/network"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
"github.com/cosmos/cosmos-sdk/types/rest"
|
"github.com/cosmos/cosmos-sdk/types/rest"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
)
|
)
|
||||||
|
@ -155,11 +156,14 @@ func (s *IntegrationTestSuite) TestTotalSupplyHandlerFn() {
|
||||||
{
|
{
|
||||||
"total supply",
|
"total supply",
|
||||||
fmt.Sprintf("%s/bank/total?height=1", baseURL),
|
fmt.Sprintf("%s/bank/total?height=1", baseURL),
|
||||||
&sdk.Coins{},
|
&types.QueryTotalSupplyResponse{},
|
||||||
sdk.NewCoins(
|
&types.QueryTotalSupplyResponse{
|
||||||
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
|
Supply: sdk.NewCoins(
|
||||||
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))),
|
sdk.NewCoin(fmt.Sprintf("%stoken", val.Moniker), s.cfg.AccountTokens),
|
||||||
),
|
sdk.NewCoin(s.cfg.BondDenom, s.cfg.StakingTokens.Add(sdk.NewInt(10))),
|
||||||
|
),
|
||||||
|
Pagination: &query.PageResponse{Total: 2},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"total supply of a specific denom",
|
"total supply of a specific denom",
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -42,10 +43,15 @@ func (k BaseKeeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState) {
|
||||||
|
|
||||||
// ExportGenesis returns the bank module's genesis state.
|
// ExportGenesis returns the bank module's genesis state.
|
||||||
func (k BaseKeeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
|
func (k BaseKeeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
|
||||||
|
totalSupply, _, err := k.GetPaginatedTotalSupply(ctx, &query.PageRequest{Limit: query.MaxLimit})
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Errorf("unable to fetch total supply %v", err))
|
||||||
|
}
|
||||||
|
|
||||||
return types.NewGenesisState(
|
return types.NewGenesisState(
|
||||||
k.GetParams(ctx),
|
k.GetParams(ctx),
|
||||||
k.GetAccountsBalances(ctx),
|
k.GetAccountsBalances(ctx),
|
||||||
k.GetTotalSupply(ctx),
|
totalSupply,
|
||||||
k.GetAllDenomMetaData(ctx),
|
k.GetAllDenomMetaData(ctx),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package keeper_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||||
)
|
)
|
||||||
|
@ -106,7 +107,9 @@ func (suite *IntegrationTestSuite) TestTotalSupply() {
|
||||||
suite.PanicsWithError(tc.expPanicMsg, func() { suite.app.BankKeeper.InitGenesis(suite.ctx, tc.genesis) })
|
suite.PanicsWithError(tc.expPanicMsg, func() { suite.app.BankKeeper.InitGenesis(suite.ctx, tc.genesis) })
|
||||||
} else {
|
} else {
|
||||||
suite.app.BankKeeper.InitGenesis(suite.ctx, tc.genesis)
|
suite.app.BankKeeper.InitGenesis(suite.ctx, tc.genesis)
|
||||||
suite.Require().Equal(tc.expSupply, suite.app.BankKeeper.GetTotalSupply(suite.ctx))
|
totalSupply, _, err := suite.app.BankKeeper.GetPaginatedTotalSupply(suite.ctx, &query.PageRequest{Limit: query.MaxLimit})
|
||||||
|
suite.Require().NoError(err)
|
||||||
|
suite.Require().Equal(tc.expSupply, totalSupply)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,11 +77,14 @@ func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalances
|
||||||
}
|
}
|
||||||
|
|
||||||
// TotalSupply implements the Query/TotalSupply gRPC method
|
// TotalSupply implements the Query/TotalSupply gRPC method
|
||||||
func (k BaseKeeper) TotalSupply(ctx context.Context, _ *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) {
|
func (k BaseKeeper) TotalSupply(ctx context.Context, req *types.QueryTotalSupplyRequest) (*types.QueryTotalSupplyResponse, error) {
|
||||||
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
sdkCtx := sdk.UnwrapSDKContext(ctx)
|
||||||
totalSupply := k.GetTotalSupply(sdkCtx)
|
totalSupply, pageRes, err := k.GetPaginatedTotalSupply(sdkCtx, req.Pagination)
|
||||||
|
if err != nil {
|
||||||
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
return &types.QueryTotalSupplyResponse{Supply: totalSupply}, nil
|
return &types.QueryTotalSupplyResponse{Supply: totalSupply, Pagination: pageRes}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SupplyOf implements the Query/SupplyOf gRPC method
|
// SupplyOf implements the Query/SupplyOf gRPC method
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -50,7 +51,12 @@ func NonnegativeBalanceInvariant(k ViewKeeper) sdk.Invariant {
|
||||||
func TotalSupply(k Keeper) sdk.Invariant {
|
func TotalSupply(k Keeper) sdk.Invariant {
|
||||||
return func(ctx sdk.Context) (string, bool) {
|
return func(ctx sdk.Context) (string, bool) {
|
||||||
expectedTotal := sdk.Coins{}
|
expectedTotal := sdk.Coins{}
|
||||||
supply := k.GetTotalSupply(ctx)
|
supply, _, err := k.GetPaginatedTotalSupply(ctx, &query.PageRequest{Limit: query.MaxLimit})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return sdk.FormatInvariant(types.ModuleName, "query supply",
|
||||||
|
fmt.Sprintf("error querying total supply %v", err)), false
|
||||||
|
}
|
||||||
|
|
||||||
k.IterateAllBalances(ctx, func(_ sdk.AccAddress, balance sdk.Coin) bool {
|
k.IterateAllBalances(ctx, func(_ sdk.AccAddress, balance sdk.Coin) bool {
|
||||||
expectedTotal = expectedTotal.Add(balance)
|
expectedTotal = expectedTotal.Add(balance)
|
||||||
|
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"github.com/cosmos/cosmos-sdk/store/prefix"
|
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
vestexported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
|
vestexported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
|
@ -24,9 +25,8 @@ type Keeper interface {
|
||||||
ExportGenesis(sdk.Context) *types.GenesisState
|
ExportGenesis(sdk.Context) *types.GenesisState
|
||||||
|
|
||||||
GetSupply(ctx sdk.Context, denom string) sdk.Coin
|
GetSupply(ctx sdk.Context, denom string) sdk.Coin
|
||||||
GetTotalSupply(ctx sdk.Context) sdk.Coins
|
GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error)
|
||||||
IterateTotalSupply(ctx sdk.Context, cb func(sdk.Coin) bool)
|
IterateTotalSupply(ctx sdk.Context, cb func(sdk.Coin) bool)
|
||||||
|
|
||||||
GetDenomMetaData(ctx sdk.Context, denom string) (types.Metadata, bool)
|
GetDenomMetaData(ctx sdk.Context, denom string) (types.Metadata, bool)
|
||||||
SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata)
|
SetDenomMetaData(ctx sdk.Context, denomMetaData types.Metadata)
|
||||||
IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool)
|
IterateAllDenomMetaData(ctx sdk.Context, cb func(types.Metadata) bool)
|
||||||
|
@ -55,14 +55,27 @@ type BaseKeeper struct {
|
||||||
paramSpace paramtypes.Subspace
|
paramSpace paramtypes.Subspace
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k BaseKeeper) GetTotalSupply(ctx sdk.Context) sdk.Coins {
|
func (k BaseKeeper) GetPaginatedTotalSupply(ctx sdk.Context, pagination *query.PageRequest) (sdk.Coins, *query.PageResponse, error) {
|
||||||
balances := sdk.NewCoins()
|
store := ctx.KVStore(k.storeKey)
|
||||||
k.IterateTotalSupply(ctx, func(balance sdk.Coin) bool {
|
supplyStore := prefix.NewStore(store, types.SupplyKey)
|
||||||
balances = balances.Add(balance)
|
|
||||||
return false
|
supply := sdk.NewCoins()
|
||||||
|
|
||||||
|
pageRes, err := query.Paginate(supplyStore, pagination, func(key, value []byte) error {
|
||||||
|
var amount sdk.Int
|
||||||
|
err := amount.Unmarshal(value)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to convert amount string to Int %v", err)
|
||||||
|
}
|
||||||
|
supply = append(supply, sdk.NewCoin(string(key), amount))
|
||||||
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
return balances.Sort()
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return supply, pageRes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBaseKeeper returns a new BaseKeeper object with a given codec, dedicated
|
// NewBaseKeeper returns a new BaseKeeper object with a given codec, dedicated
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package keeper_test
|
package keeper_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -93,7 +94,8 @@ func (suite *IntegrationTestSuite) TestSupply() {
|
||||||
totalSupply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initTokens))
|
totalSupply := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initTokens))
|
||||||
suite.NoError(app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, totalSupply))
|
suite.NoError(app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, totalSupply))
|
||||||
|
|
||||||
total := app.BankKeeper.GetTotalSupply(ctx)
|
total, _, err := app.BankKeeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
suite.Require().Equal(totalSupply, total)
|
suite.Require().Equal(totalSupply, total)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,12 +226,13 @@ func (suite *IntegrationTestSuite) TestSupply_MintCoins() {
|
||||||
authKeeper.SetModuleAccount(ctx, multiPermAcc)
|
authKeeper.SetModuleAccount(ctx, multiPermAcc)
|
||||||
authKeeper.SetModuleAccount(ctx, randomPermAcc)
|
authKeeper.SetModuleAccount(ctx, randomPermAcc)
|
||||||
|
|
||||||
initialSupply := keeper.GetTotalSupply(ctx)
|
initialSupply, _, err := keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
|
|
||||||
suite.Require().Panics(func() { keeper.MintCoins(ctx, "", initCoins) }, "no module account") // nolint:errcheck
|
suite.Require().Panics(func() { keeper.MintCoins(ctx, "", initCoins) }, "no module account") // nolint:errcheck
|
||||||
suite.Require().Panics(func() { keeper.MintCoins(ctx, authtypes.Burner, initCoins) }, "invalid permission") // nolint:errcheck
|
suite.Require().Panics(func() { keeper.MintCoins(ctx, authtypes.Burner, initCoins) }, "invalid permission") // nolint:errcheck
|
||||||
|
|
||||||
err := keeper.MintCoins(ctx, authtypes.Minter, sdk.Coins{sdk.Coin{Denom: "denom", Amount: sdk.NewInt(-10)}})
|
err = keeper.MintCoins(ctx, authtypes.Minter, sdk.Coins{sdk.Coin{Denom: "denom", Amount: sdk.NewInt(-10)}})
|
||||||
suite.Require().Error(err, "insufficient coins")
|
suite.Require().Error(err, "insufficient coins")
|
||||||
|
|
||||||
suite.Require().Panics(func() { keeper.MintCoins(ctx, randomPerm, initCoins) }) // nolint:errcheck
|
suite.Require().Panics(func() { keeper.MintCoins(ctx, randomPerm, initCoins) }) // nolint:errcheck
|
||||||
|
@ -238,16 +241,22 @@ func (suite *IntegrationTestSuite) TestSupply_MintCoins() {
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
|
|
||||||
suite.Require().Equal(initCoins, getCoinsByName(ctx, keeper, authKeeper, authtypes.Minter))
|
suite.Require().Equal(initCoins, getCoinsByName(ctx, keeper, authKeeper, authtypes.Minter))
|
||||||
suite.Require().Equal(initialSupply.Add(initCoins...), keeper.GetTotalSupply(ctx))
|
totalSupply, _, err := keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
|
|
||||||
|
suite.Require().Equal(initialSupply.Add(initCoins...), totalSupply)
|
||||||
|
|
||||||
// test same functionality on module account with multiple permissions
|
// test same functionality on module account with multiple permissions
|
||||||
initialSupply = keeper.GetTotalSupply(ctx)
|
initialSupply, _, err = keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
|
|
||||||
err = keeper.MintCoins(ctx, multiPermAcc.GetName(), initCoins)
|
err = keeper.MintCoins(ctx, multiPermAcc.GetName(), initCoins)
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
|
|
||||||
|
totalSupply, _, err = keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
suite.Require().Equal(initCoins, getCoinsByName(ctx, keeper, authKeeper, multiPermAcc.GetName()))
|
suite.Require().Equal(initCoins, getCoinsByName(ctx, keeper, authKeeper, multiPermAcc.GetName()))
|
||||||
suite.Require().Equal(initialSupply.Add(initCoins...), keeper.GetTotalSupply(ctx))
|
suite.Require().Equal(initialSupply.Add(initCoins...), totalSupply)
|
||||||
suite.Require().Panics(func() { keeper.MintCoins(ctx, authtypes.Burner, initCoins) }) // nolint:errcheck
|
suite.Require().Panics(func() { keeper.MintCoins(ctx, authtypes.Burner, initCoins) }) // nolint:errcheck
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,32 +295,37 @@ func (suite *IntegrationTestSuite) TestSupply_BurnCoins() {
|
||||||
suite.
|
suite.
|
||||||
Require().
|
Require().
|
||||||
NoError(keeper.MintCoins(ctx, authtypes.Minter, initCoins))
|
NoError(keeper.MintCoins(ctx, authtypes.Minter, initCoins))
|
||||||
supplyAfterInflation := keeper.GetTotalSupply(ctx)
|
supplyAfterInflation, _, err := keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
|
||||||
suite.Require().Panics(func() { keeper.BurnCoins(ctx, "", initCoins) }, "no module account") // nolint:errcheck
|
suite.Require().Panics(func() { keeper.BurnCoins(ctx, "", initCoins) }, "no module account") // nolint:errcheck
|
||||||
suite.Require().Panics(func() { keeper.BurnCoins(ctx, authtypes.Minter, initCoins) }, "invalid permission") // nolint:errcheck
|
suite.Require().Panics(func() { keeper.BurnCoins(ctx, authtypes.Minter, initCoins) }, "invalid permission") // nolint:errcheck
|
||||||
suite.Require().Panics(func() { keeper.BurnCoins(ctx, randomPerm, supplyAfterInflation) }, "random permission") // nolint:errcheck
|
suite.Require().Panics(func() { keeper.BurnCoins(ctx, randomPerm, supplyAfterInflation) }, "random permission") // nolint:errcheck
|
||||||
err := keeper.BurnCoins(ctx, authtypes.Burner, supplyAfterInflation)
|
err = keeper.BurnCoins(ctx, authtypes.Burner, supplyAfterInflation)
|
||||||
suite.Require().Error(err, "insufficient coins")
|
suite.Require().Error(err, "insufficient coins")
|
||||||
|
|
||||||
err = keeper.BurnCoins(ctx, authtypes.Burner, initCoins)
|
err = keeper.BurnCoins(ctx, authtypes.Burner, initCoins)
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
|
supplyAfterBurn, _, err := keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
suite.Require().Equal(sdk.NewCoins().String(), getCoinsByName(ctx, keeper, authKeeper, authtypes.Burner).String())
|
suite.Require().Equal(sdk.NewCoins().String(), getCoinsByName(ctx, keeper, authKeeper, authtypes.Burner).String())
|
||||||
suite.Require().Equal(supplyAfterInflation.Sub(initCoins), keeper.GetTotalSupply(ctx))
|
suite.Require().Equal(supplyAfterInflation.Sub(initCoins), supplyAfterBurn)
|
||||||
|
|
||||||
// test same functionality on module account with multiple permissions
|
// test same functionality on module account with multiple permissions
|
||||||
suite.
|
suite.
|
||||||
Require().
|
Require().
|
||||||
NoError(keeper.MintCoins(ctx, authtypes.Minter, initCoins))
|
NoError(keeper.MintCoins(ctx, authtypes.Minter, initCoins))
|
||||||
supplyAfterInflation = keeper.GetTotalSupply(ctx)
|
|
||||||
|
|
||||||
|
supplyAfterInflation, _, err = keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
suite.Require().NoError(keeper.SendCoins(ctx, authtypes.NewModuleAddress(authtypes.Minter), multiPermAcc.GetAddress(), initCoins))
|
suite.Require().NoError(keeper.SendCoins(ctx, authtypes.NewModuleAddress(authtypes.Minter), multiPermAcc.GetAddress(), initCoins))
|
||||||
authKeeper.SetModuleAccount(ctx, multiPermAcc)
|
authKeeper.SetModuleAccount(ctx, multiPermAcc)
|
||||||
|
|
||||||
err = keeper.BurnCoins(ctx, multiPermAcc.GetName(), initCoins)
|
err = keeper.BurnCoins(ctx, multiPermAcc.GetName(), initCoins)
|
||||||
|
supplyAfterBurn, _, err = keeper.GetPaginatedTotalSupply(ctx, &query.PageRequest{})
|
||||||
|
suite.Require().NoError(err)
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
suite.Require().Equal(sdk.NewCoins().String(), getCoinsByName(ctx, keeper, authKeeper, multiPermAcc.GetName()).String())
|
suite.Require().Equal(sdk.NewCoins().String(), getCoinsByName(ctx, keeper, authKeeper, multiPermAcc.GetName()).String())
|
||||||
suite.Require().Equal(supplyAfterInflation.Sub(initCoins), keeper.GetTotalSupply(ctx))
|
suite.Require().Equal(supplyAfterInflation.Sub(initCoins), supplyAfterBurn)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *IntegrationTestSuite) TestSendCoinsNewAccount() {
|
func (suite *IntegrationTestSuite) TestSendCoinsNewAccount() {
|
||||||
|
|
|
@ -3,7 +3,6 @@ package keeper
|
||||||
import (
|
import (
|
||||||
abci "github.com/tendermint/tendermint/abci/types"
|
abci "github.com/tendermint/tendermint/abci/types"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/client"
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
|
@ -77,25 +76,24 @@ func queryAllBalance(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQue
|
||||||
}
|
}
|
||||||
|
|
||||||
func queryTotalSupply(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
|
func queryTotalSupply(ctx sdk.Context, req abci.RequestQuery, k Keeper, legacyQuerierCdc *codec.LegacyAmino) ([]byte, error) {
|
||||||
var params types.QueryTotalSupplyParams
|
var params types.QueryTotalSupplyRequest
|
||||||
|
|
||||||
err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms)
|
err := legacyQuerierCdc.UnmarshalJSON(req.Data, ¶ms)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
|
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: paginate
|
totalSupply, pageRes, err := k.GetPaginatedTotalSupply(ctx, params.Pagination)
|
||||||
// https://github.com/cosmos/cosmos-sdk/issues/8761
|
if err != nil {
|
||||||
totalSupply := k.GetTotalSupply(ctx)
|
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error())
|
||||||
|
|
||||||
start, end := client.Paginate(len(totalSupply), params.Page, params.Limit, 100)
|
|
||||||
if start < 0 || end < 0 {
|
|
||||||
totalSupply = sdk.Coins{}
|
|
||||||
} else {
|
|
||||||
totalSupply = totalSupply[start:end]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := legacyQuerierCdc.MarshalJSON(totalSupply)
|
supplyRes := &types.QueryTotalSupplyResponse{
|
||||||
|
Supply: totalSupply,
|
||||||
|
Pagination: pageRes,
|
||||||
|
}
|
||||||
|
|
||||||
|
res, err := codec.MarshalJSONIndent(legacyQuerierCdc, supplyRes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
|
return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,16 +3,15 @@ package keeper_test
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/simapp"
|
|
||||||
|
|
||||||
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
|
||||||
|
|
||||||
abci "github.com/tendermint/tendermint/abci/types"
|
abci "github.com/tendermint/tendermint/abci/types"
|
||||||
|
|
||||||
|
"github.com/cosmos/cosmos-sdk/simapp"
|
||||||
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
"github.com/cosmos/cosmos-sdk/testutil/testdata"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/cosmos/cosmos-sdk/types/query"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
"github.com/cosmos/cosmos-sdk/x/bank/keeper"
|
||||||
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
"github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
|
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (suite *IntegrationTestSuite) TestQuerier_QueryBalance() {
|
func (suite *IntegrationTestSuite) TestQuerier_QueryBalance() {
|
||||||
|
@ -107,14 +106,16 @@ func (suite *IntegrationTestSuite) TestQuerier_QueryTotalSupply() {
|
||||||
suite.Require().NotNil(err)
|
suite.Require().NotNil(err)
|
||||||
suite.Require().Nil(res)
|
suite.Require().Nil(res)
|
||||||
|
|
||||||
req.Data = legacyAmino.MustMarshalJSON(types.NewQueryTotalSupplyParams(1, 100))
|
req.Data = legacyAmino.MustMarshalJSON(types.QueryTotalSupplyRequest{Pagination: &query.PageRequest{
|
||||||
|
Limit: 100,
|
||||||
|
}})
|
||||||
res, err = querier(ctx, []string{types.QueryTotalSupply}, req)
|
res, err = querier(ctx, []string{types.QueryTotalSupply}, req)
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
suite.Require().NotNil(res)
|
suite.Require().NotNil(res)
|
||||||
|
|
||||||
var resp sdk.Coins
|
var resp types.QueryTotalSupplyResponse
|
||||||
suite.Require().NoError(legacyAmino.UnmarshalJSON(res, &resp))
|
suite.Require().NoError(legacyAmino.UnmarshalJSON(res, &resp))
|
||||||
suite.Require().Equal(expectedTotalSupply, resp)
|
suite.Require().Equal(expectedTotalSupply, resp.Supply)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *IntegrationTestSuite) TestQuerier_QueryTotalSupplyOf() {
|
func (suite *IntegrationTestSuite) TestQuerier_QueryTotalSupplyOf() {
|
||||||
|
|
|
@ -219,6 +219,8 @@ func (m *QueryAllBalancesResponse) GetPagination() *query.PageResponse {
|
||||||
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
|
// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC
|
||||||
// method.
|
// method.
|
||||||
type QueryTotalSupplyRequest struct {
|
type QueryTotalSupplyRequest struct {
|
||||||
|
// pagination defines an optional pagination for the request.
|
||||||
|
Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryTotalSupplyRequest) Reset() { *m = QueryTotalSupplyRequest{} }
|
func (m *QueryTotalSupplyRequest) Reset() { *m = QueryTotalSupplyRequest{} }
|
||||||
|
@ -259,6 +261,8 @@ var xxx_messageInfo_QueryTotalSupplyRequest proto.InternalMessageInfo
|
||||||
type QueryTotalSupplyResponse struct {
|
type QueryTotalSupplyResponse struct {
|
||||||
// supply is the supply of the coins
|
// 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"`
|
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.
|
||||||
|
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryTotalSupplyResponse) Reset() { *m = QueryTotalSupplyResponse{} }
|
func (m *QueryTotalSupplyResponse) Reset() { *m = QueryTotalSupplyResponse{} }
|
||||||
|
@ -301,6 +305,13 @@ func (m *QueryTotalSupplyResponse) GetSupply() github_com_cosmos_cosmos_sdk_type
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *QueryTotalSupplyResponse) GetPagination() *query.PageResponse {
|
||||||
|
if m != nil {
|
||||||
|
return m.Pagination
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
|
// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method.
|
||||||
type QuerySupplyOfRequest struct {
|
type QuerySupplyOfRequest struct {
|
||||||
// denom is the coin denom to query balances for.
|
// denom is the coin denom to query balances for.
|
||||||
|
@ -690,59 +701,59 @@ func init() {
|
||||||
func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) }
|
func init() { proto.RegisterFile("cosmos/bank/v1beta1/query.proto", fileDescriptor_9c6fc1939682df13) }
|
||||||
|
|
||||||
var fileDescriptor_9c6fc1939682df13 = []byte{
|
var fileDescriptor_9c6fc1939682df13 = []byte{
|
||||||
// 824 bytes of a gzipped FileDescriptorProto
|
// 825 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6b, 0x13, 0x5b,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0xd3, 0x58,
|
||||||
0x14, 0xce, 0xed, 0x7b, 0x4d, 0xd3, 0x13, 0xde, 0x5b, 0xdc, 0xe6, 0xf1, 0xd2, 0xe9, 0x6b, 0xf2,
|
0x14, 0xcd, 0xeb, 0x4c, 0xd3, 0xf4, 0x46, 0x33, 0x8b, 0xd7, 0x8c, 0x26, 0x75, 0xa7, 0xc9, 0xc8,
|
||||||
0x98, 0x6a, 0x9b, 0xd6, 0x74, 0xa6, 0x69, 0x85, 0xa2, 0x1b, 0x69, 0x2a, 0xba, 0x10, 0x69, 0x8c,
|
0x9d, 0x69, 0xd3, 0x92, 0xda, 0x4d, 0x8b, 0x54, 0xc1, 0x06, 0x35, 0x45, 0xb0, 0x40, 0xa8, 0x21,
|
||||||
0xae, 0x04, 0x91, 0x9b, 0x64, 0x1c, 0x43, 0x93, 0xb9, 0xd3, 0xdc, 0x89, 0x58, 0x4a, 0x51, 0x04,
|
0xb0, 0x42, 0x42, 0xe8, 0x25, 0x31, 0x26, 0x6a, 0xe2, 0xe7, 0xe6, 0x39, 0x88, 0xaa, 0xaa, 0x84,
|
||||||
0xc1, 0x95, 0x0a, 0x2e, 0x5c, 0xb8, 0xa9, 0x1b, 0x41, 0x97, 0xfe, 0x15, 0x5d, 0xb8, 0x28, 0xb8,
|
0x90, 0x90, 0x58, 0x01, 0x12, 0x0b, 0x16, 0x6c, 0xca, 0x06, 0x09, 0x96, 0xfc, 0x8a, 0x2e, 0x58,
|
||||||
0x71, 0xa5, 0xd2, 0xba, 0xf0, 0xcf, 0x90, 0xdc, 0x1f, 0xd3, 0x49, 0x32, 0x4d, 0x06, 0xd1, 0x55,
|
0x54, 0x62, 0xc3, 0x0a, 0x50, 0xcb, 0x82, 0x9f, 0x81, 0xf2, 0x3e, 0x5c, 0x27, 0x71, 0x13, 0x2f,
|
||||||
0x66, 0xee, 0x3d, 0xe7, 0x3b, 0xdf, 0x77, 0xee, 0xb9, 0xdf, 0x04, 0xb2, 0x55, 0xca, 0x9a, 0x94,
|
0xc2, 0x2a, 0xf6, 0xf5, 0xfd, 0x38, 0xe7, 0x3c, 0xdf, 0xe3, 0x40, 0xb6, 0x4a, 0x59, 0x93, 0x32,
|
||||||
0x99, 0x15, 0xe2, 0x6c, 0x9a, 0xf7, 0x0a, 0x15, 0xcb, 0x23, 0x05, 0x73, 0xab, 0x6d, 0xb5, 0xb6,
|
0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
0x9e, 0x02, 0xcc, 0x3b, 0x96, 0x48, 0x8b, 0x34, 0xd5, 0x22, 0xe8, 0x25, 0xb9, 0xc2, 0x2a, 0x2a,
|
||||||
0xca, 0x94, 0x11, 0xe2, 0x01, 0x86, 0x48, 0x52, 0x75, 0x44, 0x82, 0x5e, 0x03, 0x8d, 0x23, 0x5e,
|
0xa7, 0x5c, 0x80, 0xb8, 0xcb, 0x23, 0x72, 0xca, 0x8c, 0x11, 0xe2, 0x4f, 0x86, 0x28, 0x52, 0x73,
|
||||||
0xec, 0xe8, 0x60, 0x57, 0x2d, 0x8f, 0xd4, 0x88, 0x47, 0x94, 0xda, 0xee, 0x11, 0x46, 0x3f, 0x3b,
|
0x44, 0x81, 0x5e, 0x03, 0x8d, 0x77, 0xbc, 0xdc, 0xe1, 0xc1, 0xae, 0x5b, 0x1e, 0xa9, 0x11, 0x8f,
|
||||||
0xc2, 0xfa, 0x5b, 0x04, 0x53, 0xa1, 0x65, 0xa4, 0x80, 0x35, 0x18, 0x6f, 0xca, 0x35, 0x35, 0xbc,
|
0x8c, 0xf8, 0x15, 0xd1, 0xdf, 0x21, 0x98, 0x09, 0x1d, 0x23, 0x09, 0x6c, 0xc0, 0x64, 0x53, 0xc6,
|
||||||
0xd3, 0xa1, 0x1a, 0x54, 0xa6, 0x54, 0x71, 0x9c, 0xf5, 0xeb, 0xa6, 0xb2, 0x00, 0x93, 0xc7, 0x54,
|
0xd4, 0x62, 0xcd, 0x86, 0x72, 0x50, 0x95, 0x92, 0xc5, 0x69, 0xd5, 0xe8, 0x4e, 0xbe, 0x00, 0xd3,
|
||||||
0x7b, 0x1b, 0x12, 0x7e, 0xfc, 0xb7, 0x82, 0x4d, 0xec, 0x13, 0x77, 0x01, 0x12, 0x8a, 0xa6, 0x6c,
|
0xa7, 0x50, 0x7b, 0x05, 0x09, 0x3f, 0xfe, 0x3b, 0x41, 0x11, 0xfb, 0xc8, 0x5d, 0x82, 0x84, 0x82,
|
||||||
0x61, 0x24, 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x90, 0x0c, 0x78, 0xd2, 0x20, 0x74, 0xfd, 0x46, 0x39, 0x08, 0x5d, 0x88, 0xd1,
|
||||||
0x9c, 0xdd, 0x34, 0x9e, 0x0a, 0x65, 0x27, 0xfc, 0x05, 0x3f, 0x45, 0x90, 0x50, 0x6e, 0x81, 0x07,
|
0xe9, 0x73, 0x1c, 0xdd, 0x2c, 0x9e, 0x09, 0x45, 0x27, 0x8d, 0xea, 0x19, 0x82, 0x84, 0x72, 0x0b,
|
||||||
0x1c, 0x50, 0x8f, 0xff, 0x68, 0x0b, 0x51, 0x42, 0x25, 0x91, 0x33, 0x9c, 0xc8, 0x69, 0x3c, 0x33,
|
0x3c, 0xe0, 0x80, 0x7a, 0xfc, 0x47, 0x5b, 0x8a, 0x92, 0x2a, 0x81, 0x9c, 0xe3, 0x40, 0xfe, 0xc7,
|
||||||
0x80, 0x88, 0x7f, 0x80, 0x0f, 0x11, 0xc4, 0x85, 0x43, 0xe0, 0xb9, 0x93, 0x6b, 0x74, 0xd9, 0x91,
|
0x73, 0x03, 0x80, 0xf8, 0x07, 0xf8, 0x08, 0x41, 0x5c, 0x38, 0x04, 0x5e, 0x38, 0x7b, 0x46, 0x97,
|
||||||
0x96, 0x1b, 0x1e, 0x18, 0xa9, 0x27, 0xc2, 0x8b, 0xf0, 0x1b, 0x04, 0x7f, 0x75, 0x5d, 0x21, 0x6c,
|
0x1d, 0x69, 0xb9, 0xe1, 0x89, 0x91, 0x34, 0x11, 0x5e, 0x84, 0xdf, 0x22, 0xf8, 0xa3, 0x6b, 0x85,
|
||||||
0x9c, 0x5c, 0x20, 0xec, 0x7a, 0x6a, 0x66, 0xe4, 0x78, 0xc9, 0xeb, 0x2c, 0xe7, 0x65, 0xe0, 0x7c,
|
0xb0, 0x71, 0xf6, 0x80, 0xb0, 0xf5, 0xd4, 0xcc, 0xc8, 0xf9, 0x12, 0xd7, 0x79, 0x8e, 0xcb, 0xc0,
|
||||||
0x28, 0x2f, 0xde, 0x1a, 0x76, 0x5b, 0x5d, 0x44, 0xbf, 0x57, 0xaf, 0x11, 0xfc, 0xdd, 0xed, 0x64,
|
0xf9, 0x50, 0x5c, 0x5c, 0x1a, 0x76, 0x57, 0x2d, 0xa2, 0xaf, 0xd5, 0x1b, 0x04, 0x7f, 0x76, 0x3b,
|
||||||
0x78, 0x58, 0xe5, 0x5e, 0x6b, 0xd5, 0x96, 0xa2, 0x27, 0x48, 0xae, 0x79, 0xce, 0x75, 0x16, 0x9f,
|
0x19, 0x1e, 0x36, 0xb9, 0xd7, 0x5a, 0xb5, 0x95, 0xe8, 0x05, 0x12, 0x6b, 0x9e, 0x63, 0x9d, 0xc7,
|
||||||
0x8a, 0xc2, 0xb5, 0xb8, 0xbe, 0x7f, 0x98, 0x41, 0x07, 0x87, 0x19, 0xf4, 0xf5, 0x30, 0x83, 0x9e,
|
0xff, 0x45, 0xc1, 0x5a, 0xdc, 0x3c, 0x3c, 0xce, 0xa0, 0xa3, 0xe3, 0x0c, 0xfa, 0x76, 0x9c, 0x41,
|
||||||
0x1f, 0x65, 0x62, 0x07, 0x47, 0x99, 0xd8, 0xa7, 0xa3, 0x4c, 0xec, 0xe6, 0xfc, 0xc0, 0x8f, 0xe1,
|
0x2f, 0x4e, 0x32, 0xb1, 0xa3, 0x93, 0x4c, 0xec, 0xf3, 0x49, 0x26, 0x76, 0x7b, 0x71, 0xe0, 0x57,
|
||||||
0x7d, 0x01, 0xcb, 0xbf, 0x89, 0x95, 0x38, 0xff, 0x77, 0xb6, 0xf2, 0x23, 0x00, 0x00, 0xff, 0xff,
|
0xf5, 0xa1, 0x68, 0xcb, 0x3f, 0xae, 0x95, 0x38, 0xff, 0xe7, 0xb8, 0xf6, 0x33, 0x00, 0x00, 0xff,
|
||||||
0xb4, 0xd4, 0xb0, 0xfc, 0x75, 0x0a, 0x00, 0x00,
|
0xff, 0xa0, 0xfe, 0xe2, 0x92, 0x11, 0x0b, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
|
@ -1238,6 +1249,18 @@ func (m *QueryTotalSupplyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = 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
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1261,6 +1284,18 @@ func (m *QueryTotalSupplyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if m.Pagination != nil {
|
||||||
|
{
|
||||||
|
size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i])
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
i -= size
|
||||||
|
i = encodeVarintQuery(dAtA, i, uint64(size))
|
||||||
|
}
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x12
|
||||||
|
}
|
||||||
if len(m.Supply) > 0 {
|
if len(m.Supply) > 0 {
|
||||||
for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- {
|
for iNdEx := len(m.Supply) - 1; iNdEx >= 0; iNdEx-- {
|
||||||
{
|
{
|
||||||
|
@ -1627,6 +1662,10 @@ func (m *QueryTotalSupplyRequest) Size() (n int) {
|
||||||
}
|
}
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if m.Pagination != nil {
|
||||||
|
l = m.Pagination.Size()
|
||||||
|
n += 1 + l + sovQuery(uint64(l))
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1642,6 +1681,10 @@ func (m *QueryTotalSupplyResponse) Size() (n int) {
|
||||||
n += 1 + l + sovQuery(uint64(l))
|
n += 1 + l + sovQuery(uint64(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if m.Pagination != nil {
|
||||||
|
l = m.Pagination.Size()
|
||||||
|
n += 1 + l + sovQuery(uint64(l))
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2218,6 +2261,42 @@ func (m *QueryTotalSupplyRequest) Unmarshal(dAtA []byte) error {
|
||||||
return fmt.Errorf("proto: QueryTotalSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: QueryTotalSupplyRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
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:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
@ -2302,6 +2381,42 @@ func (m *QueryTotalSupplyResponse) Unmarshal(dAtA []byte) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 2:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType)
|
||||||
|
}
|
||||||
|
var msglen int
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowQuery
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
msglen |= int(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if msglen < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + msglen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthQuery
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
if m.Pagination == nil {
|
||||||
|
m.Pagination = &query.PageResponse{}
|
||||||
|
}
|
||||||
|
if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||||
|
|
|
@ -179,10 +179,21 @@ func local_request_Query_AllBalances_0(ctx context.Context, marshaler runtime.Ma
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
filter_Query_TotalSupply_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||||
|
)
|
||||||
|
|
||||||
func request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq QueryTotalSupplyRequest
|
var protoReq QueryTotalSupplyRequest
|
||||||
var metadata runtime.ServerMetadata
|
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_TotalSupply_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
msg, err := client.TotalSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.TotalSupply(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
|
|
||||||
|
@ -192,6 +203,13 @@ func local_request_Query_TotalSupply_0(ctx context.Context, marshaler runtime.Ma
|
||||||
var protoReq QueryTotalSupplyRequest
|
var protoReq QueryTotalSupplyRequest
|
||||||
var metadata runtime.ServerMetadata
|
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_TotalSupply_0); err != nil {
|
||||||
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
|
}
|
||||||
|
|
||||||
msg, err := server.TotalSupply(ctx, &protoReq)
|
msg, err := server.TotalSupply(ctx, &protoReq)
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue