From 4e8619760ffcfd49f90cd0f87175c4503fba974a Mon Sep 17 00:00:00 2001 From: Vishnu Kumavat Date: Tue, 21 Jun 2022 19:14:01 +0530 Subject: [PATCH] removed locking module --- app/app.go | 25 +- proto/comdex/locking/v1beta1/genesis.proto | 14 - proto/comdex/locking/v1beta1/lock.proto | 65 - proto/comdex/locking/v1beta1/params.proto | 19 - proto/comdex/locking/v1beta1/query.proto | 108 - proto/comdex/locking/v1beta1/tx.proto | 51 - x/locking/abci.go | 13 - x/locking/client/cli/flags.go | 18 - x/locking/client/cli/query.go | 317 --- x/locking/client/cli/tx.go | 122 - x/locking/expected/keeper.go | 19 - x/locking/genesis.go | 21 - x/locking/handler.go | 29 - x/locking/keeper/grpc_query.go | 190 -- x/locking/keeper/keeper.go | 53 - x/locking/keeper/lock.go | 174 -- x/locking/keeper/msg_server.go | 118 - x/locking/keeper/params.go | 17 - x/locking/keeper/store.go | 183 -- x/locking/module.go | 178 -- x/locking/simulation/simap.go | 15 - x/locking/types/codec.go | 40 - x/locking/types/errors.go | 16 - x/locking/types/events.go | 16 - x/locking/types/genesis.go | 17 - x/locking/types/genesis.pb.go | 323 --- x/locking/types/keys.go | 48 - x/locking/types/lock.go | 42 - x/locking/types/lock.pb.go | 1459 ---------- x/locking/types/msgs.go | 88 - x/locking/types/params.go | 77 - x/locking/types/params.pb.go | 326 --- x/locking/types/query.pb.go | 2871 -------------------- x/locking/types/query.pb.gw.go | 723 ----- x/locking/types/tx.pb.go | 1062 -------- x/locking/types/types.go | 1 - 36 files changed, 3 insertions(+), 8855 deletions(-) delete mode 100644 proto/comdex/locking/v1beta1/genesis.proto delete mode 100644 proto/comdex/locking/v1beta1/lock.proto delete mode 100644 proto/comdex/locking/v1beta1/params.proto delete mode 100644 proto/comdex/locking/v1beta1/query.proto delete mode 100644 proto/comdex/locking/v1beta1/tx.proto delete mode 100644 x/locking/abci.go delete mode 100644 x/locking/client/cli/flags.go delete mode 100644 x/locking/client/cli/query.go delete mode 100644 x/locking/client/cli/tx.go delete mode 100644 x/locking/expected/keeper.go delete mode 100644 x/locking/genesis.go delete mode 100644 x/locking/handler.go delete mode 100644 x/locking/keeper/grpc_query.go delete mode 100644 x/locking/keeper/keeper.go delete mode 100644 x/locking/keeper/lock.go delete mode 100644 x/locking/keeper/msg_server.go delete mode 100644 x/locking/keeper/params.go delete mode 100644 x/locking/keeper/store.go delete mode 100644 x/locking/module.go delete mode 100644 x/locking/simulation/simap.go delete mode 100644 x/locking/types/codec.go delete mode 100644 x/locking/types/errors.go delete mode 100644 x/locking/types/events.go delete mode 100644 x/locking/types/genesis.go delete mode 100644 x/locking/types/genesis.pb.go delete mode 100644 x/locking/types/keys.go delete mode 100644 x/locking/types/lock.go delete mode 100644 x/locking/types/lock.pb.go delete mode 100644 x/locking/types/msgs.go delete mode 100644 x/locking/types/params.go delete mode 100644 x/locking/types/params.pb.go delete mode 100644 x/locking/types/query.pb.go delete mode 100644 x/locking/types/query.pb.gw.go delete mode 100644 x/locking/types/tx.pb.go delete mode 100644 x/locking/types/types.go diff --git a/app/app.go b/app/app.go index 7704f95f0..614844e2b 100644 --- a/app/app.go +++ b/app/app.go @@ -152,10 +152,6 @@ import ( liquiditykeeper "github.com/comdex-official/comdex/x/liquidity/keeper" liquiditytypes "github.com/comdex-official/comdex/x/liquidity/types" - //"github.com/comdex-official/comdex/x/locking" - //lockingkeeper "github.com/comdex-official/comdex/x/locking/keeper" - //lockingtypes "github.com/comdex-official/comdex/x/locking/types" - cwasm "github.com/comdex-official/comdex/app/wasm" tv1_0_0 "github.com/comdex-official/comdex/app/upgrades/testnet/v1_0_0" @@ -253,7 +249,6 @@ var ( tokenmint.AppModuleBasic{}, wasm.AppModuleBasic{}, liquidity.AppModuleBasic{}, - //locking.AppModuleBasic{}, rewards.AppModuleBasic{}, ) ) @@ -328,8 +323,7 @@ type App struct { AuctionKeeper auctionkeeper.Keeper TokenmintKeeper tokenmintkeeper.Keeper liquidityKeeper liquiditykeeper.Keeper - //lockingKeeper lockingkeeper.Keeper - Rewardskeeper rewardskeeper.Keeper + Rewardskeeper rewardskeeper.Keeper WasmKeeper wasm.Keeper // the module manager @@ -417,7 +411,6 @@ func New( app.ParamsKeeper.Subspace(auctiontypes.ModuleName) app.ParamsKeeper.Subspace(tokenminttypes.ModuleName) app.ParamsKeeper.Subspace(liquiditytypes.ModuleName) - //app.ParamsKeeper.Subspace(lockingtypes.ModuleName) app.ParamsKeeper.Subspace(rewardstypes.ModuleName) // set the BaseApp's parameter store @@ -678,14 +671,6 @@ func New( &app.Rewardskeeper, ) - /*app.lockingKeeper = lockingkeeper.NewKeeper( - app.cdc, - app.keys[lockingtypes.StoreKey], - app.GetSubspace(lockingtypes.ModuleName), - app.AccountKeeper, - app.BankKeeper, - )*/ - app.Rewardskeeper = *rewardskeeper.NewKeeper( app.cdc, app.keys[rewardstypes.StoreKey], @@ -817,7 +802,6 @@ func New( auction.NewAppModule(app.cdc, app.AuctionKeeper, app.AccountKeeper, app.BankKeeper), tokenmint.NewAppModule(app.cdc, app.TokenmintKeeper, app.AccountKeeper, app.BankKeeper), liquidity.NewAppModule(app.cdc, app.liquidityKeeper, app.AccountKeeper, app.BankKeeper), - //locking.NewAppModule(app.cdc, app.lockingKeeper, app.AccountKeeper, app.BankKeeper), rewards.NewAppModule(app.cdc, app.Rewardskeeper, app.AccountKeeper, app.BankKeeper), ) @@ -882,7 +866,6 @@ func New( upgradetypes.ModuleName, paramstypes.ModuleName, liquiditytypes.ModuleName, - //lockingtypes.ModuleName, rewardstypes.ModuleName, ) @@ -1078,9 +1061,8 @@ func (a *App) ModuleAccountsPermissions() map[string][]string { lockertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, wasm.ModuleName: {authtypes.Burner}, liquiditytypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - //lockingtypes.ModuleName: nil, - rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - icatypes.ModuleName: nil, + rewardstypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + icatypes.ModuleName: nil, } } @@ -1124,7 +1106,6 @@ func (a *App) registerUpgradeHandlers() { liquidationtypes.ModuleName, liquiditytypes.ModuleName, lockertypes.ModuleName, - //lockingtypes.ModuleName, markettypes.ModuleName, rewardstypes.ModuleName, tokenminttypes.ModuleName, diff --git a/proto/comdex/locking/v1beta1/genesis.proto b/proto/comdex/locking/v1beta1/genesis.proto deleted file mode 100644 index 80cc7d2a4..000000000 --- a/proto/comdex/locking/v1beta1/genesis.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -package comdex.locking.v1beta1; - -import "gogoproto/gogo.proto"; -import "comdex/locking/v1beta1/params.proto"; -// this line is used by starport scaffolding # genesis/proto/import - -option go_package = "github.com/comdex-official/comdex/x/locking/types"; - -// GenesisState defines the locking module's genesis state. -message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - // this line is used by starport scaffolding # genesis/proto/state -} diff --git a/proto/comdex/locking/v1beta1/lock.proto b/proto/comdex/locking/v1beta1/lock.proto deleted file mode 100644 index b0073ed66..000000000 --- a/proto/comdex/locking/v1beta1/lock.proto +++ /dev/null @@ -1,65 +0,0 @@ -syntax = "proto3"; -package comdex.locking.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/comdex-official/comdex/x/locking/types"; - -// Locked is a single unit of lock by period. It's a record of locked coin -// at a specific time. It stores owner, duration, and the amount of -// coin locked. -message Lock { - uint64 id = 1; - string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - google.protobuf.Timestamp created_at = 3 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"created_at\"" - ]; - google.protobuf.Duration duration = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - cosmos.base.v1beta1.Coin coin = 5 [ - (gogoproto.nullable) = false, - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - ]; -} - -// Once unlocking is triggered the lock gets deleted and its being -// added to the Unlocking and it will stay untill the duration of end time.enum -// Once entime is reached lock is being deleted from unlocking. -message Unlocking { - uint64 id = 1; - string owner = 2 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - google.protobuf.Duration duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - google.protobuf.Timestamp end_time = 4 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"end_time\"" - ]; - cosmos.base.v1beta1.Coin coin = 5 [ - (gogoproto.nullable) = false, - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - ]; -} - -message LockByOwner { - string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - repeated uint64 lock_ids = 2; -} - -message UnlockingByOwner { - string owner = 1 [ (gogoproto.moretags) = "yaml:\"owner\"" ]; - repeated uint64 unlocking_ids = 2; -} \ No newline at end of file diff --git a/proto/comdex/locking/v1beta1/params.proto b/proto/comdex/locking/v1beta1/params.proto deleted file mode 100644 index 756b7ca37..000000000 --- a/proto/comdex/locking/v1beta1/params.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package comdex.locking.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "github.com/comdex-official/comdex/x/locking/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - - google.protobuf.Duration locking_duration = 1 [ - (gogoproto.stdduration) = true, - (gogoproto.nullable) = false - ]; - - -} \ No newline at end of file diff --git a/proto/comdex/locking/v1beta1/query.proto b/proto/comdex/locking/v1beta1/query.proto deleted file mode 100644 index 1351f150b..000000000 --- a/proto/comdex/locking/v1beta1/query.proto +++ /dev/null @@ -1,108 +0,0 @@ -syntax = "proto3"; -package comdex.locking.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "comdex/locking/v1beta1/params.proto"; -import "comdex/locking/v1beta1/lock.proto"; - -option go_package = "github.com/comdex-official/comdex/x/locking/types"; -option (gogoproto.equal_all) = false; -option (gogoproto.goproto_getters_all) = false; - -message QueryParamsRequest {} - -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; -} - -message QueryLockByIdRequest { - uint64 id = 1; -} - -message QueryLockByIdResponse { - Lock lock = 1 - [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"lock\"" ]; -} - -message QueryLocksByOwnerRequest { - string owner = 1; -} - -message QueryLocksByOwnerResponse { - repeated Lock locks = 1 - [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"locks\"" ]; -} - -message QueryAllLocksRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1 - [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; -} - -message QueryAllLocksResponse { - repeated Lock locks = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"locks\"" - ]; - cosmos.base.query.v1beta1.PageResponse pagination = 2 - [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; -} - - -message QueryUnlockingByIdRequest { - uint64 id = 1; -} - -message QueryUnlockingByIdResponse { - Unlocking unlocking = 1 - [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"unlocking\"" ]; -} - -message QueryUnlockingsByOwnerRequest { - string owner = 1; -} - -message QueryUnlockingsByOwnerResponse { - repeated Unlocking unlockings = 1 - [ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"unlockings\"" ]; -} - -message QueryAllUnlockingsRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1 - [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; -} - -message QueryAllUnlockingsResponse { - repeated Unlocking unlockings = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"unlockings\"" - ]; - cosmos.base.query.v1beta1.PageResponse pagination = 2 - [ (gogoproto.moretags) = "yaml:\"pagination\"" ]; -} - - -service Query { - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/comdex/locking/v1beta1/params"; - } - rpc QueryLockByID(QueryLockByIdRequest) returns (QueryLockByIdResponse) { - option (google.api.http).get = "/comdex/locking/v1beta1/lock_id/{id}"; - } - rpc QueryLocksByOwner(QueryLocksByOwnerRequest) returns (QueryLocksByOwnerResponse) { - option (google.api.http).get = "/comdex/locking/v1beta1/lock_owner/{owner}"; - } - rpc QueryAllLocks(QueryAllLocksRequest) returns (QueryAllLocksResponse) { - option (google.api.http).get = "/comdex/locking/v1beta1/locks"; - } - rpc QueryUnlockingByID(QueryUnlockingByIdRequest) returns (QueryUnlockingByIdResponse) { - option (google.api.http).get = "/comdex/locking/v1beta1/unlocking_id/{id}"; - } - rpc QueryUnlockingsByOwner(QueryUnlockingsByOwnerRequest) returns (QueryUnlockingsByOwnerResponse) { - option (google.api.http).get = "/comdex/locking/v1beta1/unlocking_owner/{owner}"; - } - rpc QueryAllUnlockings(QueryAllUnlockingsRequest) returns (QueryAllUnlockingsResponse) { - option (google.api.http).get = "/comdex/locking/v1beta1/unlockings"; - } -} \ No newline at end of file diff --git a/proto/comdex/locking/v1beta1/tx.proto b/proto/comdex/locking/v1beta1/tx.proto deleted file mode 100644 index 468f8c640..000000000 --- a/proto/comdex/locking/v1beta1/tx.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; -package comdex.locking.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// this line is used by starport scaffolding # proto/tx/import - -option go_package = "github.com/comdex-official/comdex/x/locking/types"; - -message MsgLockTokens { - - string owner = 1 [ - (gogoproto.moretags) = "yaml:\"owner\"" - ]; - google.protobuf.Duration duration = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "duration,omitempty", - (gogoproto.moretags) = "yaml:\"duration\"" - ]; - cosmos.base.v1beta1.Coin coin = 3 [ - (gogoproto.nullable) = false, - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - ]; -} - -message MsgLockTokensResponse {} - - -message MsgBeginUnlockingTokens { - - string owner = 1 [ - (gogoproto.moretags) = "yaml:\"owner\"" - ]; - uint64 lock_id = 2 [ - (gogoproto.moretags) = "yaml:\"lock_id\"" - ]; - cosmos.base.v1beta1.Coin coin = 3 [ - (gogoproto.nullable) = false, - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.Coin" - ]; -} - -message MsgBeginUnlockingTokensResponse {} - -service Msg { - rpc LockTokens(MsgLockTokens) returns (MsgLockTokensResponse); - rpc BeginUnlockTokens(MsgBeginUnlockingTokens) returns (MsgBeginUnlockingTokensResponse); -} \ No newline at end of file diff --git a/x/locking/abci.go b/x/locking/abci.go deleted file mode 100644 index 6db4d90e0..000000000 --- a/x/locking/abci.go +++ /dev/null @@ -1,13 +0,0 @@ -package locking - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/comdex-official/comdex/x/locking/keeper" -) - -func BeginBlocker(ctx sdk.Context, k keeper.Keeper) {} - -func EndBlocker(ctx sdk.Context, k keeper.Keeper) { - k.DeleteMaturedUnlocks(ctx) -} diff --git a/x/locking/client/cli/flags.go b/x/locking/client/cli/flags.go deleted file mode 100644 index 3e0e76a89..000000000 --- a/x/locking/client/cli/flags.go +++ /dev/null @@ -1,18 +0,0 @@ -package cli - -import ( - flag "github.com/spf13/pflag" -) - -// flags for bonding module tx commands. -const ( - FlagDuration = "duration" -) - -// FlagSetLockTokens returns flags for LockTokens msg builder. -func FlagSetLockTokens() *flag.FlagSet { - fs := flag.NewFlagSet("", flag.ContinueOnError) - - fs.String(FlagDuration, "24h", "The duration token to be locked. e.g. 24h, 168h, 336h") - return fs -} diff --git a/x/locking/client/cli/query.go b/x/locking/client/cli/query.go deleted file mode 100644 index 6a8678ad4..000000000 --- a/x/locking/client/cli/query.go +++ /dev/null @@ -1,317 +0,0 @@ -package cli - -import ( - "context" - "fmt" - "strconv" - "strings" - - // "strings" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/version" - - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/comdex-official/comdex/x/locking/types" -) - -// GetQueryCmd returns the cli query commands for this module. -func GetQueryCmd(queryRoute string) *cobra.Command { - // Group locking queries under a subcommand - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - NewQueryParamsCmd(), - NewQueryLockByIDCmd(), - NewQueryLockByOwnerCmd(), - NewQueryUnlockingByIDCmd(), - NewQueryUnlockingByOwnerCmd(), - NewQueryAllLocksCmd(), - NewQueryAllUnlockingsCmd(), - ) - return cmd -} - -// NewQueryParamsCmd implements the params query command. -func NewQueryParamsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Args: cobra.NoArgs, - Short: "Query the current locking parameters information", - Long: strings.TrimSpace( - fmt.Sprintf(`Query values set as locking parameters. -Example: -$ %s query %s params -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - resp, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(&resp.Params) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - -func NewQueryLockByIDCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "lock-by-id [id]", - Args: cobra.ExactArgs(1), - Short: "Query lock by id", - Long: strings.TrimSpace( - fmt.Sprintf(`Query lock by id. -Example: -$ %s query %s lock-by-id 1 -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - ctx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - queryClient := types.NewQueryClient(ctx) - res, err := queryClient.QueryLockByID( - context.Background(), - &types.QueryLockByIdRequest{ - Id: id, - }, - ) - if err != nil { - return err - } - return ctx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func NewQueryLockByOwnerCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "locks-by-owner [owner]", - Args: cobra.ExactArgs(1), - Short: "Query locks by owner", - Long: strings.TrimSpace( - fmt.Sprintf(`Query locks by owner. -Example: -$ %s query %s locks-by-owner comdex1d0qjudc6wyqv35z3k9n4kyj2mquyc2647gs7nr -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - ctx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - owner, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } - queryClient := types.NewQueryClient(ctx) - res, err := queryClient.QueryLocksByOwner( - context.Background(), - &types.QueryLocksByOwnerRequest{ - Owner: owner.String(), - }, - ) - if err != nil { - return err - } - return ctx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func NewQueryAllLocksCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "locks", - Args: cobra.NoArgs, - Short: "Query locks", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all available locks. -Example: -$ %s query %s locks -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - ctx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - pagination, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - queryClient := types.NewQueryClient(ctx) - res, err := queryClient.QueryAllLocks( - context.Background(), - &types.QueryAllLocksRequest{ - Pagination: pagination, - }, - ) - if err != nil { - return err - } - return ctx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "locks") - return cmd -} - -func NewQueryUnlockingByIDCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "unlocking-by-id [id]", - Args: cobra.ExactArgs(1), - Short: "Query unlocking by id", - Long: strings.TrimSpace( - fmt.Sprintf(`Query unlocking by id. -Example: -$ %s query %s unlocking-by-id 1 -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - ctx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - queryClient := types.NewQueryClient(ctx) - res, err := queryClient.QueryUnlockingByID( - context.Background(), - &types.QueryUnlockingByIdRequest{ - Id: id, - }, - ) - if err != nil { - return err - } - return ctx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func NewQueryUnlockingByOwnerCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "unlockings-by-owner [owner]", - Args: cobra.ExactArgs(1), - Short: "Query unlockings by owner", - Long: strings.TrimSpace( - fmt.Sprintf(`Query unlockings by owner. -Example: -$ %s query %s unlockings-by-owner comdex1d0qjudc6wyqv35z3k9n4kyj2mquyc2647gs7nr -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - ctx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - owner, err := sdk.AccAddressFromBech32(args[0]) - if err != nil { - return err - } - queryClient := types.NewQueryClient(ctx) - res, err := queryClient.QueryUnlockingsByOwner( - context.Background(), - &types.QueryUnlockingsByOwnerRequest{ - Owner: owner.String(), - }, - ) - if err != nil { - return err - } - return ctx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - return cmd -} - -func NewQueryAllUnlockingsCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "unlockings", - Args: cobra.NoArgs, - Short: "Query unlockings", - Long: strings.TrimSpace( - fmt.Sprintf(`Query all available unlockings. -Example: -$ %s query %s unlockings -`, - version.AppName, types.ModuleName, - ), - ), - RunE: func(cmd *cobra.Command, args []string) error { - ctx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - pagination, err := client.ReadPageRequest(cmd.Flags()) - if err != nil { - return err - } - queryClient := types.NewQueryClient(ctx) - res, err := queryClient.QueryAllUnlockings( - context.Background(), - &types.QueryAllUnlockingsRequest{ - Pagination: pagination, - }, - ) - if err != nil { - return err - } - return ctx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "unlockings") - return cmd -} diff --git a/x/locking/client/cli/tx.go b/x/locking/client/cli/tx.go deleted file mode 100644 index 63f271116..000000000 --- a/x/locking/client/cli/tx.go +++ /dev/null @@ -1,122 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - "time" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - - // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/comdex-official/comdex/x/locking/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) - -// GetTxCmd returns the transaction commands for this module. -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - NewLockTokensCmd(), - NewBeginUnlockByIDCmd(), - ) - return cmd -} - -// NewLockTokensCmd lock tokens into bonding pool from user's account. -func NewLockTokensCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "lock-tokens [tokens]", - Short: "lock tokens into bonding pool from user account", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) - coin, err := sdk.ParseCoinNormalized(args[0]) - if err != nil { - return err - } - - durationStr, err := cmd.Flags().GetString(FlagDuration) - if err != nil { - return err - } - - duration, err := time.ParseDuration(durationStr) - if err != nil { - return err - } - - msg := types.NewMsgLockTokens( - clientCtx.GetFromAddress(), - duration, - coin, - ) - - return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) - }, - } - - cmd.Flags().AddFlagSet(FlagSetLockTokens()) - flags.AddTxFlagsToCmd(cmd) - err := cmd.MarkFlagRequired(FlagDuration) - if err != nil { - panic(err) - } - return cmd -} - -// NewBeginUnlockByIDCmd unlock individual period lock by ID. -func NewBeginUnlockByIDCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "begin-unlock [lock-id] [tokens]", - Short: "begin unlock individual period lock by ID", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever) - - id, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return fmt.Errorf("parse lock-id id: %w", err) - } - - unlockingCoin, err := sdk.ParseCoinNormalized(args[1]) - if err != nil { - return err - } - - msg := types.NewMsgBeginUnlockingTokens( - clientCtx.GetFromAddress(), - id, - unlockingCoin, - ) - - return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg) - }, - } - flags.AddTxFlagsToCmd(cmd) - return cmd -} diff --git a/x/locking/expected/keeper.go b/x/locking/expected/keeper.go deleted file mode 100644 index 87b8d2b86..000000000 --- a/x/locking/expected/keeper.go +++ /dev/null @@ -1,19 +0,0 @@ -package expected - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -// AccountKeeper defines the expected account keeper used for simulations (noalias). -type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - // Methods imported from account should be defined here -} - -// BankKeeper defines the expected interface needed to retrieve account balances. -type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error - SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error -} diff --git a/x/locking/genesis.go b/x/locking/genesis.go deleted file mode 100644 index a269fbf8c..000000000 --- a/x/locking/genesis.go +++ /dev/null @@ -1,21 +0,0 @@ -package locking - -import ( - "github.com/comdex-official/comdex/x/locking/keeper" - "github.com/comdex-official/comdex/x/locking/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// InitGenesis initializes the capability module's state from a provided genesis -// state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - k.SetParams(ctx, genState.Params) -} - -// ExportGenesis returns the capability module's exported genesis. -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - return genesis -} diff --git a/x/locking/handler.go b/x/locking/handler.go deleted file mode 100644 index 355fb1bc4..000000000 --- a/x/locking/handler.go +++ /dev/null @@ -1,29 +0,0 @@ -package locking - -import ( - "fmt" - - "github.com/comdex-official/comdex/x/locking/keeper" - "github.com/comdex-official/comdex/x/locking/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -func NewHandler(k keeper.Keeper) sdk.Handler { - return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { - ctx = ctx.WithEventManager(sdk.NewEventManager()) - msgServer := keeper.NewMsgServerImpl(k) - - switch msg := msg.(type) { - case *types.MsgLockTokens: - res, err := msgServer.LockTokens(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - case *types.MsgBeginUnlockingTokens: - res, err := msgServer.BeginUnlockTokens(sdk.WrapSDKContext(ctx), msg) - return sdk.WrapServiceResult(ctx, res, err) - default: - errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) - } - } -} diff --git a/x/locking/keeper/grpc_query.go b/x/locking/keeper/grpc_query.go deleted file mode 100644 index 8c9e859f2..000000000 --- a/x/locking/keeper/grpc_query.go +++ /dev/null @@ -1,190 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/cosmos/cosmos-sdk/store/prefix" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "github.com/comdex-official/comdex/x/locking/types" -) - -// Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper. -type Querier struct { - Keeper -} - -var _ types.QueryServer = Querier{} - -// Params queries the parameters of the liquidity module. -func (k Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - var params types.Params - k.Keeper.paramSpace.GetParamSet(ctx, ¶ms) - return &types.QueryParamsResponse{Params: params}, nil -} - -func (k Querier) QueryLockByID(c context.Context, req *types.QueryLockByIdRequest) (*types.QueryLockByIdResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "request cannot be empty") - } - - var ( - ctx = sdk.UnwrapSDKContext(c) - ) - - item, found := k.GetLockByID(ctx, req.Id) - if !found { - return nil, status.Errorf(codes.NotFound, "lock does not exist for id %d", req.Id) - } - - return &types.QueryLockByIdResponse{ - Lock: item, - }, nil -} - -func (k Querier) QueryLocksByOwner(c context.Context, req *types.QueryLocksByOwnerRequest) (*types.QueryLocksByOwnerResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "request cannot be empty") - } - - var ( - ctx = sdk.UnwrapSDKContext(c) - ) - - lockIdsByOwner, found := k.GetLockByOwner(ctx, req.Owner) - if !found { - return nil, status.Errorf(codes.NotFound, "lock does not exist for address %s", req.Owner) - } - - locksByOwner := []types.Lock{} - for _, lockID := range lockIdsByOwner.LockIds { - lock, _ := k.GetLockByID(ctx, lockID) - locksByOwner = append(locksByOwner, lock) - } - - return &types.QueryLocksByOwnerResponse{ - Locks: locksByOwner, - }, nil -} - -func (k Querier) QueryAllLocks(c context.Context, req *types.QueryAllLocksRequest) (*types.QueryAllLocksResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "request cannot be empty") - } - - var ( - items []types.Lock - ctx = sdk.UnwrapSDKContext(c) - ) - - pagination, err := query.FilteredPaginate( - prefix.NewStore(k.Store(ctx), types.LockKeyPrefix), - req.Pagination, - func(_, value []byte, accumulate bool) (bool, error) { - var item types.Lock - if err := k.cdc.Unmarshal(value, &item); err != nil { - return false, err - } - - if accumulate { - items = append(items, item) - } - - return true, nil - }, - ) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllLocksResponse{ - Locks: items, - Pagination: pagination, - }, nil -} - -func (k Querier) QueryUnlockingByID(c context.Context, req *types.QueryUnlockingByIdRequest) (*types.QueryUnlockingByIdResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "request cannot be empty") - } - - var ( - ctx = sdk.UnwrapSDKContext(c) - ) - - item, found := k.GetUnlockingByID(ctx, req.Id) - if !found { - return nil, status.Errorf(codes.NotFound, "unlocking does not exist for id %d", req.Id) - } - - return &types.QueryUnlockingByIdResponse{ - Unlocking: item, - }, nil -} - -func (k Querier) QueryUnlockingsByOwner(c context.Context, req *types.QueryUnlockingsByOwnerRequest) (*types.QueryUnlockingsByOwnerResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "request cannot be empty") - } - - var ( - ctx = sdk.UnwrapSDKContext(c) - ) - - unlockIdsByOwner, found := k.GetUnlockByOwner(ctx, req.Owner) - if !found { - return nil, status.Errorf(codes.NotFound, "unlocking does not exist for address %s", req.Owner) - } - - unlockingsByOwner := []types.Unlocking{} - for _, lockID := range unlockIdsByOwner.UnlockingIds { - lock, _ := k.GetUnlockingByID(ctx, lockID) - unlockingsByOwner = append(unlockingsByOwner, lock) - } - - return &types.QueryUnlockingsByOwnerResponse{ - Unlockings: unlockingsByOwner, - }, nil -} - -func (k Querier) QueryAllUnlockings(c context.Context, req *types.QueryAllUnlockingsRequest) (*types.QueryAllUnlockingsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "request cannot be empty") - } - - var ( - items []types.Unlocking - ctx = sdk.UnwrapSDKContext(c) - ) - - pagination, err := query.FilteredPaginate( - prefix.NewStore(k.Store(ctx), types.UnlockKeyPrefix), - req.Pagination, - func(_, value []byte, accumulate bool) (bool, error) { - var item types.Unlocking - if err := k.cdc.Unmarshal(value, &item); err != nil { - return false, err - } - - if accumulate { - items = append(items, item) - } - - return true, nil - }, - ) - - if err != nil { - return nil, status.Error(codes.Internal, err.Error()) - } - - return &types.QueryAllUnlockingsResponse{ - Unlockings: items, - Pagination: pagination, - }, nil -} diff --git a/x/locking/keeper/keeper.go b/x/locking/keeper/keeper.go deleted file mode 100644 index a3c8aaecc..000000000 --- a/x/locking/keeper/keeper.go +++ /dev/null @@ -1,53 +0,0 @@ -package keeper - -import ( - "fmt" - - "github.com/tendermint/tendermint/libs/log" - - "github.com/comdex-official/comdex/x/locking/expected" - "github.com/comdex-official/comdex/x/locking/types" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" -) - -// Keeper of the liquidity store. -type Keeper struct { - cdc codec.BinaryCodec - storeKey sdk.StoreKey - paramSpace paramtypes.Subspace - - accountKeeper expected.AccountKeeper - bankKeeper expected.BankKeeper -} - -// NewKeeper creates a new liquidity Keeper instance. -func NewKeeper( - cdc codec.BinaryCodec, - storeKey sdk.StoreKey, - paramSpace paramtypes.Subspace, - accountKeeper expected.AccountKeeper, - bankKeeper expected.BankKeeper, -) Keeper { - if !paramSpace.HasKeyTable() { - paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable()) - } - - return Keeper{ - cdc: cdc, - storeKey: storeKey, - paramSpace: paramSpace, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - } -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} - -func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore { - return ctx.KVStore(k.storeKey) -} diff --git a/x/locking/keeper/lock.go b/x/locking/keeper/lock.go deleted file mode 100644 index cf2b4921a..000000000 --- a/x/locking/keeper/lock.go +++ /dev/null @@ -1,174 +0,0 @@ -package keeper - -import ( - "time" - - "github.com/comdex-official/comdex/x/locking/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -func (k Keeper) GetAccountWithSameLockDurationAndDenom( - ctx sdk.Context, - //nolint - owner sdk.AccAddress, - denom string, - duration time.Duration, -) []types.Lock { - locks := []types.Lock{} - - locksByOwner, found := k.GetLockByOwner(ctx, owner.String()) - if !found { - return locks - } - - for _, lockID := range locksByOwner.LockIds { - lock, found := k.GetLockByID(ctx, lockID) - if !found { - continue - } - if lock.Coin.Denom == denom && lock.Duration == duration { - locks = append(locks, lock) - } - } - - return locks -} - -// AddTokensToLock locks more tokens into a bonding -// This also saves the lock to the store. -func (k Keeper) AddTokensToLockByID(ctx sdk.Context, lockID uint64, coin sdk.Coin) (*types.Lock, error) { - lock, found := k.GetLockByID(ctx, lockID) - if !found { - return nil, types.ErrInvalidLockID - } - owner, _ := sdk.AccAddressFromBech32(lock.Owner) - if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, owner, types.ModuleName, sdk.NewCoins(coin)); err != nil { - return nil, err - } - lock.Coin.Amount = lock.Coin.Amount.Add(coin.Amount) - k.SetLock(ctx, lock) - return &lock, nil -} - -// Create New Lock. -func (k Keeper) NewLockTokens( - ctx sdk.Context, - //nolint - owner sdk.AccAddress, - duration time.Duration, - coin sdk.Coin, -) (*types.Lock, error) { - if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, owner, types.ModuleName, sdk.NewCoins(coin)); err != nil { - return nil, err - } - lastLockID := k.GetLockID(ctx) - - lockID := lastLockID + 1 - lock := types.NewLock(ctx, lockID, owner, duration, coin) - - k.SetLockID(ctx, lockID) - k.SetLock(ctx, lock) - - locksByOwner, found := k.GetLockByOwner(ctx, owner.String()) - if !found { - locksByOwner = types.LockByOwner{ - Owner: owner.String(), - LockIds: []uint64{}, - } - } - locksByOwner.LockIds = append(locksByOwner.LockIds, lock.Id) - k.SetLockByOwner(ctx, locksByOwner) - return &lock, nil -} - -func (k Keeper) UpdateOrDeleteLock(ctx sdk.Context, isUpdate bool, lockID uint64, unlockCoin sdk.Coin) error { - lock, found := k.GetLockByID(ctx, lockID) - if !found { - return types.ErrInvalidLockID - } - - // Update lock if tokens are being unlocked partially - if isUpdate { - if unlockCoin.Amount.GTE(lock.Coin.Amount) { - return types.ErrInvalidUnlockingAmount - } - lock.Coin.Amount = lock.Coin.Amount.Sub(unlockCoin.Amount) - k.SetLock(ctx, lock) - return nil - } - - // Delete lock if 100% tokens are being unlocked - k.DeleteLock(ctx, lock.Id) - lockByOwner, _ := k.GetLockByOwner(ctx, lock.Owner) - updatedLockIds := []uint64{} - for _, lID := range lockByOwner.LockIds { - if lID != lock.Id { - updatedLockIds = append(updatedLockIds, lID) - } - } - lockByOwner.LockIds = updatedLockIds - k.SetLockByOwner(ctx, lockByOwner) - return nil -} - -func (k Keeper) NewBeginUnlockTokens( - ctx sdk.Context, - //nolint - owner sdk.AccAddress, - lock types.Lock, - unlockCoin sdk.Coin, -) (uint64, error) { - lastUnlockID := k.GetUnlockingID(ctx) - unlockID := lastUnlockID + 1 - - newUnlockingTokens := types.NewUnlock( - unlockID, - owner, - lock.Duration, - ctx.BlockTime().Add(lock.Duration), - unlockCoin, - ) - - unlockingByOwner, found := k.GetUnlockByOwner(ctx, owner.String()) - if !found { - unlockingByOwner = types.UnlockingByOwner{ - Owner: owner.String(), - UnlockingIds: []uint64{}, - } - } - unlockingByOwner.UnlockingIds = append(unlockingByOwner.UnlockingIds, unlockID) - - k.SetUnlockingID(ctx, unlockID) - k.SetUnlocking(ctx, newUnlockingTokens) - k.SetUnlockByOwner(ctx, unlockingByOwner) - return unlockID, nil -} - -func (k Keeper) UpdateUnlockingByOwner(ctx sdk.Context, owner string, maturedUnlockID uint64) { - unlocksByOwner, found := k.GetUnlockByOwner(ctx, owner) - if found { - updatedUnlockingIds := []uint64{} - for _, unlockID := range unlocksByOwner.UnlockingIds { - if unlockID != maturedUnlockID { - updatedUnlockingIds = append(updatedUnlockingIds, unlockID) - } - } - unlocksByOwner.UnlockingIds = updatedUnlockingIds - k.SetUnlockByOwner(ctx, unlocksByOwner) - } -} - -func (k Keeper) DeleteMaturedUnlocks(ctx sdk.Context) { - allUnlockingPositions := k.GetAllUnlockingPositions(ctx) - - for _, unlocking := range allUnlockingPositions { - if ctx.BlockTime().After(unlocking.EndTime) { - owner, _ := sdk.AccAddressFromBech32(unlocking.Owner) - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, owner, sdk.NewCoins(unlocking.Coin)) - if err == nil { - k.DeleteUnlocking(ctx, unlocking.Id) - k.UpdateUnlockingByOwner(ctx, unlocking.Owner, unlocking.Id) - } - } - } -} diff --git a/x/locking/keeper/msg_server.go b/x/locking/keeper/msg_server.go deleted file mode 100644 index 9577d3f94..000000000 --- a/x/locking/keeper/msg_server.go +++ /dev/null @@ -1,118 +0,0 @@ -package keeper - -import ( - "context" - "strconv" - - "github.com/comdex-official/comdex/x/locking/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -type msgServer struct { - Keeper -} - -// NewMsgServerImpl returns an implementation of the MsgServer interface -// for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} -} - -var _ types.MsgServer = msgServer{} - -func (m msgServer) LockTokens(goCtx context.Context, msg *types.MsgLockTokens) (*types.MsgLockTokensResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - owner, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - return nil, err - } - - locks := m.Keeper.GetAccountWithSameLockDurationAndDenom(ctx, owner, msg.Coin.Denom, msg.Duration) - - // if existing lock with same duration and denom exists, just add there - if len(locks) == 1 { - lock := locks[0] - - _, err = m.Keeper.AddTokensToLockByID(ctx, lock.Id, msg.Coin) - if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) - } - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.TypeEvtAddTokensToLock, - sdk.NewAttribute(types.AttributeLockID, strconv.Itoa(int(lock.Id))), - sdk.NewAttribute(types.AttributeLockOwner, msg.Owner), - sdk.NewAttribute(types.AttributeLockAmount, msg.Coin.String()), - ), - }) - return &types.MsgLockTokensResponse{}, nil - } else if len(locks) > 1 { - return &types.MsgLockTokensResponse{}, types.ErrorDuplicateLockExists - } - - lock, err := m.Keeper.NewLockTokens(ctx, owner, msg.Duration, msg.Coin) - if err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, err.Error()) - } - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.TypeEvtLockTokens, - sdk.NewAttribute(types.AttributeLockID, strconv.Itoa(int(lock.Id))), - sdk.NewAttribute(types.AttributeLockOwner, lock.Owner), - sdk.NewAttribute(types.AttributeLockAmount, lock.Coin.String()), - sdk.NewAttribute(types.AttributeLockDuration, lock.Duration.String()), - ), - }) - - return &types.MsgLockTokensResponse{}, nil -} - -func (m msgServer) BeginUnlockTokens(goCtx context.Context, msg *types.MsgBeginUnlockingTokens) (*types.MsgBeginUnlockingTokensResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - owner, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - return nil, err - } - - lock, found := m.Keeper.GetLockByID(ctx, msg.LockId) - if !found { - return nil, types.ErrInvalidLockID - } - - if lock.Owner != owner.String() { - return nil, types.ErrInvalidLockOwner - } - - if lock.Coin.Denom != msg.Coin.Denom { - return nil, types.ErrInvalidUnlockingCoinDenom - } - - if msg.Coin.Amount.GT(lock.Coin.Amount) { - return nil, types.ErrInvalidUnlockingAmount - } - - // update lock on partial unlock else delete it - isLockUpdate := false - if msg.Coin.Amount.LT(lock.Coin.Amount) { - isLockUpdate = true - } - //nolint - m.Keeper.UpdateOrDeleteLock(ctx, isLockUpdate, lock.Id, msg.Coin) - unlockID, _ := m.Keeper.NewBeginUnlockTokens(ctx, owner, lock, msg.Coin) - - ctx.EventManager().EmitEvents(sdk.Events{ - sdk.NewEvent( - types.TypeEvtBeginUnlock, - sdk.NewAttribute(types.AttributeUnlockID, strconv.Itoa(int(unlockID))), - sdk.NewAttribute(types.AttributeLockOwner, lock.Owner), - sdk.NewAttribute(types.AttributeUnLockAmount, msg.Coin.String()), - sdk.NewAttribute(types.AttributeLockDuration, lock.Duration.String()), - ), - }) - - return &types.MsgBeginUnlockingTokensResponse{}, nil -} diff --git a/x/locking/keeper/params.go b/x/locking/keeper/params.go deleted file mode 100644 index 1bb053a52..000000000 --- a/x/locking/keeper/params.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - "github.com/comdex-official/comdex/x/locking/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// GetParams returns the parameters for the liquidity module. -func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { - k.paramSpace.GetParamSet(ctx, ¶ms) - return -} - -// SetParams set the params. -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramSpace.SetParamSet(ctx, ¶ms) -} diff --git a/x/locking/keeper/store.go b/x/locking/keeper/store.go deleted file mode 100644 index ad406c07c..000000000 --- a/x/locking/keeper/store.go +++ /dev/null @@ -1,183 +0,0 @@ -package keeper - -import ( - "github.com/comdex-official/comdex/x/locking/types" - sdk "github.com/cosmos/cosmos-sdk/types" - protobuftypes "github.com/gogo/protobuf/types" -) - -// LOCKED TOKENS - -func (k *Keeper) GetLockID(ctx sdk.Context) uint64 { - var ( - store = k.Store(ctx) - key = types.LockIDKey - value = store.Get(key) - ) - if value == nil { - return 0 - } - var id protobuftypes.UInt64Value - k.cdc.MustUnmarshal(value, &id) - return id.GetValue() -} - -func (k *Keeper) SetLockID(ctx sdk.Context, id uint64) { - var ( - store = k.Store(ctx) - key = types.LockIDKey - value = k.cdc.MustMarshal( - &protobuftypes.UInt64Value{ - Value: id, - }, - ) - ) - store.Set(key, value) -} - -func (k *Keeper) SetLock(ctx sdk.Context, lock types.Lock) { - var ( - store = k.Store(ctx) - key = types.GetLockKey(lock.Id) - value = k.cdc.MustMarshal(&lock) - ) - store.Set(key, value) -} - -func (k *Keeper) DeleteLock(ctx sdk.Context, id uint64) { - var ( - store = k.Store(ctx) - key = types.GetLockKey(id) - ) - store.Delete(key) -} - -func (k *Keeper) GetLockByID(ctx sdk.Context, id uint64) (lock types.Lock, found bool) { - var ( - store = k.Store(ctx) - key = types.GetLockKey(id) - value = store.Get(key) - ) - if value == nil { - return lock, false - } - k.cdc.MustUnmarshal(value, &lock) - return lock, true -} - -func (k *Keeper) SetLockByOwner(ctx sdk.Context, lockByOwner types.LockByOwner) { - var ( - store = k.Store(ctx) - key = types.GetLockByOwnerKey(lockByOwner.Owner) - value = k.cdc.MustMarshal(&lockByOwner) - ) - store.Set(key, value) -} - -func (k *Keeper) GetLockByOwner(ctx sdk.Context, owner string) (lockByOwner types.LockByOwner, found bool) { - var ( - store = k.Store(ctx) - key = types.GetLockByOwnerKey(owner) - value = store.Get(key) - ) - if value == nil { - return lockByOwner, false - } - k.cdc.MustUnmarshal(value, &lockByOwner) - return lockByOwner, true -} - -// TOKENS IN UNLOCKING PERIOD - -func (k *Keeper) GetUnlockingID(ctx sdk.Context) uint64 { - var ( - store = k.Store(ctx) - key = types.UnlockingIDKey - value = store.Get(key) - ) - if value == nil { - return 0 - } - var id protobuftypes.UInt64Value - k.cdc.MustUnmarshal(value, &id) - return id.GetValue() -} - -func (k *Keeper) SetUnlockingID(ctx sdk.Context, id uint64) { - var ( - store = k.Store(ctx) - key = types.UnlockingIDKey - value = k.cdc.MustMarshal( - &protobuftypes.UInt64Value{ - Value: id, - }, - ) - ) - store.Set(key, value) -} - -func (k *Keeper) SetUnlocking(ctx sdk.Context, unlock types.Unlocking) { - var ( - store = k.Store(ctx) - key = types.GetUnlockKey(unlock.Id) - value = k.cdc.MustMarshal(&unlock) - ) - store.Set(key, value) -} - -func (k *Keeper) DeleteUnlocking(ctx sdk.Context, id uint64) { - var ( - store = k.Store(ctx) - key = types.GetUnlockKey(id) - ) - store.Delete(key) -} - -func (k *Keeper) GetUnlockingByID(ctx sdk.Context, id uint64) (unlock types.Unlocking, found bool) { - var ( - store = k.Store(ctx) - key = types.GetUnlockKey(id) - value = store.Get(key) - ) - if value == nil { - return unlock, false - } - k.cdc.MustUnmarshal(value, &unlock) - return unlock, true -} - -func (k *Keeper) SetUnlockByOwner(ctx sdk.Context, unlockingByOwner types.UnlockingByOwner) { - var ( - store = k.Store(ctx) - key = types.GetUnlockByOwnerKey(unlockingByOwner.Owner) - value = k.cdc.MustMarshal(&unlockingByOwner) - ) - store.Set(key, value) -} - -func (k *Keeper) GetUnlockByOwner(ctx sdk.Context, owner string) (unlockingByOwner types.UnlockingByOwner, found bool) { - var ( - store = k.Store(ctx) - key = types.GetUnlockByOwnerKey(owner) - value = store.Get(key) - ) - if value == nil { - return unlockingByOwner, false - } - k.cdc.MustUnmarshal(value, &unlockingByOwner) - return unlockingByOwner, true -} - -func (k *Keeper) GetAllUnlockingPositions(ctx sdk.Context) (unlockings []types.Unlocking) { - var ( - store = k.Store(ctx) - iter = sdk.KVStorePrefixIterator(store, types.UnlockKeyPrefix) - ) - defer iter.Close() - for ; iter.Valid(); iter.Next() { - var unlocking types.Unlocking - k.cdc.MustUnmarshal(iter.Value(), &unlocking) - unlockings = append(unlockings, unlocking) - } - return unlockings -} diff --git a/x/locking/module.go b/x/locking/module.go deleted file mode 100644 index 93da5b3cf..000000000 --- a/x/locking/module.go +++ /dev/null @@ -1,178 +0,0 @@ -package locking - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/comdex-official/comdex/x/locking/client/cli" - "github.com/comdex-official/comdex/x/locking/expected" - "github.com/comdex-official/comdex/x/locking/keeper" - "github.com/comdex-official/comdex/x/locking/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface for the capability module. -type AppModuleBasic struct { - cdc codec.Codec -} - -func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the capability module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterLegacyAminoCodec(cdc) -} - -// RegisterInterfaces registers the module's interface types. -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns the capability module's default genesis state. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis performs genesis state validation for the capability module. -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var genState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - return genState.Validate() -} - -// RegisterRESTRoutes registers the capability module's REST service handlers. -func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { - panic(err) - } -} - -// GetTxCmd returns the capability module's root tx command. -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the capability module's root query command. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface for the capability module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - accountKeeper expected.AccountKeeper - bankKeeper expected.BankKeeper -} - -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - accountKeeper expected.AccountKeeper, - bankKeeper expected.BankKeeper, -) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - } -} - -// Name returns the capability module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -// Route returns the capability module's message routing key. -func (am AppModule) Route() sdk.Route { - return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) -} - -// QuerierRoute returns the capability module's query routing key. -func (AppModule) QuerierRoute() string { return types.QuerierRoute } - -// LegacyQuerierHandler returns the capability module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} - -// RegisterServices registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier{Keeper: am.keeper}) -} - -// RegisterInvariants registers the capability module's invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// InitGenesis performs the capability module's genesis initialization It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState - // Initialize global index to index in genesis state - cdc.MustUnmarshalJSON(gs, &genState) - - InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(genState) -} - -// ConsensusVersion implements ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } - -// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - BeginBlocker(ctx, am.keeper) -} - -// EndBlock executes all ABCI EndBlock logic respective to the capability module. It -// returns no validator updates. -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { - EndBlocker(ctx, am.keeper) - return []abci.ValidatorUpdate{} -} diff --git a/x/locking/simulation/simap.go b/x/locking/simulation/simap.go deleted file mode 100644 index b222cc5f7..000000000 --- a/x/locking/simulation/simap.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list. -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/locking/types/codec.go b/x/locking/types/codec.go deleted file mode 100644 index 10d403fbf..000000000 --- a/x/locking/types/codec.go +++ /dev/null @@ -1,40 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -// RegisterLegacyAminoCodec registers the necessary x/liquidity interfaces and concrete types -// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgLockTokens{}, "comdex/locking/MsgLockTokens", nil) - cdc.RegisterConcrete(&MsgBeginUnlockingTokens{}, "comdex/locking/MsgBeginUnlockingTokens", nil) -} - -// RegisterInterfaces registers the x/liquidity interfaces types with the -// interface registry. -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgLockTokens{}, - &MsgBeginUnlockingTokens{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -var ( - amino = codec.NewLegacyAmino() - - ModuleCdc = codec.NewAminoCodec(amino) -) - -func init() { - RegisterLegacyAminoCodec(amino) - cryptocodec.RegisterCrypto(amino) - amino.Seal() -} diff --git a/x/locking/types/errors.go b/x/locking/types/errors.go deleted file mode 100644 index 34000c961..000000000 --- a/x/locking/types/errors.go +++ /dev/null @@ -1,16 +0,0 @@ -package types - -// DONTCOVER - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// x/locking module sentinel errors. -var ( - ErrInvalidLockID = sdkerrors.Register(ModuleName, 2, "lock id invalid") - ErrInvalidLockOwner = sdkerrors.Register(ModuleName, 3, "msg sender is not the owner of specified lock") - ErrInvalidUnlockingCoinDenom = sdkerrors.Register(ModuleName, 4, "provided coin denom does not match with locked coin denom") - ErrInvalidUnlockingAmount = sdkerrors.Register(ModuleName, 5, "locked coin amount is smaller than provided coin amount") - ErrorDuplicateLockExists = sdkerrors.Register(ModuleName, 6, "multiple Lock Exists for same Owner,Denom and Duration") -) diff --git a/x/locking/types/events.go b/x/locking/types/events.go deleted file mode 100644 index 1615553ac..000000000 --- a/x/locking/types/events.go +++ /dev/null @@ -1,16 +0,0 @@ -package types - -// event types. -const ( - TypeEvtLockTokens = "lock_tokens" - //nolint - TypeEvtAddTokensToLock = "add_tokens_to_lock" - TypeEvtBeginUnlock = "begin_unlock" - - AttributeLockID = "lock_id" - AttributeUnlockID = "unlock_id" - AttributeLockOwner = "owner" - AttributeLockAmount = "amount" - AttributeUnLockAmount = "unlock_amount" - AttributeLockDuration = "duration" -) diff --git a/x/locking/types/genesis.go b/x/locking/types/genesis.go deleted file mode 100644 index 9019cc0f1..000000000 --- a/x/locking/types/genesis.go +++ /dev/null @@ -1,17 +0,0 @@ -package types - -// DefaultIndex is the default capability global index. -const DefaultIndex uint64 = 1 - -// DefaultGenesis returns the default Capability genesis state. -func DefaultGenesis() *GenesisState { - return &GenesisState{ - Params: DefaultParams(), - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - return gs.Params.Validate() -} diff --git a/x/locking/types/genesis.pb.go b/x/locking/types/genesis.pb.go deleted file mode 100644 index 80512f5ca..000000000 --- a/x/locking/types/genesis.pb.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/locking/v1beta1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/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 - -// GenesisState defines the locking module's genesis state. -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_0e685bd7b076679e, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "comdex.locking.v1beta1.GenesisState") -} - -func init() { - proto.RegisterFile("comdex/locking/v1beta1/genesis.proto", fileDescriptor_0e685bd7b076679e) -} - -var fileDescriptor_0e685bd7b076679e = []byte{ - // 204 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x4f, 0xce, 0xce, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, - 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0x12, 0x83, 0xa8, 0xd2, 0x83, 0xaa, 0xd2, 0x83, 0xaa, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, - 0x07, 0x2b, 0xd1, 0x07, 0xb1, 0x20, 0xaa, 0xa5, 0x94, 0x71, 0x98, 0x59, 0x90, 0x58, 0x94, 0x98, - 0x0b, 0x35, 0x52, 0xc9, 0x87, 0x8b, 0xc7, 0x1d, 0x62, 0x47, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, - 0x0d, 0x17, 0x1b, 0x44, 0x5e, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4e, 0x0f, 0xbb, 0x9d, - 0x7a, 0x01, 0x60, 0x55, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xf5, 0x38, 0x79, 0x9f, - 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, 0xcb, 0x31, - 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x61, 0x7a, 0x66, 0x49, 0x46, 0x69, - 0x12, 0xc8, 0x34, 0x7d, 0x88, 0x89, 0xba, 0xf9, 0x69, 0x69, 0x99, 0xc9, 0x99, 0x89, 0x39, 0x50, - 0xbe, 0x3e, 0xc2, 0xa5, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0x17, 0x1a, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x76, 0xe4, 0x02, 0x56, 0x1c, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) 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 = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) 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 ErrIntOverflowGenesis - } - 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: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: 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 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 - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrIntOverflowGenesis - } - 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, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/locking/types/keys.go b/x/locking/types/keys.go deleted file mode 100644 index 054dae99d..000000000 --- a/x/locking/types/keys.go +++ /dev/null @@ -1,48 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - // ModuleName defines the module name - ModuleName = "locking" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey is the message route for slashing - RouterKey = ModuleName - - // QuerierRoute defines the module's query routing key - QuerierRoute = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_locking" -) - -var ( - LockIDKey = []byte{0x01} - UnlockingIDKey = []byte{0x02} - LockKeyPrefix = []byte{0x03} - UnlockKeyPrefix = []byte{0x04} - - LockByOwnerKeyPrefix = []byte{0x05} - UnlockByOwnerKeyPrefix = []byte{0x06} -) - -func GetLockKey(id uint64) []byte { - return append(LockKeyPrefix, sdk.Uint64ToBigEndian(id)...) -} - -func GetLockByOwnerKey(owner string) []byte { - return append(LockByOwnerKeyPrefix, []byte(owner)...) -} - -func GetUnlockKey(id uint64) []byte { - return append(UnlockKeyPrefix, sdk.Uint64ToBigEndian(id)...) -} - -func GetUnlockByOwnerKey(owner string) []byte { - return append(UnlockByOwnerKeyPrefix, []byte(owner)...) -} diff --git a/x/locking/types/lock.go b/x/locking/types/lock.go deleted file mode 100644 index 39a611dcf..000000000 --- a/x/locking/types/lock.go +++ /dev/null @@ -1,42 +0,0 @@ -package types - -import ( - time "time" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// NewLock returns a new instance of lock. -func NewLock( - ctx sdk.Context, - id uint64, - //nolint - owner sdk.AccAddress, - duration time.Duration, - coin sdk.Coin, -) Lock { - return Lock{ - Id: id, - Owner: owner.String(), - CreatedAt: ctx.BlockTime(), - Duration: duration, - Coin: coin, - } -} - -// NewUnLock returns a new instance of unlock. -func NewUnlock( - id uint64, - //nolint - owner sdk.AccAddress, - duration time.Duration, - endTime time.Time, - coin sdk.Coin) Unlocking { - return Unlocking{ - Id: id, - Owner: owner.String(), - Duration: duration, - EndTime: endTime, - Coin: coin, - } -} diff --git a/x/locking/types/lock.pb.go b/x/locking/types/lock.pb.go deleted file mode 100644 index ec66cd1b1..000000000 --- a/x/locking/types/lock.pb.go +++ /dev/null @@ -1,1459 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/locking/v1beta1/lock.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - _ "github.com/golang/protobuf/ptypes/timestamp" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -// Locked is a single unit of lock by period. It's a record of locked coin -// at a specific time. It stores owner, duration, and the amount of -// coin locked. -type Lock struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - CreatedAt time.Time `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3,stdtime" json:"created_at" yaml:"created_at"` - Duration time.Duration `protobuf:"bytes,4,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - Coin github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=coin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` -} - -func (m *Lock) Reset() { *m = Lock{} } -func (m *Lock) String() string { return proto.CompactTextString(m) } -func (*Lock) ProtoMessage() {} -func (*Lock) Descriptor() ([]byte, []int) { - return fileDescriptor_538a493a7ad160f6, []int{0} -} -func (m *Lock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Lock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Lock.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 *Lock) XXX_Merge(src proto.Message) { - xxx_messageInfo_Lock.Merge(m, src) -} -func (m *Lock) XXX_Size() int { - return m.Size() -} -func (m *Lock) XXX_DiscardUnknown() { - xxx_messageInfo_Lock.DiscardUnknown(m) -} - -var xxx_messageInfo_Lock proto.InternalMessageInfo - -func (m *Lock) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Lock) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *Lock) GetCreatedAt() time.Time { - if m != nil { - return m.CreatedAt - } - return time.Time{} -} - -func (m *Lock) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *Lock) GetCoin() github_com_cosmos_cosmos_sdk_types.Coin { - if m != nil { - return m.Coin - } - return github_com_cosmos_cosmos_sdk_types.Coin{} -} - -// Once unlocking is triggered the lock gets deleted and its being -// added to the Unlocking and it will stay untill the duration of end time.enum -// Once entime is reached lock is being deleted from unlocking. -type Unlocking struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - EndTime time.Time `protobuf:"bytes,4,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time" yaml:"end_time"` - Coin github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,5,opt,name=coin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` -} - -func (m *Unlocking) Reset() { *m = Unlocking{} } -func (m *Unlocking) String() string { return proto.CompactTextString(m) } -func (*Unlocking) ProtoMessage() {} -func (*Unlocking) Descriptor() ([]byte, []int) { - return fileDescriptor_538a493a7ad160f6, []int{1} -} -func (m *Unlocking) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Unlocking) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Unlocking.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 *Unlocking) XXX_Merge(src proto.Message) { - xxx_messageInfo_Unlocking.Merge(m, src) -} -func (m *Unlocking) XXX_Size() int { - return m.Size() -} -func (m *Unlocking) XXX_DiscardUnknown() { - xxx_messageInfo_Unlocking.DiscardUnknown(m) -} - -var xxx_messageInfo_Unlocking proto.InternalMessageInfo - -func (m *Unlocking) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *Unlocking) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *Unlocking) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *Unlocking) GetEndTime() time.Time { - if m != nil { - return m.EndTime - } - return time.Time{} -} - -func (m *Unlocking) GetCoin() github_com_cosmos_cosmos_sdk_types.Coin { - if m != nil { - return m.Coin - } - return github_com_cosmos_cosmos_sdk_types.Coin{} -} - -type LockByOwner struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - LockIds []uint64 `protobuf:"varint,2,rep,packed,name=lock_ids,json=lockIds,proto3" json:"lock_ids,omitempty"` -} - -func (m *LockByOwner) Reset() { *m = LockByOwner{} } -func (m *LockByOwner) String() string { return proto.CompactTextString(m) } -func (*LockByOwner) ProtoMessage() {} -func (*LockByOwner) Descriptor() ([]byte, []int) { - return fileDescriptor_538a493a7ad160f6, []int{2} -} -func (m *LockByOwner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *LockByOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LockByOwner.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 *LockByOwner) XXX_Merge(src proto.Message) { - xxx_messageInfo_LockByOwner.Merge(m, src) -} -func (m *LockByOwner) XXX_Size() int { - return m.Size() -} -func (m *LockByOwner) XXX_DiscardUnknown() { - xxx_messageInfo_LockByOwner.DiscardUnknown(m) -} - -var xxx_messageInfo_LockByOwner proto.InternalMessageInfo - -func (m *LockByOwner) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *LockByOwner) GetLockIds() []uint64 { - if m != nil { - return m.LockIds - } - return nil -} - -type UnlockingByOwner struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - UnlockingIds []uint64 `protobuf:"varint,2,rep,packed,name=unlocking_ids,json=unlockingIds,proto3" json:"unlocking_ids,omitempty"` -} - -func (m *UnlockingByOwner) Reset() { *m = UnlockingByOwner{} } -func (m *UnlockingByOwner) String() string { return proto.CompactTextString(m) } -func (*UnlockingByOwner) ProtoMessage() {} -func (*UnlockingByOwner) Descriptor() ([]byte, []int) { - return fileDescriptor_538a493a7ad160f6, []int{3} -} -func (m *UnlockingByOwner) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *UnlockingByOwner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_UnlockingByOwner.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 *UnlockingByOwner) XXX_Merge(src proto.Message) { - xxx_messageInfo_UnlockingByOwner.Merge(m, src) -} -func (m *UnlockingByOwner) XXX_Size() int { - return m.Size() -} -func (m *UnlockingByOwner) XXX_DiscardUnknown() { - xxx_messageInfo_UnlockingByOwner.DiscardUnknown(m) -} - -var xxx_messageInfo_UnlockingByOwner proto.InternalMessageInfo - -func (m *UnlockingByOwner) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *UnlockingByOwner) GetUnlockingIds() []uint64 { - if m != nil { - return m.UnlockingIds - } - return nil -} - -func init() { - proto.RegisterType((*Lock)(nil), "comdex.locking.v1beta1.Lock") - proto.RegisterType((*Unlocking)(nil), "comdex.locking.v1beta1.Unlocking") - proto.RegisterType((*LockByOwner)(nil), "comdex.locking.v1beta1.LockByOwner") - proto.RegisterType((*UnlockingByOwner)(nil), "comdex.locking.v1beta1.UnlockingByOwner") -} - -func init() { proto.RegisterFile("comdex/locking/v1beta1/lock.proto", fileDescriptor_538a493a7ad160f6) } - -var fileDescriptor_538a493a7ad160f6 = []byte{ - // 517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x54, 0x41, 0x6f, 0xd3, 0x4c, - 0x10, 0x8d, 0x1d, 0xf7, 0x6b, 0xb2, 0xed, 0x07, 0xc5, 0x42, 0xc8, 0x0d, 0xc2, 0x0e, 0x46, 0x82, - 0x1c, 0xa8, 0x57, 0x81, 0x1b, 0x37, 0x0c, 0x97, 0x0a, 0x24, 0x90, 0x05, 0x12, 0xe2, 0x40, 0x64, - 0x7b, 0x37, 0xee, 0x2a, 0xb1, 0x27, 0x8a, 0x37, 0x40, 0xfe, 0x45, 0x8f, 0xfc, 0xa4, 0x1e, 0x7b, - 0xe4, 0x64, 0x20, 0xb9, 0x71, 0xcc, 0x91, 0x13, 0xda, 0xf5, 0xae, 0x5b, 0x40, 0xaa, 0x04, 0x52, - 0x4f, 0xf6, 0xcc, 0xbc, 0x79, 0x33, 0xfb, 0xde, 0x6a, 0xd1, 0xed, 0x14, 0x72, 0x42, 0x3f, 0xe2, - 0x29, 0xa4, 0x13, 0x56, 0x64, 0xf8, 0xfd, 0x30, 0xa1, 0x3c, 0x1e, 0xca, 0x38, 0x98, 0xcd, 0x81, - 0x83, 0x7d, 0xa3, 0x86, 0x04, 0x0a, 0x12, 0x28, 0x48, 0xef, 0x7a, 0x06, 0x19, 0x48, 0x08, 0x16, - 0x7f, 0x35, 0xba, 0xe7, 0x66, 0x00, 0xd9, 0x94, 0x62, 0x19, 0x25, 0x8b, 0x31, 0x26, 0x8b, 0x79, - 0xcc, 0x19, 0x14, 0xaa, 0xee, 0xfd, 0x5e, 0xe7, 0x2c, 0xa7, 0x25, 0x8f, 0xf3, 0x99, 0x26, 0x48, - 0xa1, 0xcc, 0xa1, 0xc4, 0x49, 0x5c, 0xd2, 0x66, 0x9d, 0x14, 0x98, 0x22, 0xf0, 0x57, 0x26, 0xb2, - 0x9e, 0x43, 0x3a, 0xb1, 0xaf, 0x20, 0x93, 0x11, 0xc7, 0xe8, 0x1b, 0x03, 0x2b, 0x32, 0x19, 0xb1, - 0xef, 0xa2, 0x2d, 0xf8, 0x50, 0xd0, 0xb9, 0x63, 0xf6, 0x8d, 0x41, 0x37, 0xdc, 0xdb, 0x54, 0xde, - 0xee, 0x32, 0xce, 0xa7, 0x8f, 0x7c, 0x99, 0xf6, 0xa3, 0xba, 0x6c, 0xbf, 0x41, 0x28, 0x9d, 0xd3, - 0x98, 0x53, 0x32, 0x8a, 0xb9, 0xd3, 0xee, 0x1b, 0x83, 0x9d, 0x07, 0xbd, 0xa0, 0x5e, 0x2b, 0xd0, - 0x6b, 0x05, 0xaf, 0xf4, 0x5a, 0xe1, 0xad, 0x93, 0xca, 0x6b, 0x6d, 0x2a, 0xef, 0x5a, 0x4d, 0x76, - 0xd6, 0xeb, 0x1f, 0x7f, 0xf1, 0x8c, 0xa8, 0xab, 0x12, 0x8f, 0xb9, 0x7d, 0x84, 0x3a, 0xfa, 0xb4, - 0x8e, 0x25, 0x79, 0xf7, 0xff, 0xe0, 0x7d, 0xaa, 0x00, 0xe1, 0x50, 0xd0, 0x7e, 0xaf, 0x3c, 0x5b, - 0xb7, 0xdc, 0x87, 0x9c, 0x71, 0x9a, 0xcf, 0xf8, 0x72, 0x53, 0x79, 0x57, 0xeb, 0x61, 0xba, 0xe6, - 0x7f, 0x12, 0xa3, 0x1a, 0x76, 0xfb, 0x1d, 0xb2, 0x84, 0x24, 0xce, 0x96, 0x9a, 0x52, 0x6b, 0x16, - 0x08, 0xcd, 0xb4, 0x3f, 0xc1, 0x13, 0x60, 0x45, 0x88, 0xc5, 0x94, 0x1f, 0x95, 0x77, 0x2f, 0x63, - 0xfc, 0x68, 0x91, 0x04, 0x29, 0xe4, 0x58, 0x09, 0x5c, 0x7f, 0x0e, 0x4a, 0x32, 0xc1, 0x7c, 0x39, - 0xa3, 0xa5, 0x6c, 0x88, 0x24, 0xaf, 0xff, 0xcd, 0x44, 0xdd, 0xd7, 0x85, 0x72, 0xfc, 0x9f, 0x95, - 0x3e, 0xaf, 0x47, 0xfb, 0x52, 0xf5, 0x88, 0x50, 0x87, 0x16, 0x64, 0x24, 0xee, 0x92, 0x52, 0xfe, - 0x22, 0x47, 0x6f, 0x2a, 0x47, 0x15, 0xa9, 0xee, 0xac, 0xfd, 0xdc, 0xa6, 0x05, 0x11, 0xd0, 0x4b, - 0xd7, 0xf8, 0x25, 0xda, 0x11, 0xf7, 0x38, 0x5c, 0xbe, 0x90, 0x62, 0x35, 0xa2, 0x1a, 0x17, 0x8b, - 0xba, 0x8f, 0x3a, 0xc2, 0x97, 0x11, 0x23, 0xa5, 0x63, 0xf6, 0xdb, 0x03, 0x2b, 0xda, 0x16, 0xf1, - 0x21, 0x29, 0xfd, 0x11, 0xda, 0x6b, 0x4c, 0xfb, 0x5b, 0xda, 0x3b, 0xe8, 0xff, 0x85, 0xee, 0x3d, - 0xc7, 0xbd, 0xdb, 0x24, 0x0f, 0x49, 0x19, 0x3e, 0x3b, 0x59, 0xb9, 0xc6, 0xe9, 0xca, 0x35, 0xbe, - 0xae, 0x5c, 0xe3, 0x78, 0xed, 0xb6, 0x4e, 0xd7, 0x6e, 0xeb, 0xf3, 0xda, 0x6d, 0xbd, 0x1d, 0xfe, - 0x72, 0x76, 0xf1, 0x5e, 0x1c, 0xc0, 0x78, 0xcc, 0x52, 0x16, 0x4f, 0x55, 0x8c, 0xcf, 0x1e, 0x19, - 0x29, 0x45, 0xf2, 0x9f, 0x74, 0xe6, 0xe1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0xa1, 0xf3, - 0xb0, 0x83, 0x04, 0x00, 0x00, -} - -func (m *Lock) 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 *Lock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Lock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Coin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLock(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintLock(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x22 - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintLock(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x1a - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintLock(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintLock(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Unlocking) 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 *Unlocking) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Unlocking) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Coin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintLock(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintLock(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x22 - n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintLock(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x1a - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintLock(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0x12 - } - if m.Id != 0 { - i = encodeVarintLock(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *LockByOwner) 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 *LockByOwner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LockByOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.LockIds) > 0 { - dAtA8 := make([]byte, len(m.LockIds)*10) - var j7 int - for _, num := range m.LockIds { - for num >= 1<<7 { - dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j7++ - } - dAtA8[j7] = uint8(num) - j7++ - } - i -= j7 - copy(dAtA[i:], dAtA8[:j7]) - i = encodeVarintLock(dAtA, i, uint64(j7)) - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintLock(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *UnlockingByOwner) 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 *UnlockingByOwner) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *UnlockingByOwner) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.UnlockingIds) > 0 { - dAtA10 := make([]byte, len(m.UnlockingIds)*10) - var j9 int - for _, num := range m.UnlockingIds { - for num >= 1<<7 { - dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j9++ - } - dAtA10[j9] = uint8(num) - j9++ - } - i -= j9 - copy(dAtA[i:], dAtA10[:j9]) - i = encodeVarintLock(dAtA, i, uint64(j9)) - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintLock(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintLock(dAtA []byte, offset int, v uint64) int { - offset -= sovLock(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Lock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovLock(uint64(m.Id)) - } - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovLock(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt) - n += 1 + l + sovLock(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovLock(uint64(l)) - l = m.Coin.Size() - n += 1 + l + sovLock(uint64(l)) - return n -} - -func (m *Unlocking) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovLock(uint64(m.Id)) - } - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovLock(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovLock(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovLock(uint64(l)) - l = m.Coin.Size() - n += 1 + l + sovLock(uint64(l)) - return n -} - -func (m *LockByOwner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovLock(uint64(l)) - } - if len(m.LockIds) > 0 { - l = 0 - for _, e := range m.LockIds { - l += sovLock(uint64(e)) - } - n += 1 + sovLock(uint64(l)) + l - } - return n -} - -func (m *UnlockingByOwner) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovLock(uint64(l)) - } - if len(m.UnlockingIds) > 0 { - l = 0 - for _, e := range m.UnlockingIds { - l += sovLock(uint64(e)) - } - n += 1 + sovLock(uint64(l)) + l - } - return n -} - -func sovLock(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozLock(x uint64) (n int) { - return sovLock(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Lock) 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 ErrIntOverflowLock - } - 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: Lock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Lock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreatedAt, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Unlocking) 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 ErrIntOverflowLock - } - 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: Unlocking: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Unlocking: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipLock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *LockByOwner) 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 ErrIntOverflowLock - } - 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: LockByOwner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LockByOwner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LockIds = append(m.LockIds, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.LockIds) == 0 { - m.LockIds = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LockIds = append(m.LockIds, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field LockIds", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipLock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *UnlockingByOwner) 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 ErrIntOverflowLock - } - 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: UnlockingByOwner: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: UnlockingByOwner: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UnlockingIds = append(m.UnlockingIds, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthLock - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthLock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.UnlockingIds) == 0 { - m.UnlockingIds = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowLock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UnlockingIds = append(m.UnlockingIds, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field UnlockingIds", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipLock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthLock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipLock(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, ErrIntOverflowLock - } - 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, ErrIntOverflowLock - } - 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, ErrIntOverflowLock - } - 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, ErrInvalidLengthLock - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupLock - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthLock - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthLock = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowLock = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupLock = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/locking/types/msgs.go b/x/locking/types/msgs.go deleted file mode 100644 index 0bedfe7b5..000000000 --- a/x/locking/types/msgs.go +++ /dev/null @@ -1,88 +0,0 @@ -package types - -import ( - "fmt" - "time" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// constants. -const ( - TypeMsgLockTokens = "lock_tokens" - TypeMsgBeginUnlock = "begin_unlock" -) - -var _ sdk.Msg = &MsgLockTokens{} - -// NewMsgLockTokens creates a message to lock tokens. -func NewMsgLockTokens( - //nolint - owner sdk.AccAddress, - duration time.Duration, - coin sdk.Coin, -) *MsgLockTokens { - return &MsgLockTokens{ - Owner: owner.String(), - Duration: duration, - Coin: coin, - } -} - -func (m MsgLockTokens) Route() string { return RouterKey } -func (m MsgLockTokens) Type() string { return TypeMsgLockTokens } -func (m MsgLockTokens) ValidateBasic() error { - if m.Duration <= 0 { - return fmt.Errorf("duration should be positive: %d < 0", m.Duration) - } - if m.Coin.Amount.IsNegative() || m.Coin.Amount.IsZero() { - return fmt.Errorf("invalid coin amount: %d < 0", m.Coin.Amount) - } - return nil -} - -func (m MsgLockTokens) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) -} - -func (m MsgLockTokens) GetSigners() []sdk.AccAddress { - owner, _ := sdk.AccAddressFromBech32(m.Owner) - return []sdk.AccAddress{owner} -} - -var _ sdk.Msg = &MsgBeginUnlockingTokens{} - -// NewMsgLockTokens creates a message to lock tokens. -func NewMsgBeginUnlockingTokens( - //nolint - owner sdk.AccAddress, - lockID uint64, - coin sdk.Coin, -) *MsgBeginUnlockingTokens { - return &MsgBeginUnlockingTokens{ - Owner: owner.String(), - LockId: lockID, - Coin: coin, - } -} - -func (m MsgBeginUnlockingTokens) Route() string { return RouterKey } -func (m MsgBeginUnlockingTokens) Type() string { return TypeMsgLockTokens } -func (m MsgBeginUnlockingTokens) ValidateBasic() error { - if m.LockId <= 0 { - return fmt.Errorf("invalid lock_id: %d < 0", m.LockId) - } - if m.Coin.Amount.IsNegative() || m.Coin.Amount.IsZero() { - return fmt.Errorf("invalid coin amount: %d < 0", m.Coin.Amount) - } - return nil -} - -func (m MsgBeginUnlockingTokens) GetSignBytes() []byte { - return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) -} - -func (m MsgBeginUnlockingTokens) GetSigners() []sdk.AccAddress { - owner, _ := sdk.AccAddressFromBech32(m.Owner) - return []sdk.AccAddress{owner} -} diff --git a/x/locking/types/params.go b/x/locking/types/params.go deleted file mode 100644 index 5687875ab..000000000 --- a/x/locking/types/params.go +++ /dev/null @@ -1,77 +0,0 @@ -package types - -import ( - "fmt" - "time" - - paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -// Liquidity params default values. -const ( - DefaultLockingDuration = 24 * time.Hour -) - -// Liquidity params default values - -// Put general constants here. -const () - -var ( - KeyLockingDuration = []byte("LockingDuration") -) - -var _ paramstypes.ParamSet = (*Params)(nil) - -func ParamKeyTable() paramstypes.KeyTable { - return paramstypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// DefaultParams returns a default params for the liquidity module. -func DefaultParams() Params { - return Params{ - LockingDuration: DefaultLockingDuration, - } -} - -// ParamSetPairs implements ParamSet. -func (params *Params) ParamSetPairs() paramstypes.ParamSetPairs { - return paramstypes.ParamSetPairs{ - paramstypes.NewParamSetPair(KeyLockingDuration, ¶ms.LockingDuration, validateLockingDuration), - } -} - -// Validate validates Params. -func (params Params) Validate() error { - for _, field := range []struct { - val interface{} - validateFunc func(i interface{}) error - }{ - {params.LockingDuration, validateLockingDuration}, - } { - if err := field.validateFunc(field.val); err != nil { - return err - } - } - return nil -} - -func validateLockingDuration(i interface{}) error { - v, ok := i.(time.Duration) - if !ok { - return fmt.Errorf("invalid parameter type: %T", i) - } - - if v < 0 { - return fmt.Errorf("locking duration must not be negative: %s", v) - } - - return nil -} - -// String implements the Stringer interface. -func (params Params) String() string { - out, _ := yaml.Marshal(params) - return string(out) -} diff --git a/x/locking/types/params.pb.go b/x/locking/types/params.pb.go deleted file mode 100644 index 6c3c478ff..000000000 --- a/x/locking/types/params.pb.go +++ /dev/null @@ -1,326 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/locking/v1beta1/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 { - LockingDuration time.Duration `protobuf:"bytes,1,opt,name=locking_duration,json=lockingDuration,proto3,stdduration" json:"locking_duration"` -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_7c4a50aa3d7e9257, []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 (m *Params) GetLockingDuration() time.Duration { - if m != nil { - return m.LockingDuration - } - return 0 -} - -func init() { - proto.RegisterType((*Params)(nil), "comdex.locking.v1beta1.Params") -} - -func init() { - proto.RegisterFile("comdex/locking/v1beta1/params.proto", fileDescriptor_7c4a50aa3d7e9257) -} - -var fileDescriptor_7c4a50aa3d7e9257 = []byte{ - // 233 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xce, 0xcf, 0x4d, - 0x49, 0xad, 0xd0, 0xcf, 0xc9, 0x4f, 0xce, 0xce, 0xcc, 0x4b, 0xd7, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, - 0x49, 0x34, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x83, 0x28, 0xd2, 0x83, 0x2a, 0xd2, 0x83, 0x2a, 0x92, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, - 0x2b, 0xd1, 0x07, 0xb1, 0x20, 0xaa, 0xa5, 0xe4, 0xd2, 0xf3, 0xf3, 0xd3, 0x73, 0x52, 0xf5, 0xc1, - 0xbc, 0xa4, 0xd2, 0x34, 0xfd, 0x94, 0xd2, 0xa2, 0xc4, 0x92, 0xcc, 0xfc, 0x3c, 0x88, 0xbc, 0x52, - 0x1c, 0x17, 0x5b, 0x00, 0xd8, 0x74, 0x21, 0x3f, 0x2e, 0x01, 0xa8, 0x91, 0xf1, 0x30, 0x35, 0x12, - 0x8c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x92, 0x7a, 0x10, 0x43, 0xf4, 0x60, 0x86, 0xe8, 0xb9, 0x40, - 0x15, 0x38, 0x71, 0x9c, 0xb8, 0x27, 0xcf, 0x30, 0xe3, 0xbe, 0x3c, 0x63, 0x10, 0x3f, 0x54, 0x33, - 0x4c, 0xca, 0x8a, 0x65, 0xc6, 0x02, 0x79, 0x06, 0x27, 0xef, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, - 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, - 0x3c, 0x96, 0x63, 0x88, 0x32, 0x4c, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, - 0x87, 0x78, 0x49, 0x37, 0x3f, 0x2d, 0x2d, 0x33, 0x39, 0x33, 0x31, 0x07, 0xca, 0xd7, 0x47, 0x84, - 0x44, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0x01, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xd6, 0x88, 0x85, 0xad, 0x28, 0x01, 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 - n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.LockingDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.LockingDuration):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintParams(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0xa - 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 - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.LockingDuration) - n += 1 + l + sovParams(uint64(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 { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LockingDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.LockingDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - 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/locking/types/query.pb.go b/x/locking/types/query.pb.go deleted file mode 100644 index a1f85519f..000000000 --- a/x/locking/types/query.pb.go +++ /dev/null @@ -1,2871 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/locking/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - query "github.com/cosmos/cosmos-sdk/types/query" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - 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 - -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_8ec6b7223160ff4f, []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 - -type QueryParamsResponse struct { - 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_8ec6b7223160ff4f, []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 - -type QueryLockByIdRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryLockByIdRequest) Reset() { *m = QueryLockByIdRequest{} } -func (m *QueryLockByIdRequest) String() string { return proto.CompactTextString(m) } -func (*QueryLockByIdRequest) ProtoMessage() {} -func (*QueryLockByIdRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{2} -} -func (m *QueryLockByIdRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLockByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLockByIdRequest.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 *QueryLockByIdRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLockByIdRequest.Merge(m, src) -} -func (m *QueryLockByIdRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryLockByIdRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLockByIdRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLockByIdRequest proto.InternalMessageInfo - -type QueryLockByIdResponse struct { - Lock Lock `protobuf:"bytes,1,opt,name=lock,proto3" json:"lock" yaml:"lock"` -} - -func (m *QueryLockByIdResponse) Reset() { *m = QueryLockByIdResponse{} } -func (m *QueryLockByIdResponse) String() string { return proto.CompactTextString(m) } -func (*QueryLockByIdResponse) ProtoMessage() {} -func (*QueryLockByIdResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{3} -} -func (m *QueryLockByIdResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLockByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLockByIdResponse.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 *QueryLockByIdResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLockByIdResponse.Merge(m, src) -} -func (m *QueryLockByIdResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryLockByIdResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLockByIdResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLockByIdResponse proto.InternalMessageInfo - -type QueryLocksByOwnerRequest struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` -} - -func (m *QueryLocksByOwnerRequest) Reset() { *m = QueryLocksByOwnerRequest{} } -func (m *QueryLocksByOwnerRequest) String() string { return proto.CompactTextString(m) } -func (*QueryLocksByOwnerRequest) ProtoMessage() {} -func (*QueryLocksByOwnerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{4} -} -func (m *QueryLocksByOwnerRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLocksByOwnerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLocksByOwnerRequest.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 *QueryLocksByOwnerRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLocksByOwnerRequest.Merge(m, src) -} -func (m *QueryLocksByOwnerRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryLocksByOwnerRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLocksByOwnerRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLocksByOwnerRequest proto.InternalMessageInfo - -type QueryLocksByOwnerResponse struct { - Locks []Lock `protobuf:"bytes,1,rep,name=locks,proto3" json:"locks" yaml:"locks"` -} - -func (m *QueryLocksByOwnerResponse) Reset() { *m = QueryLocksByOwnerResponse{} } -func (m *QueryLocksByOwnerResponse) String() string { return proto.CompactTextString(m) } -func (*QueryLocksByOwnerResponse) ProtoMessage() {} -func (*QueryLocksByOwnerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{5} -} -func (m *QueryLocksByOwnerResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryLocksByOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryLocksByOwnerResponse.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 *QueryLocksByOwnerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLocksByOwnerResponse.Merge(m, src) -} -func (m *QueryLocksByOwnerResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryLocksByOwnerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLocksByOwnerResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryLocksByOwnerResponse proto.InternalMessageInfo - -type QueryAllLocksRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllLocksRequest) Reset() { *m = QueryAllLocksRequest{} } -func (m *QueryAllLocksRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllLocksRequest) ProtoMessage() {} -func (*QueryAllLocksRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{6} -} -func (m *QueryAllLocksRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllLocksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllLocksRequest.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 *QueryAllLocksRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllLocksRequest.Merge(m, src) -} -func (m *QueryAllLocksRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllLocksRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllLocksRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllLocksRequest proto.InternalMessageInfo - -type QueryAllLocksResponse struct { - Locks []Lock `protobuf:"bytes,1,rep,name=locks,proto3" json:"locks" yaml:"locks"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllLocksResponse) Reset() { *m = QueryAllLocksResponse{} } -func (m *QueryAllLocksResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllLocksResponse) ProtoMessage() {} -func (*QueryAllLocksResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{7} -} -func (m *QueryAllLocksResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllLocksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllLocksResponse.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 *QueryAllLocksResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllLocksResponse.Merge(m, src) -} -func (m *QueryAllLocksResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllLocksResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllLocksResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllLocksResponse proto.InternalMessageInfo - -type QueryUnlockingByIdRequest struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (m *QueryUnlockingByIdRequest) Reset() { *m = QueryUnlockingByIdRequest{} } -func (m *QueryUnlockingByIdRequest) String() string { return proto.CompactTextString(m) } -func (*QueryUnlockingByIdRequest) ProtoMessage() {} -func (*QueryUnlockingByIdRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{8} -} -func (m *QueryUnlockingByIdRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUnlockingByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUnlockingByIdRequest.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 *QueryUnlockingByIdRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUnlockingByIdRequest.Merge(m, src) -} -func (m *QueryUnlockingByIdRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryUnlockingByIdRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUnlockingByIdRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryUnlockingByIdRequest proto.InternalMessageInfo - -type QueryUnlockingByIdResponse struct { - Unlocking Unlocking `protobuf:"bytes,1,opt,name=unlocking,proto3" json:"unlocking" yaml:"unlocking"` -} - -func (m *QueryUnlockingByIdResponse) Reset() { *m = QueryUnlockingByIdResponse{} } -func (m *QueryUnlockingByIdResponse) String() string { return proto.CompactTextString(m) } -func (*QueryUnlockingByIdResponse) ProtoMessage() {} -func (*QueryUnlockingByIdResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{9} -} -func (m *QueryUnlockingByIdResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUnlockingByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUnlockingByIdResponse.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 *QueryUnlockingByIdResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUnlockingByIdResponse.Merge(m, src) -} -func (m *QueryUnlockingByIdResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryUnlockingByIdResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUnlockingByIdResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryUnlockingByIdResponse proto.InternalMessageInfo - -type QueryUnlockingsByOwnerRequest struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` -} - -func (m *QueryUnlockingsByOwnerRequest) Reset() { *m = QueryUnlockingsByOwnerRequest{} } -func (m *QueryUnlockingsByOwnerRequest) String() string { return proto.CompactTextString(m) } -func (*QueryUnlockingsByOwnerRequest) ProtoMessage() {} -func (*QueryUnlockingsByOwnerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{10} -} -func (m *QueryUnlockingsByOwnerRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUnlockingsByOwnerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUnlockingsByOwnerRequest.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 *QueryUnlockingsByOwnerRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUnlockingsByOwnerRequest.Merge(m, src) -} -func (m *QueryUnlockingsByOwnerRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryUnlockingsByOwnerRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUnlockingsByOwnerRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryUnlockingsByOwnerRequest proto.InternalMessageInfo - -type QueryUnlockingsByOwnerResponse struct { - Unlockings []Unlocking `protobuf:"bytes,1,rep,name=unlockings,proto3" json:"unlockings" yaml:"unlockings"` -} - -func (m *QueryUnlockingsByOwnerResponse) Reset() { *m = QueryUnlockingsByOwnerResponse{} } -func (m *QueryUnlockingsByOwnerResponse) String() string { return proto.CompactTextString(m) } -func (*QueryUnlockingsByOwnerResponse) ProtoMessage() {} -func (*QueryUnlockingsByOwnerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{11} -} -func (m *QueryUnlockingsByOwnerResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryUnlockingsByOwnerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryUnlockingsByOwnerResponse.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 *QueryUnlockingsByOwnerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryUnlockingsByOwnerResponse.Merge(m, src) -} -func (m *QueryUnlockingsByOwnerResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryUnlockingsByOwnerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryUnlockingsByOwnerResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryUnlockingsByOwnerResponse proto.InternalMessageInfo - -type QueryAllUnlockingsRequest struct { - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllUnlockingsRequest) Reset() { *m = QueryAllUnlockingsRequest{} } -func (m *QueryAllUnlockingsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryAllUnlockingsRequest) ProtoMessage() {} -func (*QueryAllUnlockingsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{12} -} -func (m *QueryAllUnlockingsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllUnlockingsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllUnlockingsRequest.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 *QueryAllUnlockingsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllUnlockingsRequest.Merge(m, src) -} -func (m *QueryAllUnlockingsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryAllUnlockingsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllUnlockingsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllUnlockingsRequest proto.InternalMessageInfo - -type QueryAllUnlockingsResponse struct { - Unlockings []Unlocking `protobuf:"bytes,1,rep,name=unlockings,proto3" json:"unlockings" yaml:"unlockings"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty" yaml:"pagination"` -} - -func (m *QueryAllUnlockingsResponse) Reset() { *m = QueryAllUnlockingsResponse{} } -func (m *QueryAllUnlockingsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryAllUnlockingsResponse) ProtoMessage() {} -func (*QueryAllUnlockingsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8ec6b7223160ff4f, []int{13} -} -func (m *QueryAllUnlockingsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryAllUnlockingsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryAllUnlockingsResponse.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 *QueryAllUnlockingsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryAllUnlockingsResponse.Merge(m, src) -} -func (m *QueryAllUnlockingsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryAllUnlockingsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryAllUnlockingsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryAllUnlockingsResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "comdex.locking.v1beta1.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "comdex.locking.v1beta1.QueryParamsResponse") - proto.RegisterType((*QueryLockByIdRequest)(nil), "comdex.locking.v1beta1.QueryLockByIdRequest") - proto.RegisterType((*QueryLockByIdResponse)(nil), "comdex.locking.v1beta1.QueryLockByIdResponse") - proto.RegisterType((*QueryLocksByOwnerRequest)(nil), "comdex.locking.v1beta1.QueryLocksByOwnerRequest") - proto.RegisterType((*QueryLocksByOwnerResponse)(nil), "comdex.locking.v1beta1.QueryLocksByOwnerResponse") - proto.RegisterType((*QueryAllLocksRequest)(nil), "comdex.locking.v1beta1.QueryAllLocksRequest") - proto.RegisterType((*QueryAllLocksResponse)(nil), "comdex.locking.v1beta1.QueryAllLocksResponse") - proto.RegisterType((*QueryUnlockingByIdRequest)(nil), "comdex.locking.v1beta1.QueryUnlockingByIdRequest") - proto.RegisterType((*QueryUnlockingByIdResponse)(nil), "comdex.locking.v1beta1.QueryUnlockingByIdResponse") - proto.RegisterType((*QueryUnlockingsByOwnerRequest)(nil), "comdex.locking.v1beta1.QueryUnlockingsByOwnerRequest") - proto.RegisterType((*QueryUnlockingsByOwnerResponse)(nil), "comdex.locking.v1beta1.QueryUnlockingsByOwnerResponse") - proto.RegisterType((*QueryAllUnlockingsRequest)(nil), "comdex.locking.v1beta1.QueryAllUnlockingsRequest") - proto.RegisterType((*QueryAllUnlockingsResponse)(nil), "comdex.locking.v1beta1.QueryAllUnlockingsResponse") -} - -func init() { - proto.RegisterFile("comdex/locking/v1beta1/query.proto", fileDescriptor_8ec6b7223160ff4f) -} - -var fileDescriptor_8ec6b7223160ff4f = []byte{ - // 809 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x96, 0x51, 0x4f, 0xd3, 0x50, - 0x14, 0xc7, 0xd7, 0x09, 0x24, 0x5c, 0xd4, 0xc8, 0x65, 0x10, 0x58, 0xa0, 0x83, 0x2b, 0x4e, 0x1d, - 0xd0, 0xb2, 0x19, 0x34, 0x31, 0xbe, 0xb0, 0x60, 0xa2, 0x89, 0x89, 0x5a, 0xe2, 0x83, 0x46, 0x31, - 0xdd, 0x56, 0x6a, 0x43, 0xd7, 0x3b, 0xd6, 0x4d, 0x9c, 0x04, 0x1f, 0x7c, 0xf3, 0xcd, 0x84, 0x37, - 0xbf, 0x80, 0x3e, 0x18, 0x3f, 0x83, 0xbe, 0xf1, 0x48, 0xe2, 0x8b, 0xf1, 0x81, 0xe8, 0xf0, 0x13, - 0xf0, 0x09, 0x4c, 0xef, 0x3d, 0x5d, 0xb7, 0xb2, 0xb6, 0x23, 0x51, 0x9e, 0xb6, 0xae, 0xe7, 0xfc, - 0xff, 0xbf, 0x73, 0xee, 0xe9, 0xe9, 0x10, 0x29, 0xd2, 0x72, 0x49, 0x7b, 0x25, 0x9b, 0xb4, 0xb8, - 0x61, 0x58, 0xba, 0xfc, 0x32, 0x5b, 0xd0, 0x6a, 0x6a, 0x56, 0xde, 0xac, 0x6b, 0xd5, 0x86, 0x54, - 0xa9, 0xd2, 0x1a, 0xc5, 0x63, 0x3c, 0x46, 0x82, 0x18, 0x09, 0x62, 0x92, 0x09, 0x9d, 0xea, 0x94, - 0x85, 0xc8, 0xce, 0x37, 0x1e, 0x9d, 0x9c, 0xd4, 0x29, 0xd5, 0x4d, 0x4d, 0x56, 0x2b, 0x86, 0xac, - 0x5a, 0x16, 0xad, 0xa9, 0x35, 0x83, 0x5a, 0x36, 0xdc, 0xcd, 0x14, 0xa9, 0x5d, 0xa6, 0xb6, 0x5c, - 0x50, 0x6d, 0x8d, 0x9b, 0xb4, 0x2c, 0x2b, 0xaa, 0x6e, 0x58, 0x2c, 0x18, 0x62, 0x2f, 0x06, 0xb0, - 0x55, 0xd4, 0xaa, 0x5a, 0x76, 0x05, 0x67, 0x02, 0x82, 0x9c, 0x6b, 0x1e, 0x42, 0x12, 0x08, 0x3f, - 0x74, 0x9c, 0x1e, 0xb0, 0x3c, 0x45, 0xdb, 0xac, 0x6b, 0x76, 0x8d, 0xac, 0xa2, 0x91, 0x8e, 0x5f, - 0xed, 0x0a, 0xb5, 0x6c, 0x0d, 0xdf, 0x42, 0x03, 0x5c, 0x7f, 0x5c, 0x98, 0x16, 0xae, 0x0c, 0xe5, - 0x44, 0xa9, 0x7b, 0xf5, 0x12, 0xcf, 0xcb, 0xf7, 0xed, 0x1d, 0xa4, 0x62, 0x0a, 0xe4, 0x90, 0x34, - 0x4a, 0x30, 0xd1, 0x7b, 0xb4, 0xb8, 0x91, 0x6f, 0xdc, 0x2d, 0x81, 0x19, 0x3e, 0x8f, 0xe2, 0x46, - 0x89, 0x29, 0xf6, 0x29, 0x71, 0xa3, 0x44, 0xd6, 0xd0, 0xa8, 0x2f, 0x0e, 0xec, 0x6f, 0xa3, 0x3e, - 0xc7, 0x08, 0xcc, 0x27, 0x83, 0xcc, 0x59, 0xde, 0x88, 0x63, 0x7d, 0x74, 0x90, 0x1a, 0x6a, 0xa8, - 0x65, 0xf3, 0x26, 0x71, 0x62, 0x88, 0xc2, 0xd2, 0xc9, 0x22, 0x1a, 0x6f, 0xe9, 0xdb, 0xf9, 0xc6, - 0xfd, 0x2d, 0x4b, 0xab, 0xba, 0x2c, 0x09, 0xd4, 0x4f, 0x9d, 0x6b, 0xe6, 0x31, 0xa8, 0xf0, 0x0b, - 0xa2, 0xa1, 0x89, 0x2e, 0x19, 0x40, 0x75, 0x07, 0xf5, 0x3b, 0xb2, 0x4e, 0x4f, 0xce, 0x44, 0x62, - 0x25, 0x00, 0xeb, 0xac, 0x87, 0x65, 0x13, 0x85, 0x0b, 0x90, 0x3a, 0x34, 0x68, 0xd9, 0x34, 0x99, - 0x93, 0x0b, 0xf5, 0x0c, 0x21, 0xef, 0xfc, 0xa1, 0xfa, 0xb4, 0xc4, 0x87, 0x45, 0x72, 0x86, 0x45, - 0xe2, 0x13, 0xe9, 0x75, 0x5f, 0xd7, 0x20, 0x37, 0x3f, 0x7a, 0x74, 0x90, 0x1a, 0xe6, 0x66, 0x9e, - 0x06, 0x51, 0xda, 0x04, 0xc9, 0x37, 0x01, 0x1a, 0xee, 0xf9, 0xfe, 0xeb, 0xd2, 0xf0, 0x5a, 0x47, - 0x09, 0x71, 0x56, 0xc2, 0xe5, 0xc8, 0x12, 0x38, 0x46, 0x2f, 0x35, 0xcc, 0xc1, 0x09, 0x3d, 0xb2, - 0x80, 0x2d, 0x6c, 0xc0, 0xb6, 0x50, 0xb2, 0x5b, 0x30, 0x14, 0xfd, 0x18, 0x0d, 0xd6, 0xdd, 0x1b, - 0xd0, 0xec, 0x99, 0xa0, 0xc2, 0x3d, 0x85, 0x71, 0xa8, 0xfe, 0x02, 0xe7, 0x6c, 0x29, 0x10, 0xc5, - 0x53, 0x23, 0x4b, 0x68, 0xaa, 0xd3, 0xb8, 0xb7, 0xf1, 0x7b, 0x83, 0xc4, 0xa0, 0x34, 0x60, 0x7e, - 0x8a, 0x50, 0xcb, 0xc5, 0x3d, 0xad, 0x1e, 0xa0, 0x27, 0x00, 0x7a, 0xd8, 0x07, 0x6d, 0x13, 0xa5, - 0x4d, 0x8f, 0xbc, 0x86, 0xe6, 0x2e, 0x9b, 0xa6, 0x87, 0x70, 0x4a, 0xc3, 0xf9, 0x53, 0x80, 0xc3, - 0xf2, 0x99, 0x9f, 0x46, 0xe1, 0xff, 0x7b, 0x6a, 0x73, 0xbb, 0x83, 0xa8, 0x9f, 0x15, 0x87, 0xdf, - 0x09, 0x68, 0x80, 0x2f, 0x4d, 0x9c, 0x09, 0xc2, 0x3f, 0xbe, 0xa7, 0x93, 0x73, 0x3d, 0xc5, 0x72, - 0x20, 0x92, 0x7e, 0xfb, 0xfd, 0xcf, 0x6e, 0x7c, 0x1a, 0x8b, 0x72, 0xe8, 0xbb, 0x03, 0x7f, 0x10, - 0xd0, 0xb9, 0xf6, 0x05, 0xbc, 0x82, 0xe7, 0x43, 0x6d, 0x7c, 0xfb, 0x3c, 0xb9, 0xd0, 0x63, 0x34, - 0x60, 0xcd, 0x33, 0xac, 0x34, 0x9e, 0x95, 0x43, 0xde, 0x56, 0xcf, 0x8d, 0x92, 0xbc, 0x6d, 0x94, - 0x76, 0xf0, 0x67, 0x01, 0x0d, 0x1f, 0xdb, 0xc5, 0x78, 0x31, 0xd2, 0xd2, 0xf7, 0xa4, 0x25, 0xb3, - 0x27, 0xc8, 0x00, 0xd0, 0x1c, 0x03, 0x9d, 0xc7, 0x99, 0x50, 0x50, 0xf6, 0xc8, 0xca, 0xdb, 0xec, - 0x63, 0x07, 0xef, 0xba, 0xbd, 0x74, 0x77, 0x6b, 0x44, 0x2f, 0x7d, 0xab, 0x3f, 0xa2, 0x97, 0xfe, - 0x85, 0x4d, 0x2e, 0x31, 0xc4, 0x14, 0x9e, 0x0a, 0x43, 0xb4, 0xf1, 0x17, 0x01, 0xde, 0xfa, 0xed, - 0x1b, 0x70, 0x05, 0x87, 0xf7, 0xa4, 0xdb, 0x6a, 0x4d, 0xe6, 0x4e, 0x92, 0x02, 0x90, 0x59, 0x06, - 0x39, 0x87, 0xaf, 0x06, 0x41, 0xb6, 0x9e, 0xc0, 0xd6, 0xa9, 0x7f, 0x15, 0xd0, 0x58, 0xf7, 0x15, - 0x88, 0x97, 0x7a, 0x23, 0xf0, 0x9f, 0xff, 0xf5, 0x93, 0xa6, 0x01, 0xfc, 0x0d, 0x06, 0x9f, 0xc5, - 0x72, 0x34, 0x7c, 0xe7, 0x24, 0x7c, 0x74, 0x7b, 0xde, 0xb1, 0xc8, 0x22, 0x7a, 0xde, 0x6d, 0xe3, - 0x46, 0xf4, 0xbc, 0xeb, 0x9e, 0x24, 0x19, 0x86, 0x3d, 0x8b, 0x49, 0x24, 0xb6, 0x9d, 0x5f, 0xdd, - 0xfb, 0x2d, 0xc6, 0x3e, 0x35, 0xc5, 0xd8, 0x5e, 0x53, 0x14, 0xf6, 0x9b, 0xa2, 0xf0, 0xab, 0x29, - 0x0a, 0xef, 0x0f, 0xc5, 0xd8, 0xfe, 0xa1, 0x18, 0xfb, 0x71, 0x28, 0xc6, 0x9e, 0x64, 0x75, 0xa3, - 0xf6, 0xa2, 0x5e, 0x70, 0x38, 0x40, 0x6f, 0x81, 0xae, 0xaf, 0x1b, 0x45, 0x43, 0x35, 0x5d, 0x7d, - 0xcf, 0xa1, 0xd6, 0xa8, 0x68, 0x76, 0x61, 0x80, 0xfd, 0xdd, 0xbc, 0xf6, 0x37, 0x00, 0x00, 0xff, - 0xff, 0x94, 0x55, 0xfe, 0x79, 0x54, 0x0b, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) - QueryLockByID(ctx context.Context, in *QueryLockByIdRequest, opts ...grpc.CallOption) (*QueryLockByIdResponse, error) - QueryLocksByOwner(ctx context.Context, in *QueryLocksByOwnerRequest, opts ...grpc.CallOption) (*QueryLocksByOwnerResponse, error) - QueryAllLocks(ctx context.Context, in *QueryAllLocksRequest, opts ...grpc.CallOption) (*QueryAllLocksResponse, error) - QueryUnlockingByID(ctx context.Context, in *QueryUnlockingByIdRequest, opts ...grpc.CallOption) (*QueryUnlockingByIdResponse, error) - QueryUnlockingsByOwner(ctx context.Context, in *QueryUnlockingsByOwnerRequest, opts ...grpc.CallOption) (*QueryUnlockingsByOwnerResponse, error) - QueryAllUnlockings(ctx context.Context, in *QueryAllUnlockingsRequest, opts ...grpc.CallOption) (*QueryAllUnlockingsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -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, "/comdex.locking.v1beta1.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryLockByID(ctx context.Context, in *QueryLockByIdRequest, opts ...grpc.CallOption) (*QueryLockByIdResponse, error) { - out := new(QueryLockByIdResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Query/QueryLockByID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryLocksByOwner(ctx context.Context, in *QueryLocksByOwnerRequest, opts ...grpc.CallOption) (*QueryLocksByOwnerResponse, error) { - out := new(QueryLocksByOwnerResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Query/QueryLocksByOwner", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAllLocks(ctx context.Context, in *QueryAllLocksRequest, opts ...grpc.CallOption) (*QueryAllLocksResponse, error) { - out := new(QueryAllLocksResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Query/QueryAllLocks", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryUnlockingByID(ctx context.Context, in *QueryUnlockingByIdRequest, opts ...grpc.CallOption) (*QueryUnlockingByIdResponse, error) { - out := new(QueryUnlockingByIdResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Query/QueryUnlockingByID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryUnlockingsByOwner(ctx context.Context, in *QueryUnlockingsByOwnerRequest, opts ...grpc.CallOption) (*QueryUnlockingsByOwnerResponse, error) { - out := new(QueryUnlockingsByOwnerResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Query/QueryUnlockingsByOwner", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryClient) QueryAllUnlockings(ctx context.Context, in *QueryAllUnlockingsRequest, opts ...grpc.CallOption) (*QueryAllUnlockingsResponse, error) { - out := new(QueryAllUnlockingsResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Query/QueryAllUnlockings", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) - QueryLockByID(context.Context, *QueryLockByIdRequest) (*QueryLockByIdResponse, error) - QueryLocksByOwner(context.Context, *QueryLocksByOwnerRequest) (*QueryLocksByOwnerResponse, error) - QueryAllLocks(context.Context, *QueryAllLocksRequest) (*QueryAllLocksResponse, error) - QueryUnlockingByID(context.Context, *QueryUnlockingByIdRequest) (*QueryUnlockingByIdResponse, error) - QueryUnlockingsByOwner(context.Context, *QueryUnlockingsByOwnerRequest) (*QueryUnlockingsByOwnerResponse, error) - QueryAllUnlockings(context.Context, *QueryAllUnlockingsRequest) (*QueryAllUnlockingsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -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) QueryLockByID(ctx context.Context, req *QueryLockByIdRequest) (*QueryLockByIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryLockByID not implemented") -} -func (*UnimplementedQueryServer) QueryLocksByOwner(ctx context.Context, req *QueryLocksByOwnerRequest) (*QueryLocksByOwnerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryLocksByOwner not implemented") -} -func (*UnimplementedQueryServer) QueryAllLocks(ctx context.Context, req *QueryAllLocksRequest) (*QueryAllLocksResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAllLocks not implemented") -} -func (*UnimplementedQueryServer) QueryUnlockingByID(ctx context.Context, req *QueryUnlockingByIdRequest) (*QueryUnlockingByIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryUnlockingByID not implemented") -} -func (*UnimplementedQueryServer) QueryUnlockingsByOwner(ctx context.Context, req *QueryUnlockingsByOwnerRequest) (*QueryUnlockingsByOwnerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryUnlockingsByOwner not implemented") -} -func (*UnimplementedQueryServer) QueryAllUnlockings(ctx context.Context, req *QueryAllUnlockingsRequest) (*QueryAllUnlockingsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryAllUnlockings not implemented") -} - -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: "/comdex.locking.v1beta1.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_QueryLockByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLockByIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryLockByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Query/QueryLockByID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryLockByID(ctx, req.(*QueryLockByIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryLocksByOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLocksByOwnerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryLocksByOwner(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Query/QueryLocksByOwner", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryLocksByOwner(ctx, req.(*QueryLocksByOwnerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAllLocks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllLocksRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAllLocks(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Query/QueryAllLocks", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAllLocks(ctx, req.(*QueryAllLocksRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryUnlockingByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryUnlockingByIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryUnlockingByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Query/QueryUnlockingByID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryUnlockingByID(ctx, req.(*QueryUnlockingByIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryUnlockingsByOwner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryUnlockingsByOwnerRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryUnlockingsByOwner(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Query/QueryUnlockingsByOwner", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryUnlockingsByOwner(ctx, req.(*QueryUnlockingsByOwnerRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Query_QueryAllUnlockings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryAllUnlockingsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryAllUnlockings(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Query/QueryAllUnlockings", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryAllUnlockings(ctx, req.(*QueryAllUnlockingsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.locking.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - { - MethodName: "QueryLockByID", - Handler: _Query_QueryLockByID_Handler, - }, - { - MethodName: "QueryLocksByOwner", - Handler: _Query_QueryLocksByOwner_Handler, - }, - { - MethodName: "QueryAllLocks", - Handler: _Query_QueryAllLocks_Handler, - }, - { - MethodName: "QueryUnlockingByID", - Handler: _Query_QueryUnlockingByID_Handler, - }, - { - MethodName: "QueryUnlockingsByOwner", - Handler: _Query_QueryUnlockingsByOwner_Handler, - }, - { - MethodName: "QueryAllUnlockings", - Handler: _Query_QueryAllUnlockings_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/locking/v1beta1/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 *QueryLockByIdRequest) 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 *QueryLockByIdRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLockByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryLockByIdResponse) 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 *QueryLockByIdResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLockByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Lock.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 *QueryLocksByOwnerRequest) 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 *QueryLocksByOwnerRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLocksByOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryLocksByOwnerResponse) 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 *QueryLocksByOwnerResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryLocksByOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Locks) > 0 { - for iNdEx := len(m.Locks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Locks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAllLocksRequest) 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 *QueryAllLocksRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllLocksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllLocksResponse) 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 *QueryAllLocksResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllLocksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Locks) > 0 { - for iNdEx := len(m.Locks) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Locks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryUnlockingByIdRequest) 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 *QueryUnlockingByIdRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUnlockingByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Id != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Id)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *QueryUnlockingByIdResponse) 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 *QueryUnlockingByIdResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUnlockingByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Unlocking.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 *QueryUnlockingsByOwnerRequest) 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 *QueryUnlockingsByOwnerRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUnlockingsByOwnerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryUnlockingsByOwnerResponse) 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 *QueryUnlockingsByOwnerResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryUnlockingsByOwnerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Unlockings) > 0 { - for iNdEx := len(m.Unlockings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Unlockings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *QueryAllUnlockingsRequest) 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 *QueryAllUnlockingsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllUnlockingsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryAllUnlockingsResponse) 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 *QueryAllUnlockingsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryAllUnlockingsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Pagination != nil { - { - size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Unlockings) > 0 { - for iNdEx := len(m.Unlockings) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Unlockings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - 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 *QueryLockByIdRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryLockByIdResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Lock.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryLocksByOwnerRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryLocksByOwnerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Locks) > 0 { - for _, e := range m.Locks { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryAllLocksRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllLocksResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Locks) > 0 { - for _, e := range m.Locks { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryUnlockingByIdRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) - } - return n -} - -func (m *QueryUnlockingByIdResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Unlocking.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *QueryUnlockingsByOwnerRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryUnlockingsByOwnerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Unlockings) > 0 { - for _, e := range m.Unlockings { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryAllUnlockingsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryAllUnlockingsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Unlockings) > 0 { - for _, e := range m.Unlockings { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -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 *QueryLockByIdRequest) 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: QueryLockByIdRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLockByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 *QueryLockByIdResponse) 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: QueryLockByIdResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLockByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Lock", 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.Lock.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 *QueryLocksByOwnerRequest) 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: QueryLocksByOwnerRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLocksByOwnerRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryLocksByOwnerResponse) 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: QueryLocksByOwnerResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLocksByOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Locks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Locks = append(m.Locks, Lock{}) - if err := m.Locks[len(m.Locks)-1].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 *QueryAllLocksRequest) 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: QueryAllLocksRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLocksRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllLocksResponse) 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: QueryAllLocksResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllLocksResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Locks", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Locks = append(m.Locks, Lock{}) - if err := m.Locks[len(m.Locks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryUnlockingByIdRequest) 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: QueryUnlockingByIdRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnlockingByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) - } - m.Id = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Id |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 *QueryUnlockingByIdResponse) 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: QueryUnlockingByIdResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnlockingByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unlocking", 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.Unlocking.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 *QueryUnlockingsByOwnerRequest) 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: QueryUnlockingsByOwnerRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnlockingsByOwnerRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryUnlockingsByOwnerResponse) 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: QueryUnlockingsByOwnerResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryUnlockingsByOwnerResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unlockings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Unlockings = append(m.Unlockings, Unlocking{}) - if err := m.Unlockings[len(m.Unlockings)-1].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 *QueryAllUnlockingsRequest) 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: QueryAllUnlockingsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllUnlockingsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageRequest{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryAllUnlockingsResponse) 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: QueryAllUnlockingsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryAllUnlockingsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Unlockings", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Unlockings = append(m.Unlockings, Unlocking{}) - if err := m.Unlockings[len(m.Unlockings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Pagination == nil { - m.Pagination = &query.PageResponse{} - } - if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - 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, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/locking/types/query.pb.gw.go b/x/locking/types/query.pb.gw.go deleted file mode 100644 index 1be233583..000000000 --- a/x/locking/types/query.pb.gw.go +++ /dev/null @@ -1,723 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: comdex/locking/v1beta1/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -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_QueryLockByID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLockByIdRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.QueryLockByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryLockByID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLockByIdRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.QueryLockByID(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryLocksByOwner_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLocksByOwnerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - msg, err := client.QueryLocksByOwner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryLocksByOwner_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLocksByOwnerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - msg, err := server.QueryLocksByOwner(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryAllLocks_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_QueryAllLocks_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllLocksRequest - 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_QueryAllLocks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAllLocks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAllLocks_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllLocksRequest - 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_QueryAllLocks_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAllLocks(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryUnlockingByID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryUnlockingByIdRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := client.QueryUnlockingByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryUnlockingByID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryUnlockingByIdRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Uint64(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - - msg, err := server.QueryUnlockingByID(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_QueryUnlockingsByOwner_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryUnlockingsByOwnerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - msg, err := client.QueryUnlockingsByOwner(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryUnlockingsByOwner_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryUnlockingsByOwnerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - msg, err := server.QueryUnlockingsByOwner(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_QueryAllUnlockings_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_QueryAllUnlockings_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllUnlockingsRequest - 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_QueryAllUnlockings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryAllUnlockings(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryAllUnlockings_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryAllUnlockingsRequest - 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_QueryAllUnlockings_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryAllUnlockings(ctx, &protoReq) - return msg, metadata, err - -} - -// 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. -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_QueryLockByID_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_QueryLockByID_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_QueryLockByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryLocksByOwner_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_QueryLocksByOwner_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_QueryLocksByOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllLocks_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_QueryAllLocks_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_QueryAllLocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryUnlockingByID_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_QueryUnlockingByID_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_QueryUnlockingByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryUnlockingsByOwner_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_QueryUnlockingsByOwner_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_QueryUnlockingsByOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllUnlockings_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_QueryAllUnlockings_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_QueryAllUnlockings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "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_QueryLockByID_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_QueryLockByID_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_QueryLockByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryLocksByOwner_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_QueryLocksByOwner_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_QueryLocksByOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllLocks_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_QueryAllLocks_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_QueryAllLocks_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryUnlockingByID_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_QueryUnlockingByID_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_QueryUnlockingByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryUnlockingsByOwner_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_QueryUnlockingsByOwner_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_QueryUnlockingsByOwner_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_QueryAllUnlockings_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_QueryAllUnlockings_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_QueryAllUnlockings_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "locking", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryLockByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "locking", "v1beta1", "lock_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryLocksByOwner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "locking", "v1beta1", "lock_owner", "owner"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAllLocks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "locking", "v1beta1", "locks"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryUnlockingByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "locking", "v1beta1", "unlocking_id", "id"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryUnlockingsByOwner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"comdex", "locking", "v1beta1", "unlocking_owner", "owner"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_QueryAllUnlockings_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "locking", "v1beta1", "unlockings"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_QueryLockByID_0 = runtime.ForwardResponseMessage - - forward_Query_QueryLocksByOwner_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAllLocks_0 = runtime.ForwardResponseMessage - - forward_Query_QueryUnlockingByID_0 = runtime.ForwardResponseMessage - - forward_Query_QueryUnlockingsByOwner_0 = runtime.ForwardResponseMessage - - forward_Query_QueryAllUnlockings_0 = runtime.ForwardResponseMessage -) diff --git a/x/locking/types/tx.pb.go b/x/locking/types/tx.pb.go deleted file mode 100644 index 2f59d80b2..000000000 --- a/x/locking/types/tx.pb.go +++ /dev/null @@ -1,1062 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: comdex/locking/v1beta1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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 - -type MsgLockTokens struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - Duration time.Duration `protobuf:"bytes,2,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` - Coin github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=coin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` -} - -func (m *MsgLockTokens) Reset() { *m = MsgLockTokens{} } -func (m *MsgLockTokens) String() string { return proto.CompactTextString(m) } -func (*MsgLockTokens) ProtoMessage() {} -func (*MsgLockTokens) Descriptor() ([]byte, []int) { - return fileDescriptor_62af88ff2c14517e, []int{0} -} -func (m *MsgLockTokens) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgLockTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgLockTokens.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 *MsgLockTokens) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgLockTokens.Merge(m, src) -} -func (m *MsgLockTokens) XXX_Size() int { - return m.Size() -} -func (m *MsgLockTokens) XXX_DiscardUnknown() { - xxx_messageInfo_MsgLockTokens.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgLockTokens proto.InternalMessageInfo - -func (m *MsgLockTokens) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgLockTokens) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *MsgLockTokens) GetCoin() github_com_cosmos_cosmos_sdk_types.Coin { - if m != nil { - return m.Coin - } - return github_com_cosmos_cosmos_sdk_types.Coin{} -} - -type MsgLockTokensResponse struct { -} - -func (m *MsgLockTokensResponse) Reset() { *m = MsgLockTokensResponse{} } -func (m *MsgLockTokensResponse) String() string { return proto.CompactTextString(m) } -func (*MsgLockTokensResponse) ProtoMessage() {} -func (*MsgLockTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_62af88ff2c14517e, []int{1} -} -func (m *MsgLockTokensResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgLockTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgLockTokensResponse.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 *MsgLockTokensResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgLockTokensResponse.Merge(m, src) -} -func (m *MsgLockTokensResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgLockTokensResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgLockTokensResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgLockTokensResponse proto.InternalMessageInfo - -type MsgBeginUnlockingTokens struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty" yaml:"owner"` - LockId uint64 `protobuf:"varint,2,opt,name=lock_id,json=lockId,proto3" json:"lock_id,omitempty" yaml:"lock_id"` - Coin github_com_cosmos_cosmos_sdk_types.Coin `protobuf:"bytes,3,opt,name=coin,proto3,casttype=github.com/cosmos/cosmos-sdk/types.Coin" json:"coin"` -} - -func (m *MsgBeginUnlockingTokens) Reset() { *m = MsgBeginUnlockingTokens{} } -func (m *MsgBeginUnlockingTokens) String() string { return proto.CompactTextString(m) } -func (*MsgBeginUnlockingTokens) ProtoMessage() {} -func (*MsgBeginUnlockingTokens) Descriptor() ([]byte, []int) { - return fileDescriptor_62af88ff2c14517e, []int{2} -} -func (m *MsgBeginUnlockingTokens) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBeginUnlockingTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBeginUnlockingTokens.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 *MsgBeginUnlockingTokens) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBeginUnlockingTokens.Merge(m, src) -} -func (m *MsgBeginUnlockingTokens) XXX_Size() int { - return m.Size() -} -func (m *MsgBeginUnlockingTokens) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBeginUnlockingTokens.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBeginUnlockingTokens proto.InternalMessageInfo - -func (m *MsgBeginUnlockingTokens) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *MsgBeginUnlockingTokens) GetLockId() uint64 { - if m != nil { - return m.LockId - } - return 0 -} - -func (m *MsgBeginUnlockingTokens) GetCoin() github_com_cosmos_cosmos_sdk_types.Coin { - if m != nil { - return m.Coin - } - return github_com_cosmos_cosmos_sdk_types.Coin{} -} - -type MsgBeginUnlockingTokensResponse struct { -} - -func (m *MsgBeginUnlockingTokensResponse) Reset() { *m = MsgBeginUnlockingTokensResponse{} } -func (m *MsgBeginUnlockingTokensResponse) String() string { return proto.CompactTextString(m) } -func (*MsgBeginUnlockingTokensResponse) ProtoMessage() {} -func (*MsgBeginUnlockingTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_62af88ff2c14517e, []int{3} -} -func (m *MsgBeginUnlockingTokensResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgBeginUnlockingTokensResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgBeginUnlockingTokensResponse.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 *MsgBeginUnlockingTokensResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgBeginUnlockingTokensResponse.Merge(m, src) -} -func (m *MsgBeginUnlockingTokensResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgBeginUnlockingTokensResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgBeginUnlockingTokensResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgBeginUnlockingTokensResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgLockTokens)(nil), "comdex.locking.v1beta1.MsgLockTokens") - proto.RegisterType((*MsgLockTokensResponse)(nil), "comdex.locking.v1beta1.MsgLockTokensResponse") - proto.RegisterType((*MsgBeginUnlockingTokens)(nil), "comdex.locking.v1beta1.MsgBeginUnlockingTokens") - proto.RegisterType((*MsgBeginUnlockingTokensResponse)(nil), "comdex.locking.v1beta1.MsgBeginUnlockingTokensResponse") -} - -func init() { proto.RegisterFile("comdex/locking/v1beta1/tx.proto", fileDescriptor_62af88ff2c14517e) } - -var fileDescriptor_62af88ff2c14517e = []byte{ - // 467 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xbd, 0x6f, 0xd3, 0x40, - 0x14, 0xcf, 0xb5, 0xa5, 0xc0, 0xf1, 0x6d, 0x01, 0x0d, 0x19, 0x7c, 0xc5, 0x12, 0x50, 0x09, 0x72, - 0xa7, 0x94, 0x01, 0x89, 0xd1, 0xb0, 0x20, 0xc8, 0x62, 0xc1, 0xc2, 0x00, 0xf2, 0xc7, 0xe5, 0x7a, - 0x4a, 0xec, 0x67, 0xe5, 0x1c, 0x68, 0x06, 0x06, 0xfe, 0x03, 0x46, 0xfe, 0xa4, 0x4e, 0xa8, 0x23, - 0x93, 0x41, 0xc9, 0x82, 0x18, 0x33, 0x32, 0x21, 0xdf, 0x47, 0x69, 0xa4, 0x82, 0xc8, 0xd0, 0xc9, - 0x77, 0x7e, 0xbf, 0xf7, 0x7e, 0x1f, 0x7e, 0xc6, 0x24, 0x85, 0x3c, 0xe3, 0xfb, 0x6c, 0x04, 0xe9, - 0x50, 0x16, 0x82, 0xbd, 0xeb, 0x25, 0xbc, 0x8a, 0x7b, 0xac, 0xda, 0xa7, 0xe5, 0x18, 0x2a, 0xf0, - 0x6e, 0x1a, 0x00, 0xb5, 0x00, 0x6a, 0x01, 0x9d, 0xeb, 0x02, 0x04, 0x68, 0x08, 0x6b, 0x4e, 0x06, - 0xdd, 0xf1, 0x05, 0x80, 0x18, 0x71, 0xa6, 0x6f, 0xc9, 0x64, 0xc0, 0xb2, 0xc9, 0x38, 0xae, 0x24, - 0x14, 0xae, 0x9e, 0x82, 0xca, 0x41, 0xb1, 0x24, 0x56, 0xfc, 0x88, 0x2b, 0x05, 0x69, 0xeb, 0xc1, - 0xc7, 0x35, 0x7c, 0xa9, 0xaf, 0xc4, 0x0b, 0x48, 0x87, 0x2f, 0x61, 0xc8, 0x0b, 0xe5, 0xdd, 0xc5, - 0x67, 0xe0, 0x7d, 0xc1, 0xc7, 0x6d, 0xb4, 0x8d, 0x76, 0xce, 0x87, 0x57, 0x17, 0x35, 0xb9, 0x38, - 0x8d, 0xf3, 0xd1, 0xe3, 0x40, 0xbf, 0x0e, 0x22, 0x53, 0xf6, 0xf6, 0xf0, 0x39, 0xc7, 0xd5, 0x5e, - 0xdb, 0x46, 0x3b, 0x17, 0x76, 0x6f, 0x51, 0x23, 0x86, 0x3a, 0x31, 0xf4, 0xa9, 0x05, 0x84, 0xbd, - 0x83, 0x9a, 0xb4, 0x7e, 0xd6, 0xc4, 0x73, 0x2d, 0x0f, 0x20, 0x97, 0x15, 0xcf, 0xcb, 0x6a, 0xba, - 0xa8, 0xc9, 0x15, 0x33, 0xdf, 0xd5, 0x82, 0xcf, 0xdf, 0x08, 0x8a, 0x8e, 0xa6, 0x7b, 0x6f, 0xf0, - 0x46, 0xa3, 0xb8, 0xbd, 0x6e, 0x59, 0x8c, 0x25, 0xda, 0x58, 0x72, 0xe9, 0xd0, 0x27, 0x20, 0x8b, - 0x90, 0x35, 0x2c, 0xbf, 0x6a, 0x72, 0x4f, 0xc8, 0x6a, 0x6f, 0x92, 0xd0, 0x14, 0x72, 0x66, 0xfd, - 0x9b, 0x47, 0x57, 0x65, 0x43, 0x56, 0x4d, 0x4b, 0xae, 0x74, 0x43, 0xa4, 0xe7, 0x06, 0x5b, 0xf8, - 0xc6, 0x52, 0x04, 0x11, 0x57, 0x25, 0x14, 0x8a, 0x07, 0x5f, 0x10, 0xde, 0xea, 0x2b, 0x11, 0x72, - 0x21, 0x8b, 0x57, 0x85, 0xfd, 0x20, 0x2b, 0xc6, 0x74, 0x1f, 0x9f, 0x6d, 0x1a, 0xdf, 0xca, 0x4c, - 0xa7, 0xb4, 0x11, 0x7a, 0x8b, 0x9a, 0x5c, 0x36, 0x48, 0x5b, 0x08, 0xa2, 0xcd, 0xe6, 0xf4, 0x2c, - 0x3b, 0x75, 0xa7, 0xb7, 0x31, 0xf9, 0x8b, 0x1f, 0xe7, 0x79, 0xf7, 0x07, 0xc2, 0xeb, 0x7d, 0x25, - 0xbc, 0x04, 0xe3, 0x63, 0x4b, 0x71, 0x87, 0x9e, 0xbc, 0x95, 0x74, 0x29, 0xb8, 0x4e, 0xf7, 0xbf, - 0x60, 0x8e, 0xcb, 0xfb, 0x80, 0xaf, 0x1d, 0xd3, 0x62, 0xa9, 0xd8, 0x3f, 0x66, 0x9c, 0xa4, 0xbc, - 0xf3, 0x68, 0xc5, 0x06, 0x47, 0x1f, 0x3e, 0x3f, 0x98, 0xf9, 0xe8, 0x70, 0xe6, 0xa3, 0xef, 0x33, - 0x1f, 0x7d, 0x9a, 0xfb, 0xad, 0xc3, 0xb9, 0xdf, 0xfa, 0x3a, 0xf7, 0x5b, 0xaf, 0x7b, 0x4b, 0xb1, - 0x36, 0xc3, 0xbb, 0x30, 0x18, 0xc8, 0x54, 0xc6, 0x23, 0x7b, 0x67, 0x7f, 0xfe, 0x60, 0x9d, 0x72, - 0xb2, 0xa9, 0x97, 0xfe, 0xe1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xef, 0x40, 0x68, 0x31, 0xe0, - 0x03, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - LockTokens(ctx context.Context, in *MsgLockTokens, opts ...grpc.CallOption) (*MsgLockTokensResponse, error) - BeginUnlockTokens(ctx context.Context, in *MsgBeginUnlockingTokens, opts ...grpc.CallOption) (*MsgBeginUnlockingTokensResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) LockTokens(ctx context.Context, in *MsgLockTokens, opts ...grpc.CallOption) (*MsgLockTokensResponse, error) { - out := new(MsgLockTokensResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Msg/LockTokens", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) BeginUnlockTokens(ctx context.Context, in *MsgBeginUnlockingTokens, opts ...grpc.CallOption) (*MsgBeginUnlockingTokensResponse, error) { - out := new(MsgBeginUnlockingTokensResponse) - err := c.cc.Invoke(ctx, "/comdex.locking.v1beta1.Msg/BeginUnlockTokens", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - LockTokens(context.Context, *MsgLockTokens) (*MsgLockTokensResponse, error) - BeginUnlockTokens(context.Context, *MsgBeginUnlockingTokens) (*MsgBeginUnlockingTokensResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) LockTokens(ctx context.Context, req *MsgLockTokens) (*MsgLockTokensResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LockTokens not implemented") -} -func (*UnimplementedMsgServer) BeginUnlockTokens(ctx context.Context, req *MsgBeginUnlockingTokens) (*MsgBeginUnlockingTokensResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeginUnlockTokens not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_LockTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgLockTokens) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).LockTokens(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Msg/LockTokens", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).LockTokens(ctx, req.(*MsgLockTokens)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_BeginUnlockTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgBeginUnlockingTokens) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).BeginUnlockTokens(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/comdex.locking.v1beta1.Msg/BeginUnlockTokens", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).BeginUnlockTokens(ctx, req.(*MsgBeginUnlockingTokens)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "comdex.locking.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "LockTokens", - Handler: _Msg_LockTokens_Handler, - }, - { - MethodName: "BeginUnlockTokens", - Handler: _Msg_BeginUnlockTokens_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "comdex/locking/v1beta1/tx.proto", -} - -func (m *MsgLockTokens) 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 *MsgLockTokens) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgLockTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Coin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintTx(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x12 - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgLockTokensResponse) 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 *MsgLockTokensResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgLockTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgBeginUnlockingTokens) 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 *MsgBeginUnlockingTokens) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBeginUnlockingTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Coin.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.LockId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.LockId)) - i-- - dAtA[i] = 0x10 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgBeginUnlockingTokensResponse) 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 *MsgBeginUnlockingTokensResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgBeginUnlockingTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgLockTokens) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovTx(uint64(l)) - l = m.Coin.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgLockTokensResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgBeginUnlockingTokens) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.LockId != 0 { - n += 1 + sovTx(uint64(m.LockId)) - } - l = m.Coin.Size() - n += 1 + l + sovTx(uint64(l)) - return n -} - -func (m *MsgBeginUnlockingTokensResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgLockTokens) 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 ErrIntOverflowTx - } - 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: MsgLockTokens: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgLockTokens: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgLockTokensResponse) 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 ErrIntOverflowTx - } - 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: MsgLockTokensResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgLockTokensResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgBeginUnlockingTokens) 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 ErrIntOverflowTx - } - 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: MsgBeginUnlockingTokens: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginUnlockingTokens: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LockId", wireType) - } - m.LockId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LockId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Coin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Coin.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgBeginUnlockingTokensResponse) 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 ErrIntOverflowTx - } - 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: MsgBeginUnlockingTokensResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgBeginUnlockingTokensResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrIntOverflowTx - } - 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, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/locking/types/types.go b/x/locking/types/types.go deleted file mode 100644 index ab1254f4c..000000000 --- a/x/locking/types/types.go +++ /dev/null @@ -1 +0,0 @@ -package types