From f29854e0c61a59e13fc1ab973e782cf7636e55d4 Mon Sep 17 00:00:00 2001 From: jelysn Date: Wed, 13 Dec 2023 23:52:06 +0800 Subject: [PATCH] cleanup accountedpool module --- app/app.go | 2 - app/setup_handlers.go | 3 - proto/elys/accountedpool/genesis.proto | 4 +- proto/elys/accountedpool/params.proto | 11 - proto/elys/accountedpool/query.proto | 19 - wasmbindings/types/types.go | 1 - x/accountedpool/client/cli/query.go | 1 - .../client/cli/query_accounted_pool.go | 5 +- x/accountedpool/client/cli/query_params.go | 36 -- x/accountedpool/client/wasm/querier.go | 2 - x/accountedpool/client/wasm/query_params.go | 22 - x/accountedpool/genesis.go | 3 - x/accountedpool/genesis_test.go | 2 - x/accountedpool/keeper/accounted_pool.go | 23 +- .../keeper/accounted_pool_initiate.go | 4 +- .../keeper/accounted_pool_update.go | 7 +- x/accountedpool/keeper/keeper.go | 9 - x/accountedpool/keeper/params.go | 34 -- x/accountedpool/keeper/params_test.go | 18 - .../keeper/query_accounted_pool.go | 5 +- x/accountedpool/keeper/query_params.go | 19 - x/accountedpool/keeper/query_params_test.go | 21 - x/accountedpool/module_simulation.go | 1 - x/accountedpool/types/errors.go | 5 +- x/accountedpool/types/genesis.go | 9 +- x/accountedpool/types/genesis.pb.go | 81 +--- x/accountedpool/types/key_accounted_pool.go | 4 +- x/accountedpool/types/params.go | 39 -- x/accountedpool/types/params.pb.go | 264 ------------ x/accountedpool/types/query.pb.go | 402 ++---------------- x/accountedpool/types/query.pb.gw.go | 75 +--- x/accountedpool/types/types.go | 1 - 32 files changed, 66 insertions(+), 1066 deletions(-) delete mode 100644 proto/elys/accountedpool/params.proto delete mode 100644 x/accountedpool/client/cli/query_params.go delete mode 100644 x/accountedpool/client/wasm/query_params.go delete mode 100644 x/accountedpool/keeper/params.go delete mode 100644 x/accountedpool/keeper/params_test.go delete mode 100644 x/accountedpool/keeper/query_params.go delete mode 100644 x/accountedpool/keeper/query_params_test.go delete mode 100644 x/accountedpool/types/params.go delete mode 100644 x/accountedpool/types/params.pb.go delete mode 100644 x/accountedpool/types/types.go diff --git a/app/app.go b/app/app.go index ac1494047..614265dae 100644 --- a/app/app.go +++ b/app/app.go @@ -730,7 +730,6 @@ func NewElysApp( appCodec, keys[accountedpoolmoduletypes.StoreKey], keys[accountedpoolmoduletypes.MemStoreKey], - app.GetSubspace(accountedpoolmoduletypes.ModuleName), app.BankKeeper, ) accountedPoolModule := accountedpoolmodule.NewAppModule(appCodec, app.AccountedPoolKeeper, app.AccountKeeper, app.BankKeeper) @@ -1497,7 +1496,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(burnermoduletypes.ModuleName) paramsKeeper.Subspace(ammmoduletypes.ModuleName) paramsKeeper.Subspace(marginmoduletypes.ModuleName) - paramsKeeper.Subspace(accountedpoolmoduletypes.ModuleName) paramsKeeper.Subspace(transferhooktypes.ModuleName) paramsKeeper.Subspace(clockmoduletypes.ModuleName) paramsKeeper.Subspace(stablestaketypes.ModuleName) diff --git a/app/setup_handlers.go b/app/setup_handlers.go index 6b0ef1737..c2bf4ad10 100644 --- a/app/setup_handlers.go +++ b/app/setup_handlers.go @@ -16,7 +16,6 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - accountedpooltypes "github.com/elys-network/elys/x/accountedpool/types" ammtypes "github.com/elys-network/elys/x/amm/types" assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" burnertypes "github.com/elys-network/elys/x/burner/types" @@ -79,8 +78,6 @@ func setUpgradeHandler(app *ElysApp) { keyTable = oracletypes.ParamKeyTable() //nolint:staticcheck case tokenomicstypes.ModuleName: keyTable = tokenomicstypes.ParamKeyTable() //nolint:staticcheck - case accountedpooltypes.ModuleName: - keyTable = accountedpooltypes.ParamKeyTable() //nolint:staticcheck case clocktypes.ModuleName: keyTable = clocktypes.ParamKeyTable() //nolint:staticcheck case transferhooktypes.ModuleName: diff --git a/proto/elys/accountedpool/genesis.proto b/proto/elys/accountedpool/genesis.proto index 08111b021..df281134c 100644 --- a/proto/elys/accountedpool/genesis.proto +++ b/proto/elys/accountedpool/genesis.proto @@ -3,14 +3,12 @@ syntax = "proto3"; package elys.accountedpool; import "gogoproto/gogo.proto"; -import "elys/accountedpool/params.proto"; import "elys/accountedpool/accounted_pool.proto"; option go_package = "github.com/elys-network/elys/x/accountedpool/types"; // GenesisState defines the tvl module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated AccountedPool accounted_pool_list = 2 [(gogoproto.nullable) = false]; + repeated AccountedPool accounted_pool_list = 1 [(gogoproto.nullable) = false]; } diff --git a/proto/elys/accountedpool/params.proto b/proto/elys/accountedpool/params.proto deleted file mode 100644 index 280821fe6..000000000 --- a/proto/elys/accountedpool/params.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -package elys.accountedpool; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/elys-network/elys/x/accountedpool/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; -} diff --git a/proto/elys/accountedpool/query.proto b/proto/elys/accountedpool/query.proto index a12c043c1..5f4cd5b1a 100644 --- a/proto/elys/accountedpool/query.proto +++ b/proto/elys/accountedpool/query.proto @@ -5,39 +5,20 @@ package elys.accountedpool; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "elys/accountedpool/params.proto"; import "elys/accountedpool/accounted_pool.proto"; option go_package = "github.com/elys-network/elys/x/accountedpool/types"; // Query defines the gRPC querier service. service Query { - - // Parameters queries the parameters of the module. - rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/elys-network/elys/accountedpool/params"; - - } - // Queries a list of AccountedPool items. rpc AccountedPool (QueryGetAccountedPoolRequest) returns (QueryGetAccountedPoolResponse) { option (google.api.http).get = "/elys-network/elys/accountedpool/accounted_pool/{pool_id}"; - } rpc AccountedPoolAll (QueryAllAccountedPoolRequest) returns (QueryAllAccountedPoolResponse) { option (google.api.http).get = "/elys-network/elys/accountedpool/accounted_pool"; - } } -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} message QueryGetAccountedPoolRequest { uint64 pool_id = 1; diff --git a/wasmbindings/types/types.go b/wasmbindings/types/types.go index f934d9d59..bd9708292 100644 --- a/wasmbindings/types/types.go +++ b/wasmbindings/types/types.go @@ -96,7 +96,6 @@ func AllCapabilities() []string { type ElysQuery struct { // accountedpool queriers - AccountedPoolParams *accountedpooltypes.QueryParamsRequest `json:"accounted_pool_params,omitempty"` AccountedPoolAccountedPool *accountedpooltypes.QueryGetAccountedPoolRequest `json:"accounted_pool_accounted_pool,omitempty"` AccountedPoolAccountedPoolAll *accountedpooltypes.QueryAllAccountedPoolRequest `json:"accounted_pool_accounted_pool_all,omitempty"` diff --git a/x/accountedpool/client/cli/query.go b/x/accountedpool/client/cli/query.go index 4b4c2cd09..ce8ef1783 100644 --- a/x/accountedpool/client/cli/query.go +++ b/x/accountedpool/client/cli/query.go @@ -24,7 +24,6 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) cmd.AddCommand(CmdListAccountedPool()) cmd.AddCommand(CmdShowAccountedPool()) // this line is used by starport scaffolding # 1 diff --git a/x/accountedpool/client/cli/query_accounted_pool.go b/x/accountedpool/client/cli/query_accounted_pool.go index 0f020443a..0db718d56 100644 --- a/x/accountedpool/client/cli/query_accounted_pool.go +++ b/x/accountedpool/client/cli/query_accounted_pool.go @@ -13,7 +13,7 @@ import ( func CmdListAccountedPool() *cobra.Command { cmd := &cobra.Command{ Use: "list-accounted-pool", - Short: "list all accounted-pool", + Short: "list all accounted pools", RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { @@ -59,8 +59,7 @@ func CmdShowAccountedPool() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) - argIndex := args[0] - poolId, err := strconv.ParseUint(argIndex, 10, 64) + poolId, err := strconv.ParseUint(args[0], 10, 64) if err != nil { return err } diff --git a/x/accountedpool/client/cli/query_params.go b/x/accountedpool/client/cli/query_params.go deleted file mode 100644 index 5741fc1aa..000000000 --- a/x/accountedpool/client/cli/query_params.go +++ /dev/null @@ -1,36 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/elys-network/elys/x/accountedpool/types" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/accountedpool/client/wasm/querier.go b/x/accountedpool/client/wasm/querier.go index e51f1985e..0a598ae56 100644 --- a/x/accountedpool/client/wasm/querier.go +++ b/x/accountedpool/client/wasm/querier.go @@ -19,8 +19,6 @@ func NewQuerier(keeper *keeper.Keeper) *Querier { func (oq *Querier) HandleQuery(ctx sdk.Context, query wasmbindingstypes.ElysQuery) ([]byte, error) { switch { - case query.AccountedPoolParams != nil: - return oq.queryParams(ctx, query.AccountedPoolParams) case query.AccountedPoolAccountedPool != nil: return oq.queryAccountedPool(ctx, query.AccountedPoolAccountedPool) case query.AccountedPoolAccountedPoolAll != nil: diff --git a/x/accountedpool/client/wasm/query_params.go b/x/accountedpool/client/wasm/query_params.go deleted file mode 100644 index 99fac546a..000000000 --- a/x/accountedpool/client/wasm/query_params.go +++ /dev/null @@ -1,22 +0,0 @@ -package wasm - -import ( - "encoding/json" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/accountedpool/types" -) - -func (oq *Querier) queryParams(ctx sdk.Context, req *types.QueryParamsRequest) ([]byte, error) { - res, err := oq.keeper.Params(ctx, req) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to get params") - } - - responseBytes, err := json.Marshal(res) - if err != nil { - return nil, errorsmod.Wrap(err, "failed to serialize params response") - } - return responseBytes, nil -} diff --git a/x/accountedpool/genesis.go b/x/accountedpool/genesis.go index 867ca74e8..687db1f96 100644 --- a/x/accountedpool/genesis.go +++ b/x/accountedpool/genesis.go @@ -12,14 +12,11 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.AccountedPoolList { k.SetAccountedPool(ctx, elem) } - // this line is used by starport scaffolding # genesis/module/init - k.SetParams(ctx, &genState.Params) } // ExportGenesis returns the module's exported genesis func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) genesis.AccountedPoolList = k.GetAllAccountedPool(ctx) // this line is used by starport scaffolding # genesis/module/export diff --git a/x/accountedpool/genesis_test.go b/x/accountedpool/genesis_test.go index b90383221..7ecefccb7 100644 --- a/x/accountedpool/genesis_test.go +++ b/x/accountedpool/genesis_test.go @@ -12,8 +12,6 @@ import ( func TestGenesis(t *testing.T) { genesisState := types.GenesisState{ - Params: types.DefaultParams(), - AccountedPoolList: []types.AccountedPool{ { PoolId: (uint64)(0), diff --git a/x/accountedpool/keeper/accounted_pool.go b/x/accountedpool/keeper/accounted_pool.go index 6a987b401..c4ae7aeda 100644 --- a/x/accountedpool/keeper/accounted_pool.go +++ b/x/accountedpool/keeper/accounted_pool.go @@ -10,22 +10,14 @@ import ( func (k Keeper) SetAccountedPool(ctx sdk.Context, accountedPool types.AccountedPool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AccountedPoolKeyPrefix)) b := k.cdc.MustMarshal(&accountedPool) - store.Set(types.AccountedPoolKey( - accountedPool.PoolId, - ), b) + store.Set(types.AccountedPoolKey(accountedPool.PoolId), b) } // GetAccountedPool returns a accountedPool from its index -func (k Keeper) GetAccountedPool( - ctx sdk.Context, - PoolId uint64, -) (val types.AccountedPool, found bool) { +func (k Keeper) GetAccountedPool(ctx sdk.Context, PoolId uint64) (val types.AccountedPool, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AccountedPoolKeyPrefix)) - b := store.Get(types.AccountedPoolKey( - PoolId, - )) - + b := store.Get(types.AccountedPoolKey(PoolId)) if b == nil { return val, false } @@ -35,14 +27,9 @@ func (k Keeper) GetAccountedPool( } // RemoveAccountedPool removes a accountedPool from the store -func (k Keeper) RemoveAccountedPool( - ctx sdk.Context, - poolId uint64, -) { +func (k Keeper) RemoveAccountedPool(ctx sdk.Context, poolId uint64) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AccountedPoolKeyPrefix)) - store.Delete(types.AccountedPoolKey( - poolId, - )) + store.Delete(types.AccountedPoolKey(poolId)) } // GetAllAccountedPool returns all accountedPool diff --git a/x/accountedpool/keeper/accounted_pool_initiate.go b/x/accountedpool/keeper/accounted_pool_initiate.go index 04ad1785c..bb83f3bc7 100644 --- a/x/accountedpool/keeper/accounted_pool_initiate.go +++ b/x/accountedpool/keeper/accounted_pool_initiate.go @@ -1,8 +1,6 @@ package keeper import ( - "errors" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/elys-network/elys/x/accountedpool/types" ammtypes "github.com/elys-network/elys/x/amm/types" @@ -13,7 +11,7 @@ func (k Keeper) InitiateAccountedPool(ctx sdk.Context, ammPool ammtypes.Pool) er // Check if already exists exists := k.PoolExists(ctx, poolId) if exists { - return errors.New("already existed pool!") + return types.ErrPoolDoesNotExist } // Initiate pool diff --git a/x/accountedpool/keeper/accounted_pool_update.go b/x/accountedpool/keeper/accounted_pool_update.go index 1855b673b..b9ba83399 100644 --- a/x/accountedpool/keeper/accounted_pool_update.go +++ b/x/accountedpool/keeper/accounted_pool_update.go @@ -1,9 +1,8 @@ package keeper import ( - "errors" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/accountedpool/types" ammtypes "github.com/elys-network/elys/x/amm/types" margintypes "github.com/elys-network/elys/x/margin/types" ) @@ -13,13 +12,13 @@ func (k Keeper) UpdateAccountedPool(ctx sdk.Context, ammPool ammtypes.Pool, marg // Check if already exists exists := k.PoolExists(ctx, poolId) if !exists { - return errors.New("pool doesn't exist!") + return types.ErrPoolDoesNotExist } // Get accounted pool accountedPool, found := k.GetAccountedPool(ctx, poolId) if !found { - return errors.New("pool doesn't exist!") + return types.ErrPoolDoesNotExist } // Accounted Pool balance = diff --git a/x/accountedpool/keeper/keeper.go b/x/accountedpool/keeper/keeper.go index 0e7d7a43c..d2293d466 100644 --- a/x/accountedpool/keeper/keeper.go +++ b/x/accountedpool/keeper/keeper.go @@ -7,7 +7,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/elys-network/elys/x/accountedpool/types" ) @@ -17,7 +16,6 @@ type ( cdc codec.BinaryCodec storeKey storetypes.StoreKey memKey storetypes.StoreKey - paramstore paramtypes.Subspace bankKeeper types.BankKeeper } ) @@ -26,19 +24,12 @@ func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, - ps paramtypes.Subspace, bk types.BankKeeper, ) *Keeper { - // set KeyTable if it has not already been set - if !ps.HasKeyTable() { - ps = ps.WithKeyTable(types.ParamKeyTable()) - } - return &Keeper{ cdc: cdc, storeKey: storeKey, memKey: memKey, - paramstore: ps, bankKeeper: bk, } } diff --git a/x/accountedpool/keeper/params.go b/x/accountedpool/keeper/params.go deleted file mode 100644 index d6e4b3554..000000000 --- a/x/accountedpool/keeper/params.go +++ /dev/null @@ -1,34 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/accountedpool/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.KeyPrefix(types.ParamsKey)) - if bz == nil { - return params - } - - k.cdc.MustUnmarshal(bz, ¶ms) - return params -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params *types.Params) error { - if err := params.Validate(); err != nil { - return err - } - - store := ctx.KVStore(k.storeKey) - bz, err := k.cdc.Marshal(params) - if err != nil { - return err - } - store.Set(types.KeyPrefix(types.ParamsKey), bz) - - return nil -} diff --git a/x/accountedpool/keeper/params_test.go b/x/accountedpool/keeper/params_test.go deleted file mode 100644 index bc1bac9c8..000000000 --- a/x/accountedpool/keeper/params_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package keeper_test - -import ( - "testing" - - testkeeper "github.com/elys-network/elys/testutil/keeper" - "github.com/elys-network/elys/x/accountedpool/types" - "github.com/stretchr/testify/require" -) - -func TestGetParams(t *testing.T) { - k, ctx := testkeeper.AccountedPoolKeeper(t) - params := types.DefaultParams() - - k.SetParams(ctx, ¶ms) - - require.EqualValues(t, params, k.GetParams(ctx)) -} diff --git a/x/accountedpool/keeper/query_accounted_pool.go b/x/accountedpool/keeper/query_accounted_pool.go index c6046dda0..517e88b38 100644 --- a/x/accountedpool/keeper/query_accounted_pool.go +++ b/x/accountedpool/keeper/query_accounted_pool.go @@ -44,10 +44,7 @@ func (k Keeper) AccountedPool(goCtx context.Context, req *types.QueryGetAccounte } ctx := sdk.UnwrapSDKContext(goCtx) - val, found := k.GetAccountedPool( - ctx, - req.PoolId, - ) + val, found := k.GetAccountedPool(ctx, req.PoolId) if !found { return nil, status.Error(codes.NotFound, "not found") } diff --git a/x/accountedpool/keeper/query_params.go b/x/accountedpool/keeper/query_params.go deleted file mode 100644 index 6e1ae46f1..000000000 --- a/x/accountedpool/keeper/query_params.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/elys-network/elys/x/accountedpool/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil -} diff --git a/x/accountedpool/keeper/query_params_test.go b/x/accountedpool/keeper/query_params_test.go deleted file mode 100644 index a03bd5337..000000000 --- a/x/accountedpool/keeper/query_params_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - testkeeper "github.com/elys-network/elys/testutil/keeper" - "github.com/elys-network/elys/x/accountedpool/types" - "github.com/stretchr/testify/require" -) - -func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.AccountedPoolKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - keeper.SetParams(ctx, ¶ms) - - response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} diff --git a/x/accountedpool/module_simulation.go b/x/accountedpool/module_simulation.go index 541e06056..d0dbd39bf 100644 --- a/x/accountedpool/module_simulation.go +++ b/x/accountedpool/module_simulation.go @@ -33,7 +33,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { accs[i] = acc.Address.String() } tvlGenesis := types.GenesisState{ - Params: types.DefaultParams(), // this line is used by starport scaffolding # simapp/module/genesisState } simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&tvlGenesis) diff --git a/x/accountedpool/types/errors.go b/x/accountedpool/types/errors.go index 01e984cd4..28ae2b0a3 100644 --- a/x/accountedpool/types/errors.go +++ b/x/accountedpool/types/errors.go @@ -6,7 +6,8 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// x/tvl module sentinel errors +// x/accountedpool module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrPoolDoesNotExist = sdkerrors.Register(ModuleName, 1, "pool does not exist") + ErrDuplicatedAccountedPoolId = sdkerrors.Register(ModuleName, 2, "duplicated poolId for accountedPool") ) diff --git a/x/accountedpool/types/genesis.go b/x/accountedpool/types/genesis.go index b5d2b9ae7..1c3a77942 100644 --- a/x/accountedpool/types/genesis.go +++ b/x/accountedpool/types/genesis.go @@ -1,9 +1,5 @@ package types -import ( - "fmt" -) - // DefaultIndex is the default global index const DefaultIndex uint64 = 1 @@ -12,7 +8,6 @@ func DefaultGenesis() *GenesisState { return &GenesisState{ AccountedPoolList: []AccountedPool{}, // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), } } @@ -25,11 +20,11 @@ func (gs GenesisState) Validate() error { for _, elem := range gs.AccountedPoolList { index := string(AccountedPoolKey(elem.PoolId)) if _, ok := accountedPoolIndexMap[index]; ok { - return fmt.Errorf("duplicated index for accountedPool") + return ErrDuplicatedAccountedPoolId } accountedPoolIndexMap[index] = struct{}{} } // this line is used by starport scaffolding # genesis/types/validate - return gs.Params.Validate() + return nil } diff --git a/x/accountedpool/types/genesis.pb.go b/x/accountedpool/types/genesis.pb.go index 12d851d57..9777b7bd3 100644 --- a/x/accountedpool/types/genesis.pb.go +++ b/x/accountedpool/types/genesis.pb.go @@ -25,8 +25,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // GenesisState defines the tvl module's genesis state. type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - AccountedPoolList []AccountedPool `protobuf:"bytes,2,rep,name=accounted_pool_list,json=accountedPoolList,proto3" json:"accounted_pool_list"` + AccountedPoolList []AccountedPool `protobuf:"bytes,1,rep,name=accounted_pool_list,json=accountedPoolList,proto3" json:"accounted_pool_list"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -62,13 +61,6 @@ func (m *GenesisState) XXX_DiscardUnknown() { var xxx_messageInfo_GenesisState proto.InternalMessageInfo -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - func (m *GenesisState) GetAccountedPoolList() []AccountedPool { if m != nil { return m.AccountedPoolList @@ -83,23 +75,21 @@ func init() { func init() { proto.RegisterFile("elys/accountedpool/genesis.proto", fileDescriptor_365e99d543e5a5e3) } var fileDescriptor_365e99d543e5a5e3 = []byte{ - // 250 bytes of a gzipped FileDescriptorProto + // 213 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xcd, 0xa9, 0x2c, 0xd6, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x4d, 0x29, 0xc8, 0xcf, 0xcf, 0xd1, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0xa9, 0xd0, 0x43, 0x51, 0x21, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, 0xd6, 0x07, 0xb1, 0x20, 0x2a, - 0xa5, 0xe4, 0xb1, 0x98, 0x55, 0x90, 0x58, 0x94, 0x98, 0x0b, 0x35, 0x4a, 0x4a, 0x1d, 0x8b, 0x02, - 0x38, 0x2f, 0x1e, 0xc4, 0x85, 0x28, 0x54, 0x5a, 0xc8, 0xc8, 0xc5, 0xe3, 0x0e, 0x71, 0x45, 0x70, - 0x49, 0x62, 0x49, 0xaa, 0x90, 0x05, 0x17, 0x1b, 0xc4, 0x24, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x6e, - 0x23, 0x29, 0x3d, 0x4c, 0x57, 0xe9, 0x05, 0x80, 0x55, 0x38, 0xb1, 0x9c, 0xb8, 0x27, 0xcf, 0x10, - 0x04, 0x55, 0x2f, 0x14, 0xce, 0x25, 0x8c, 0x6a, 0x45, 0x7c, 0x4e, 0x66, 0x71, 0x89, 0x04, 0x93, - 0x02, 0xb3, 0x06, 0xb7, 0x91, 0x22, 0x36, 0x63, 0x1c, 0x61, 0xbc, 0x80, 0xfc, 0xfc, 0x1c, 0xa8, - 0x69, 0x82, 0x89, 0xc8, 0x82, 0x3e, 0x99, 0xc5, 0x25, 0x4e, 0x3e, 0x27, 0x1e, 0xc9, 0x31, 0x5e, - 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, - 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x94, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, - 0xab, 0x0f, 0x32, 0x5f, 0x37, 0x2f, 0xb5, 0xa4, 0x3c, 0xbf, 0x28, 0x1b, 0xcc, 0xd1, 0xaf, 0x40, - 0x0b, 0x80, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xc7, 0x8d, 0x01, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x90, 0x2a, 0xad, 0xfa, 0x90, 0x01, 0x00, 0x00, + 0xa5, 0xd4, 0xb1, 0x98, 0x05, 0xe7, 0xc5, 0x83, 0xb8, 0x10, 0x85, 0x4a, 0xe9, 0x5c, 0x3c, 0xee, + 0x10, 0x3b, 0x82, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0xc2, 0xb9, 0x84, 0x51, 0xd5, 0xc5, 0xe7, 0x64, + 0x16, 0x97, 0x48, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0x29, 0xea, 0x61, 0x3a, 0x40, 0xcf, 0x11, + 0xc6, 0x0b, 0xc8, 0xcf, 0xcf, 0x71, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x48, 0x30, 0x11, 0x59, + 0xd0, 0x27, 0xb3, 0xb8, 0xc4, 0xc9, 0xe7, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, + 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, + 0xa2, 0x8c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, 0xe6, 0xeb, + 0xe6, 0xa5, 0x96, 0x94, 0xe7, 0x17, 0x65, 0x83, 0x39, 0xfa, 0x15, 0x68, 0xbe, 0x28, 0xa9, 0x2c, + 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xbb, 0xde, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x42, 0x84, 0x66, + 0x69, 0x34, 0x01, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -133,19 +123,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenesis(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + dAtA[i] = 0xa } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -166,8 +146,6 @@ func (m *GenesisState) Size() (n int) { } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) if len(m.AccountedPoolList) > 0 { for _, e := range m.AccountedPoolList { l = e.Size() @@ -213,39 +191,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AccountedPoolList", wireType) } diff --git a/x/accountedpool/types/key_accounted_pool.go b/x/accountedpool/types/key_accounted_pool.go index 331e89685..4720166b9 100644 --- a/x/accountedpool/types/key_accounted_pool.go +++ b/x/accountedpool/types/key_accounted_pool.go @@ -10,9 +10,7 @@ const ( ) // AccountedPoolKey returns the store key to retrieve a AccountedPool from the index fields -func AccountedPoolKey( - poolId uint64, -) []byte { +func AccountedPoolKey(poolId uint64) []byte { var key []byte poolIdBytes := make([]byte, 8) diff --git a/x/accountedpool/types/params.go b/x/accountedpool/types/params.go deleted file mode 100644 index 357196ad6..000000000 --- a/x/accountedpool/types/params.go +++ /dev/null @@ -1,39 +0,0 @@ -package types - -import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams() Params { - return Params{} -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams() -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{} -} - -// Validate validates the set of params -func (p Params) Validate() error { - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/accountedpool/types/params.pb.go b/x/accountedpool/types/params.pb.go deleted file mode 100644 index 32c1d1ae6..000000000 --- a/x/accountedpool/types/params.pb.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: elys/accountedpool/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_5584d9bd0669ed47, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "elys.accountedpool.Params") -} - -func init() { proto.RegisterFile("elys/accountedpool/params.proto", fileDescriptor_5584d9bd0669ed47) } - -var fileDescriptor_5584d9bd0669ed47 = []byte{ - // 157 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0xcd, 0xa9, 0x2c, - 0xd6, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x49, 0x4d, 0x29, 0xc8, 0xcf, 0xcf, 0xd1, 0x2f, - 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x02, 0x29, 0xd0, - 0x43, 0x51, 0x20, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x96, 0xd6, 0x07, 0xb1, 0x20, 0x2a, 0x95, - 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x3a, 0xad, 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x39, 0xf1, - 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, - 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, - 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x90, 0xf1, 0xba, 0x79, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0x60, - 0x8e, 0x7e, 0x05, 0x9a, 0x73, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x96, 0x18, 0x03, - 0x02, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xc0, 0x6a, 0xe6, 0xb1, 0x00, 0x00, 0x00, -} - -func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) 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 ErrIntOverflowParams - } - 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: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/accountedpool/types/query.pb.go b/x/accountedpool/types/query.pb.go index c465123ef..80e07df7e 100644 --- a/x/accountedpool/types/query.pb.go +++ b/x/accountedpool/types/query.pb.go @@ -30,89 +30,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -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_2ec06194af40e0c7, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -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_2ec06194af40e0c7, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - type QueryGetAccountedPoolRequest struct { PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty"` } @@ -121,7 +38,7 @@ func (m *QueryGetAccountedPoolRequest) Reset() { *m = QueryGetAccountedP func (m *QueryGetAccountedPoolRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetAccountedPoolRequest) ProtoMessage() {} func (*QueryGetAccountedPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2ec06194af40e0c7, []int{2} + return fileDescriptor_2ec06194af40e0c7, []int{0} } func (m *QueryGetAccountedPoolRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -165,7 +82,7 @@ func (m *QueryGetAccountedPoolResponse) Reset() { *m = QueryGetAccounted func (m *QueryGetAccountedPoolResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetAccountedPoolResponse) ProtoMessage() {} func (*QueryGetAccountedPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2ec06194af40e0c7, []int{3} + return fileDescriptor_2ec06194af40e0c7, []int{1} } func (m *QueryGetAccountedPoolResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +126,7 @@ func (m *QueryAllAccountedPoolRequest) Reset() { *m = QueryAllAccountedP func (m *QueryAllAccountedPoolRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllAccountedPoolRequest) ProtoMessage() {} func (*QueryAllAccountedPoolRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2ec06194af40e0c7, []int{4} + return fileDescriptor_2ec06194af40e0c7, []int{2} } func (m *QueryAllAccountedPoolRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -254,7 +171,7 @@ func (m *QueryAllAccountedPoolResponse) Reset() { *m = QueryAllAccounted func (m *QueryAllAccountedPoolResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllAccountedPoolResponse) ProtoMessage() {} func (*QueryAllAccountedPoolResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2ec06194af40e0c7, []int{5} + return fileDescriptor_2ec06194af40e0c7, []int{3} } func (m *QueryAllAccountedPoolResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -298,8 +215,6 @@ func (m *QueryAllAccountedPoolResponse) GetPagination() *query.PageResponse { } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "elys.accountedpool.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "elys.accountedpool.QueryParamsResponse") proto.RegisterType((*QueryGetAccountedPoolRequest)(nil), "elys.accountedpool.QueryGetAccountedPoolRequest") proto.RegisterType((*QueryGetAccountedPoolResponse)(nil), "elys.accountedpool.QueryGetAccountedPoolResponse") proto.RegisterType((*QueryAllAccountedPoolRequest)(nil), "elys.accountedpool.QueryAllAccountedPoolRequest") @@ -309,39 +224,35 @@ func init() { func init() { proto.RegisterFile("elys/accountedpool/query.proto", fileDescriptor_2ec06194af40e0c7) } var fileDescriptor_2ec06194af40e0c7 = []byte{ - // 511 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0x4f, 0x6b, 0x13, 0x41, - 0x18, 0xc6, 0x33, 0x35, 0x46, 0x18, 0xa9, 0xc8, 0x58, 0x50, 0x96, 0xba, 0xd5, 0x3d, 0x34, 0x2a, - 0x38, 0x63, 0xe2, 0xa1, 0x8a, 0xa7, 0xf4, 0x60, 0x11, 0x44, 0x63, 0x8e, 0x5e, 0xca, 0x24, 0x19, - 0xd7, 0xc5, 0xcd, 0xbe, 0xdb, 0xcc, 0xac, 0x1a, 0xc4, 0x83, 0x1e, 0x3d, 0x09, 0x7e, 0x11, 0x6f, - 0xfa, 0x11, 0x7a, 0x2c, 0x78, 0xf1, 0x24, 0x92, 0xf8, 0x41, 0x64, 0xfe, 0x54, 0x33, 0x66, 0x37, - 0xa1, 0xde, 0x32, 0x33, 0xcf, 0xf3, 0x3e, 0xbf, 0x37, 0xef, 0xcb, 0xe2, 0x50, 0xa4, 0x13, 0xc9, - 0xf8, 0x60, 0x00, 0x45, 0xa6, 0xc4, 0x30, 0x07, 0x48, 0xd9, 0x41, 0x21, 0xc6, 0x13, 0x9a, 0x8f, - 0x41, 0x01, 0x21, 0xfa, 0x9d, 0x7a, 0xef, 0xc1, 0x46, 0x0c, 0x31, 0x98, 0x67, 0xa6, 0x7f, 0x59, - 0x65, 0xb0, 0x19, 0x03, 0xc4, 0xa9, 0x60, 0x3c, 0x4f, 0x18, 0xcf, 0x32, 0x50, 0x5c, 0x25, 0x90, - 0x49, 0xf7, 0x7a, 0x63, 0x00, 0x72, 0x04, 0x92, 0xf5, 0xb9, 0x14, 0x36, 0x80, 0xbd, 0x6c, 0xf5, - 0x85, 0xe2, 0x2d, 0x96, 0xf3, 0x38, 0xc9, 0x8c, 0xd8, 0x69, 0xb7, 0x4a, 0x98, 0x72, 0x3e, 0xe6, - 0xa3, 0xe3, 0x62, 0xcd, 0x12, 0xc1, 0x9f, 0xd3, 0xbe, 0x3e, 0x5a, 0x61, 0xb4, 0x81, 0xc9, 0x13, - 0x9d, 0xd5, 0x35, 0xee, 0x9e, 0x38, 0x28, 0x84, 0x54, 0xd1, 0x63, 0x7c, 0xc1, 0xbb, 0x95, 0x39, - 0x64, 0x52, 0x90, 0x3b, 0xb8, 0x61, 0x53, 0x2e, 0xa1, 0x2b, 0xe8, 0xda, 0xd9, 0x76, 0x40, 0x17, - 0x7b, 0xa7, 0xd6, 0xb3, 0x5b, 0x3f, 0xfc, 0xb1, 0x55, 0xeb, 0x39, 0x7d, 0xb4, 0x83, 0x37, 0x4d, - 0xc1, 0x3d, 0xa1, 0x3a, 0xc7, 0xea, 0x2e, 0x40, 0xea, 0x02, 0xc9, 0x45, 0x7c, 0x46, 0x9b, 0xf7, - 0x93, 0xa1, 0x29, 0x5d, 0xef, 0x35, 0xf4, 0xf1, 0xc1, 0x30, 0x02, 0x7c, 0xb9, 0xc2, 0xe8, 0x98, - 0x1e, 0xe1, 0x73, 0x7e, 0x63, 0x8e, 0xed, 0x6a, 0x19, 0x9b, 0x57, 0xc2, 0x21, 0xae, 0xf3, 0xf9, - 0xcb, 0xe8, 0x99, 0x23, 0xed, 0xa4, 0x69, 0x29, 0xe9, 0x7d, 0x8c, 0xff, 0x8e, 0xc3, 0x65, 0x6d, - 0x53, 0x3b, 0x3b, 0xaa, 0x67, 0x47, 0xed, 0x72, 0xb8, 0xd9, 0xd1, 0x2e, 0x8f, 0x85, 0xf3, 0xf6, - 0xe6, 0x9c, 0xd1, 0x57, 0xe4, 0x3a, 0x5b, 0x0c, 0x5a, 0xd2, 0xd9, 0xa9, 0xff, 0xef, 0x8c, 0xec, - 0x79, 0xe4, 0x6b, 0x86, 0xbc, 0xb9, 0x92, 0xdc, 0xc2, 0xcc, 0xa3, 0xb7, 0xdf, 0xd5, 0xf1, 0x69, - 0x83, 0x4e, 0x3e, 0x20, 0xdc, 0xb0, 0xf3, 0x26, 0xdb, 0x65, 0x54, 0x8b, 0xab, 0x15, 0x34, 0x57, - 0xea, 0x6c, 0x62, 0xc4, 0xde, 0x7f, 0xfb, 0xf5, 0x69, 0xed, 0x3a, 0x69, 0x32, 0x6d, 0xb8, 0x99, - 0x09, 0xf5, 0x0a, 0xc6, 0x2f, 0x58, 0xe5, 0xe6, 0x93, 0x2f, 0x08, 0xaf, 0x7b, 0x7f, 0x03, 0xb9, - 0x55, 0x99, 0x55, 0xb1, 0x87, 0x41, 0xeb, 0x04, 0x0e, 0xc7, 0xd9, 0x31, 0x9c, 0xf7, 0xc8, 0xdd, - 0x95, 0x9c, 0xfe, 0x34, 0xd9, 0x1b, 0xb7, 0xf1, 0x6f, 0xc9, 0x67, 0x84, 0xcf, 0x7b, 0xc5, 0x3b, - 0xe9, 0x32, 0xf8, 0x8a, 0xd5, 0x5c, 0x02, 0x5f, 0xb5, 0x63, 0xd1, 0x8e, 0x81, 0x6f, 0x11, 0x76, - 0x42, 0xf8, 0xdd, 0x87, 0x87, 0xd3, 0x10, 0x1d, 0x4d, 0x43, 0xf4, 0x73, 0x1a, 0xa2, 0x8f, 0xb3, - 0xb0, 0x76, 0x34, 0x0b, 0x6b, 0xdf, 0x67, 0x61, 0xed, 0x69, 0x3b, 0x4e, 0xd4, 0xf3, 0xa2, 0x4f, - 0x07, 0x30, 0x2a, 0x29, 0xfa, 0xfa, 0x9f, 0xb2, 0x6a, 0x92, 0x0b, 0xd9, 0x6f, 0x98, 0x8f, 0xd1, - 0xed, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x54, 0x1c, 0x90, 0x4f, 0x6c, 0x05, 0x00, 0x00, + // 443 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xcd, 0xaa, 0xd3, 0x40, + 0x14, 0xc7, 0x33, 0xf5, 0x7a, 0x85, 0x91, 0x2b, 0x32, 0x08, 0x4a, 0xb9, 0x46, 0xcd, 0xc2, 0x2b, + 0x82, 0x33, 0xa6, 0x2e, 0x8a, 0xb8, 0x4a, 0x17, 0x16, 0x41, 0xa4, 0x66, 0xe9, 0xa6, 0x4c, 0xd2, + 0x31, 0x06, 0xd3, 0x9c, 0xb4, 0x33, 0x51, 0x8b, 0xb8, 0xf1, 0x09, 0x04, 0x5f, 0xc4, 0x9d, 0x3e, + 0x42, 0x97, 0x05, 0x37, 0xae, 0x44, 0x5a, 0x1f, 0xc1, 0x07, 0x90, 0x49, 0x46, 0x6d, 0x6c, 0x9a, + 0xd2, 0xbb, 0xcb, 0xc9, 0x39, 0xe7, 0x7f, 0x7e, 0xe7, 0x63, 0xb0, 0x2d, 0x92, 0x99, 0x64, 0x3c, + 0x0c, 0x21, 0x4f, 0x95, 0x18, 0x65, 0x00, 0x09, 0x9b, 0xe4, 0x62, 0x3a, 0xa3, 0xd9, 0x14, 0x14, + 0x10, 0xa2, 0xfd, 0xb4, 0xe2, 0x6f, 0x5f, 0x8a, 0x20, 0x82, 0xc2, 0xcd, 0xf4, 0x57, 0x19, 0xd9, + 0x3e, 0x8e, 0x00, 0xa2, 0x44, 0x30, 0x9e, 0xc5, 0x8c, 0xa7, 0x29, 0x28, 0xae, 0x62, 0x48, 0xa5, + 0xf1, 0xde, 0x0e, 0x41, 0x8e, 0x41, 0xb2, 0x80, 0x4b, 0x51, 0x16, 0x60, 0xaf, 0xdc, 0x40, 0x28, + 0xee, 0xb2, 0x8c, 0x47, 0x71, 0x5a, 0x04, 0x9b, 0xd8, 0x93, 0x1a, 0xa6, 0xbf, 0xd6, 0x50, 0x9b, + 0x65, 0xa0, 0xd3, 0xc5, 0xc7, 0x4f, 0xb5, 0x54, 0x5f, 0x28, 0xef, 0x8f, 0x7f, 0x00, 0x90, 0xf8, + 0x62, 0x92, 0x0b, 0xa9, 0xc8, 0x65, 0x7c, 0x4e, 0x47, 0x0f, 0xe3, 0xd1, 0x15, 0x74, 0x1d, 0xdd, + 0x3a, 0xf0, 0x0f, 0xb5, 0xf9, 0x68, 0xe4, 0x00, 0xbe, 0xba, 0x25, 0x51, 0x66, 0x90, 0x4a, 0x41, + 0x9e, 0xe0, 0x0b, 0xd5, 0x8a, 0x85, 0xc0, 0xf9, 0xce, 0x0d, 0xba, 0x39, 0x0f, 0x5a, 0x91, 0xe8, + 0x1d, 0xcc, 0xbf, 0x5f, 0xb3, 0xfc, 0x23, 0xbe, 0xfe, 0xd3, 0x79, 0x6e, 0x48, 0xbd, 0x24, 0xa9, + 0x25, 0x7d, 0x88, 0xf1, 0xbf, 0x31, 0x98, 0x5a, 0x37, 0x69, 0x39, 0x33, 0xaa, 0x67, 0x46, 0xcb, + 0xa5, 0x98, 0x99, 0xd1, 0x01, 0x8f, 0x84, 0xc9, 0xf5, 0xd7, 0x32, 0x9d, 0x2f, 0xc8, 0x74, 0xb6, + 0x59, 0xa8, 0xa1, 0xb3, 0x33, 0xa7, 0xef, 0x8c, 0xf4, 0x2b, 0xe4, 0xad, 0x82, 0xfc, 0x64, 0x27, + 0x79, 0x09, 0xb3, 0x8e, 0xde, 0xf9, 0xd5, 0xc2, 0x67, 0x0b, 0x74, 0xf2, 0x19, 0xe1, 0xa3, 0x4a, + 0x65, 0x72, 0xb7, 0x0e, 0xae, 0x69, 0xf5, 0x6d, 0x77, 0x8f, 0x8c, 0x12, 0xc6, 0xf1, 0xde, 0x7f, + 0xfd, 0xf9, 0xb1, 0xf5, 0x80, 0xdc, 0x67, 0x3a, 0xf5, 0x4e, 0x2a, 0xd4, 0x6b, 0x98, 0xbe, 0x64, + 0x3b, 0x8f, 0x91, 0xbd, 0x35, 0x47, 0xf6, 0x8e, 0x7c, 0x42, 0xf8, 0x62, 0x45, 0xdc, 0x4b, 0x9a, + 0xe0, 0xb7, 0x5c, 0x43, 0x03, 0xfc, 0xb6, 0xb5, 0x3a, 0xdd, 0x02, 0xde, 0x25, 0x6c, 0x4f, 0xf8, + 0xde, 0xe3, 0xf9, 0xd2, 0x46, 0x8b, 0xa5, 0x8d, 0x7e, 0x2c, 0x6d, 0xf4, 0x61, 0x65, 0x5b, 0x8b, + 0x95, 0x6d, 0x7d, 0x5b, 0xd9, 0xd6, 0xb3, 0x4e, 0x14, 0xab, 0x17, 0x79, 0x40, 0x43, 0x18, 0xd7, + 0x88, 0xbe, 0xf9, 0x4f, 0x56, 0xcd, 0x32, 0x21, 0x83, 0xc3, 0xe2, 0x61, 0xde, 0xfb, 0x1d, 0x00, + 0x00, 0xff, 0xff, 0x19, 0x9b, 0xc6, 0x24, 0x57, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -356,8 +267,6 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Queries a list of AccountedPool items. AccountedPool(ctx context.Context, in *QueryGetAccountedPoolRequest, opts ...grpc.CallOption) (*QueryGetAccountedPoolResponse, error) AccountedPoolAll(ctx context.Context, in *QueryAllAccountedPoolRequest, opts ...grpc.CallOption) (*QueryAllAccountedPoolResponse, error) @@ -371,15 +280,6 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/elys.accountedpool.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) AccountedPool(ctx context.Context, in *QueryGetAccountedPoolRequest, opts ...grpc.CallOption) (*QueryGetAccountedPoolResponse, error) { out := new(QueryGetAccountedPoolResponse) err := c.cc.Invoke(ctx, "/elys.accountedpool.Query/AccountedPool", in, out, opts...) @@ -400,8 +300,6 @@ func (c *queryClient) AccountedPoolAll(ctx context.Context, in *QueryAllAccounte // QueryServer is the server API for Query service. type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Queries a list of AccountedPool items. AccountedPool(context.Context, *QueryGetAccountedPoolRequest) (*QueryGetAccountedPoolResponse, error) AccountedPoolAll(context.Context, *QueryAllAccountedPoolRequest) (*QueryAllAccountedPoolResponse, error) @@ -411,9 +309,6 @@ type QueryServer interface { type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} func (*UnimplementedQueryServer) AccountedPool(ctx context.Context, req *QueryGetAccountedPoolRequest) (*QueryGetAccountedPoolResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AccountedPool not implemented") } @@ -425,24 +320,6 @@ func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -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 { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/elys.accountedpool.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_AccountedPool_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetAccountedPoolRequest) if err := dec(in); err != nil { @@ -483,10 +360,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "elys.accountedpool.Query", HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, { MethodName: "AccountedPool", Handler: _Query_AccountedPool_Handler, @@ -500,62 +373,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Metadata: "elys/accountedpool/query.proto", } -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 *QueryGetAccountedPoolRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -712,26 +529,6 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - func (m *QueryGetAccountedPoolRequest) Size() (n int) { if m == nil { return 0 @@ -793,139 +590,6 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", 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.Params.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 *QueryGetAccountedPoolRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/accountedpool/types/query.pb.gw.go b/x/accountedpool/types/query.pb.gw.go index f1121021e..6a905111e 100644 --- a/x/accountedpool/types/query.pb.gw.go +++ b/x/accountedpool/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,25 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join - -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 - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} func request_Query_AccountedPool_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetAccountedPoolRequest @@ -144,37 +124,12 @@ func local_request_Query_AccountedPoolAll_0(ctx context.Context, marshaler runti // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - 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() - 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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_AccountedPool_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 { @@ -182,7 +137,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_AccountedPool_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) @@ -196,8 +150,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_AccountedPoolAll_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 { @@ -205,7 +157,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_AccountedPoolAll_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) @@ -257,26 +208,6 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - 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() - 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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_AccountedPool_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -321,16 +252,12 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "accountedpool", "params"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_AccountedPool_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "accountedpool", "accounted_pool", "pool_id"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_AccountedPoolAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "accountedpool", "accounted_pool"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - forward_Query_AccountedPool_0 = runtime.ForwardResponseMessage forward_Query_AccountedPoolAll_0 = runtime.ForwardResponseMessage diff --git a/x/accountedpool/types/types.go b/x/accountedpool/types/types.go deleted file mode 100644 index ab1254f4c..000000000 --- a/x/accountedpool/types/types.go +++ /dev/null @@ -1 +0,0 @@ -package types