diff --git a/config.yml b/config.yml index ff29a44f0..81947b24d 100644 --- a/config.yml +++ b/config.yml @@ -263,8 +263,7 @@ genesis: vesting_infos: - base_denom: ueden vesting_denom: uelys - epoch_identifier: tenseconds - num_epochs: "100" + num_blocks: "100" vest_now_factor: "90" num_max_vestings: "10" commitments: diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 699e088ac..30e07c430 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -39275,9 +39275,7 @@ paths: type: string vesting_denom: type: string - epoch_identifier: - type: string - num_epochs: + num_blocks: type: string format: int64 vest_now_factor: @@ -39285,6 +39283,23 @@ paths: num_max_vestings: type: string format: int64 + total_committed: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the + custom method + + signatures required by gogoproto. description: >- QueryParamsResponse is response type for the Query/Params RPC method. @@ -39385,14 +39400,12 @@ paths: type: string total_amount: type: string - unvested_amount: - type: string - epoch_identifier: + claimed_amount: type: string - num_epochs: + num_blocks: type: string format: int64 - current_epoch: + start_block: type: string format: int64 vest_started_timestamp: @@ -84065,14 +84078,12 @@ definitions: type: string total_amount: type: string - unvested_amount: - type: string - epoch_identifier: + claimed_amount: type: string - num_epochs: + num_blocks: type: string format: int64 - current_epoch: + start_block: type: string format: int64 vest_started_timestamp: @@ -84162,6 +84173,8 @@ definitions: format: uint64 elys.commitment.MsgCancelVestResponse: type: object + elys.commitment.MsgClaimVestingResponse: + type: object elys.commitment.MsgCommitClaimedRewardsResponse: type: object elys.commitment.MsgCommitLiquidTokensResponse: @@ -84204,9 +84217,7 @@ definitions: type: string vesting_denom: type: string - epoch_identifier: - type: string - num_epochs: + num_blocks: type: string format: int64 vest_now_factor: @@ -84214,6 +84225,20 @@ definitions: num_max_vestings: type: string format: int64 + total_committed: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: |- + Coin defines a token with a denomination and an amount. + + NOTE: The amount field is an Int which implements the custom method + signatures required by gogoproto. description: Params defines the parameters for the module. elys.commitment.QueryParamsResponse: type: object @@ -84231,9 +84256,7 @@ definitions: type: string vesting_denom: type: string - epoch_identifier: - type: string - num_epochs: + num_blocks: type: string format: int64 vest_now_factor: @@ -84241,6 +84264,23 @@ definitions: num_max_vestings: type: string format: int64 + total_committed: + type: array + items: + type: object + properties: + denom: + type: string + amount: + type: string + description: >- + Coin defines a token with a denomination and an amount. + + + NOTE: The amount field is an Int which implements the custom + method + + signatures required by gogoproto. description: QueryParamsResponse is response type for the Query/Params RPC method. elys.commitment.QueryShowCommitmentsResponse: type: object @@ -84312,14 +84352,12 @@ definitions: type: string total_amount: type: string - unvested_amount: - type: string - epoch_identifier: + claimed_amount: type: string - num_epochs: + num_blocks: type: string format: int64 - current_epoch: + start_block: type: string format: int64 vest_started_timestamp: @@ -84401,9 +84439,7 @@ definitions: type: string vesting_denom: type: string - epoch_identifier: - type: string - num_epochs: + num_blocks: type: string format: int64 vest_now_factor: @@ -84418,14 +84454,12 @@ definitions: type: string total_amount: type: string - unvested_amount: + claimed_amount: type: string - epoch_identifier: - type: string - num_epochs: + num_blocks: type: string format: int64 - current_epoch: + start_block: type: string format: int64 vest_started_timestamp: diff --git a/proto/elys/commitment/commitments.proto b/proto/elys/commitment/commitments.proto index 4183058fc..53b97e803 100644 --- a/proto/elys/commitment/commitments.proto +++ b/proto/elys/commitment/commitments.proto @@ -72,6 +72,57 @@ message RewardsUnclaimed { } message VestingTokens { + string denom = 1; + string total_amount = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + string claimed_amount = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + int64 num_blocks = 5; + int64 start_block = 6; + int64 vest_started_timestamp = 7; +} + + +// GenesisState defines the commitment module's genesis state. +message LegacyCommitments { + string creator = 1; + repeated CommittedTokens committed_tokens = 2; + repeated cosmos.base.v1beta1.Coin rewards_unclaimed = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated cosmos.base.v1beta1.Coin claimed = 4 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + repeated LegacyVestingTokens vesting_tokens = 5; + + repeated cosmos.base.v1beta1.Coin rewards_by_elys_unclaimed = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + repeated cosmos.base.v1beta1.Coin rewards_by_eden_unclaimed = 7 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + repeated cosmos.base.v1beta1.Coin rewards_by_edenb_unclaimed = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + repeated cosmos.base.v1beta1.Coin rewards_by_usdc_unclaimed = 9 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; +} + +message LegacyVestingTokens { string denom = 1; string total_amount = 2 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", @@ -85,4 +136,23 @@ message VestingTokens { int64 num_epochs = 5; int64 current_epoch = 6; int64 vest_started_timestamp = 7; +} + +message LegacyVestingInfo { + string base_denom = 1; + string vesting_denom = 2; + string epoch_identifier = 3; + int64 num_epochs = 4; + string vest_now_factor = 5 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.nullable) = false + ]; + int64 num_max_vestings = 6; +} + +// Params defines the parameters for the module. +message LegacyParams { + option (gogoproto.goproto_stringer) = false; + + repeated LegacyVestingInfo vesting_infos = 1; } \ No newline at end of file diff --git a/proto/elys/commitment/params.proto b/proto/elys/commitment/params.proto index 3e6d72b40..5fc2acf63 100644 --- a/proto/elys/commitment/params.proto +++ b/proto/elys/commitment/params.proto @@ -2,6 +2,8 @@ syntax = "proto3"; package elys.commitment; import "gogoproto/gogo.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/elys-network/elys/x/commitment/types"; @@ -9,18 +11,21 @@ option go_package = "github.com/elys-network/elys/x/commitment/types"; message Params { option (gogoproto.goproto_stringer) = false; repeated VestingInfo vesting_infos = 1; + repeated cosmos.base.v1beta1.Coin total_committed = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } message VestingInfo { string base_denom = 1; string vesting_denom = 2; - string epoch_identifier = 3; - int64 num_epochs = 4; - string vest_now_factor = 5 [ + int64 num_blocks = 3; + string vest_now_factor = 4 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false ]; - int64 num_max_vestings = 6; + int64 num_max_vestings = 5; } enum EarnType { diff --git a/proto/elys/commitment/tx.proto b/proto/elys/commitment/tx.proto index 76aad91be..dc46c4f1b 100644 --- a/proto/elys/commitment/tx.proto +++ b/proto/elys/commitment/tx.proto @@ -8,7 +8,6 @@ option go_package = "github.com/elys-network/elys/x/commitment/types"; // Msg defines the Msg service. service Msg { - // CommitLiquidTokens commit the tokens from user's balance rpc CommitLiquidTokens (MsgCommitLiquidTokens) returns (MsgCommitLiquidTokensResponse); @@ -31,6 +30,9 @@ service Msg { // CancelVest cancel the user's vesting and the user reject to get vested tokens rpc CancelVest (MsgCancelVest) returns (MsgCancelVestResponse); + + // ClaimVesting claims already vested amount + rpc ClaimVesting (MsgClaimVesting) returns (MsgClaimVestingResponse); // UpdateVestingInfo add/update specific vesting info by denom on Params rpc UpdateVestingInfo (MsgUpdateVestingInfo) returns (MsgUpdateVestingInfoResponse); @@ -88,6 +90,12 @@ message MsgCancelVest { message MsgCancelVestResponse {} +message MsgClaimVesting { + string sender = 1; +} + +message MsgClaimVestingResponse {} + message MsgVestNow { string creator = 1; string amount = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; @@ -97,13 +105,12 @@ message MsgVestNow { message MsgVestNowResponse {} message MsgUpdateVestingInfo { - string authority = 1; + string authority = 1; string base_denom = 2; string vesting_denom = 3; - string epoch_identifier = 4; - int64 num_epochs = 5; - int64 vest_now_factor = 6; - int64 num_max_vestings = 7; + int64 num_blocks = 4; + int64 vest_now_factor = 5; + int64 num_max_vestings = 6; } message MsgUpdateVestingInfoResponse {} diff --git a/proto/elys/commitment/types_cw.proto b/proto/elys/commitment/types_cw.proto index 84dffa331..5d06c725d 100644 --- a/proto/elys/commitment/types_cw.proto +++ b/proto/elys/commitment/types_cw.proto @@ -221,13 +221,13 @@ message QueryVestingInfoRequest { message VestingDetail { string id = 1; // The total vest for the current vest - BalanceAvailable total_vest = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + BalanceAvailable total_vesting = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // The balance that's already vested - BalanceAvailable balance_vested = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // The remaining amount to vest - BalanceAvailable remaining_vest = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; - // Remaining time to vest. Javascript timestamp. - int64 remaining_time = 5; + BalanceAvailable claimed = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // The amount vested so far + BalanceAvailable vested_so_far = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; + // Remaining blocks + int64 remaining_blocks = 5; } message QueryVestingInfoResponse { diff --git a/scripts/upgrade-assure/update-genesis.go b/scripts/upgrade-assure/update-genesis.go index 1243f4d72..f6875866f 100644 --- a/scripts/upgrade-assure/update-genesis.go +++ b/scripts/upgrade-assure/update-genesis.go @@ -81,10 +81,6 @@ func updateGenesis(validatorBalance, homePath, genesisFilePath string) { genesis.AppState.Gov.DepositParams.MaxDepositPeriod = "10s" genesis.AppState.Gov.DepositParams.MinDeposit = sdk.Coins{sdk.NewInt64Coin("uelys", 10000000)} - // update commitment params - genesis.AppState.Commitment.Params.VestingInfos[0].NumMaxVestings = "1" - genesis.AppState.Commitment.Params.VestingInfos[0].EpochIdentifier = "week" - // update wasm params // genesis.AppState.Wasm.Params = wasmtypes.DefaultParams() genesis.AppState.Wasm = genesisInit.AppState.Wasm diff --git a/wasmbindings/client/register_custom_plugins.go b/wasmbindings/client/register_custom_plugins.go index 79db326b6..f448d5668 100644 --- a/wasmbindings/client/register_custom_plugins.go +++ b/wasmbindings/client/register_custom_plugins.go @@ -78,7 +78,7 @@ func RegisterCustomPlugins( clockQuerier := clockclientwasm.NewQuerier(clock) clockMessenger := clockclientwasm.NewMessenger(clock) - commitmentQuerier := commitmentclientwasm.NewQuerier(commitment, staking, epochs) + commitmentQuerier := commitmentclientwasm.NewQuerier(commitment, staking, epochs, amm, assetprofile) commitmentMessenger := commitmentclientwasm.NewMessenger(commitment, staking, assetprofile, stablestake, parameter) epochsQuerier := epochsclientwasm.NewQuerier(epochs) diff --git a/wasmbindings/types/types.go b/wasmbindings/types/types.go index 45760c3e3..b949701ff 100644 --- a/wasmbindings/types/types.go +++ b/wasmbindings/types/types.go @@ -258,6 +258,7 @@ type ElysMsg struct { CommitmentCommitLiquidTokens *commitmenttypes.MsgCommitLiquidTokens `json:"commitment_commit_liquid_tokens,omitempty"` CommitmentCommitUnclaimedRewards *commitmenttypes.MsgCommitClaimedRewards `json:"commitment_commit_unclaimed_rewards,omitempty"` CommitmentUncommitTokens *commitmenttypes.MsgUncommitTokens `json:"commitment_uncommit_tokens,omitempty"` + CommitmentClaimVesting *commitmenttypes.MsgClaimVesting `json:"commitment_claim_vesting,omitempty"` CommitmentVest *commitmenttypes.MsgVest `json:"commitment_vest"` CommitmentVestNow *commitmenttypes.MsgVestNow `json:"commitment_vest_now"` CommitmentVestLiquid *commitmenttypes.MsgVestLiquid `json:"commitment_vest_liquid"` diff --git a/x/amm/keeper/estimate_price.go b/x/amm/keeper/estimate_price.go new file mode 100644 index 000000000..2aa757227 --- /dev/null +++ b/x/amm/keeper/estimate_price.go @@ -0,0 +1,45 @@ +package keeper + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + ptypes "github.com/elys-network/elys/x/parameter/types" +) + +// Estimate the price : eg, 1 Eden -> x usdc +func (k Keeper) EstimatePrice(ctx sdk.Context, tokenInDenom, baseCurrency string) math.LegacyDec { + // Find a pool that can convert tokenIn to usdc + pool, found := k.GetBestPoolWithDenoms(ctx, []string{tokenInDenom, baseCurrency}) + if !found { + return sdk.ZeroDec() + } + + // Executes the swap in the pool and stores the output. Updates pool assets but + // does not actually transfer any tokens to or from the pool. + snapshot := k.GetPoolSnapshotOrSet(ctx, pool) + + rate, err := pool.GetTokenARate(ctx, k.oracleKeeper, &snapshot, tokenInDenom, baseCurrency, k.accountedPoolKeeper) + if err != nil { + return sdk.ZeroDec() + } + + return rate +} + +func (k Keeper) GetEdenDenomPrice(ctx sdk.Context, baseCurrency string) math.LegacyDec { + // Calc ueden / uusdc rate + edenUsdcRate := k.EstimatePrice(ctx, ptypes.Elys, baseCurrency) + if edenUsdcRate.IsZero() { + edenUsdcRate = sdk.OneDec() + } + usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + if usdcDenomPrice.IsZero() { + usdcDecimal := int64(6) + usdcEntry, found := k.assetProfileKeeper.GetEntry(ctx, ptypes.BaseCurrency) + if found { + usdcDecimal = int64(usdcEntry.Decimals) + } + usdcDenomPrice = sdk.NewDecWithPrec(1, usdcDecimal) + } + return edenUsdcRate.Mul(usdcDenomPrice) +} diff --git a/x/commitment/client/wasm/messenger.go b/x/commitment/client/wasm/messenger.go index d40c62555..ea4026253 100644 --- a/x/commitment/client/wasm/messenger.go +++ b/x/commitment/client/wasm/messenger.go @@ -37,6 +37,8 @@ func (m *Messenger) HandleMsg(ctx sdk.Context, contractAddr sdk.AccAddress, cont return m.msgCommitClaimedRewards(ctx, contractAddr, msg.CommitmentCommitUnclaimedRewards) case msg.CommitmentUncommitTokens != nil: return m.msgUncommitTokens(ctx, contractAddr, msg.CommitmentUncommitTokens) + case msg.CommitmentClaimVesting != nil: + return m.msgClaimVesting(ctx, contractAddr, msg.CommitmentClaimVesting) case msg.CommitmentVest != nil: return m.msgVest(ctx, contractAddr, msg.CommitmentVest) case msg.CommitmentVestNow != nil: diff --git a/x/commitment/client/wasm/msg_claim_vesting.go b/x/commitment/client/wasm/msg_claim_vesting.go new file mode 100644 index 000000000..2b3ad8e11 --- /dev/null +++ b/x/commitment/client/wasm/msg_claim_vesting.go @@ -0,0 +1,66 @@ +package wasm + +import ( + "encoding/json" + + errorsmod "cosmossdk.io/errors" + wasmvmtypes "github.com/CosmWasm/wasmvm/types" + sdk "github.com/cosmos/cosmos-sdk/types" + wasmbindingstypes "github.com/elys-network/elys/wasmbindings/types" + commitmentkeeper "github.com/elys-network/elys/x/commitment/keeper" + commitmenttypes "github.com/elys-network/elys/x/commitment/types" + paramtypes "github.com/elys-network/elys/x/parameter/types" +) + +func (m *Messenger) msgClaimVesting(ctx sdk.Context, contractAddr sdk.AccAddress, msgClaimVesting *commitmenttypes.MsgClaimVesting) ([]sdk.Event, [][]byte, error) { + if msgClaimVesting == nil { + return nil, nil, wasmvmtypes.InvalidRequest{Err: "ClaimVesting null msg"} + } + + brokerAddress := m.parameterKeeper.GetParams(ctx).BrokerAddress + if msgClaimVesting.Sender != contractAddr.String() && contractAddr.String() != brokerAddress { + return nil, nil, wasmvmtypes.InvalidRequest{Err: "vest wrong sender"} + } + + var res *wasmbindingstypes.RequestResponse + var err error + + res, err = performMsgClaimVesting(m.keeper, ctx, contractAddr, msgClaimVesting) + if err != nil { + return nil, nil, errorsmod.Wrap(err, "perform eden vest") + } + + responseBytes, err := json.Marshal(*res) + if err != nil { + return nil, nil, errorsmod.Wrap(err, "failed to serialize stake") + } + + resp := [][]byte{responseBytes} + + return nil, resp, nil +} + +func performMsgClaimVesting(f *commitmentkeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, msgClaimVesting *commitmenttypes.MsgClaimVesting) (*wasmbindingstypes.RequestResponse, error) { + if msgClaimVesting == nil { + return nil, wasmvmtypes.InvalidRequest{Err: "Invalid vesting parameter"} + } + + msgServer := commitmentkeeper.NewMsgServerImpl(*f) + msgMsgClaimVesting := commitmenttypes.NewMsgClaimVesting(msgClaimVesting.Sender) + + if err := msgMsgClaimVesting.ValidateBasic(); err != nil { + return nil, errorsmod.Wrap(err, "failed validating msgClaimVesting") + } + + _, err := msgServer.ClaimVesting(sdk.WrapSDKContext(ctx), msgMsgClaimVesting) // Discard the response because it's empty + if err != nil { + return nil, errorsmod.Wrap(err, "eden vesting msg") + } + + resp := &wasmbindingstypes.RequestResponse{ + Code: paramtypes.RES_OK, + Result: "Eden Vesting succeed!", + } + + return resp, nil +} diff --git a/x/commitment/client/wasm/querier.go b/x/commitment/client/wasm/querier.go index c3bc82bf1..f631c6e62 100644 --- a/x/commitment/client/wasm/querier.go +++ b/x/commitment/client/wasm/querier.go @@ -4,22 +4,34 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" wasmbindingstypes "github.com/elys-network/elys/wasmbindings/types" + ammkeeper "github.com/elys-network/elys/x/amm/keeper" + assetkeeper "github.com/elys-network/elys/x/assetprofile/keeper" "github.com/elys-network/elys/x/commitment/keeper" - epochKeeper "github.com/elys-network/elys/x/epochs/keeper" + epochkeeper "github.com/elys-network/elys/x/epochs/keeper" ) // Querier handles queries for the Commitment module. type Querier struct { keeper *keeper.Keeper stakingKeeper *stakingkeeper.Keeper - epochKeeper *epochKeeper.Keeper + epochKeeper *epochkeeper.Keeper + ammKeeper *ammkeeper.Keeper + assetKeeper *assetkeeper.Keeper } -func NewQuerier(keeper *keeper.Keeper, stakingKeeper *stakingkeeper.Keeper, epochKeeper *epochKeeper.Keeper) *Querier { +func NewQuerier( + keeper *keeper.Keeper, + stakingKeeper *stakingkeeper.Keeper, + epochKeeper *epochkeeper.Keeper, + ammKeeper *ammkeeper.Keeper, + assetKeeper *assetkeeper.Keeper, +) *Querier { return &Querier{ keeper: keeper, stakingKeeper: stakingKeeper, epochKeeper: epochKeeper, + ammKeeper: ammKeeper, + assetKeeper: assetKeeper, } } diff --git a/x/commitment/client/wasm/query_vesting_info.go b/x/commitment/client/wasm/query_vesting_info.go index feb275161..ec0c5c71d 100644 --- a/x/commitment/client/wasm/query_vesting_info.go +++ b/x/commitment/client/wasm/query_vesting_info.go @@ -6,7 +6,9 @@ import ( errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + assetprofiletypes "github.com/elys-network/elys/x/assetprofile/types" commitmenttypes "github.com/elys-network/elys/x/commitment/types" + ptypes "github.com/elys-network/elys/x/parameter/types" ) func (oq *Querier) queryVestingInfo(ctx sdk.Context, query *commitmenttypes.QueryVestingInfoRequest) ([]byte, error) { @@ -15,37 +17,36 @@ func (oq *Querier) queryVestingInfo(ctx sdk.Context, query *commitmenttypes.Quer commitment := oq.keeper.GetCommitments(ctx, addr) vestingTokens := commitment.GetVestingTokens() + entry, found := oq.assetKeeper.GetEntry(ctx, ptypes.BaseCurrency) + if !found { + return nil, errorsmod.Wrapf(assetprofiletypes.ErrAssetProfileNotFound, "asset %s not found", ptypes.BaseCurrency) + } + + baseCurrency := entry.Denom + edenDenomPrice := oq.ammKeeper.GetEdenDenomPrice(ctx, baseCurrency) + totalVesting := sdk.ZeroInt() vestingDetails := make([]commitmenttypes.VestingDetail, 0) for i, vesting := range vestingTokens { - vested := vesting.TotalAmount.Sub(vesting.UnvestedAmount) - epochInfo, found := oq.epochKeeper.GetEpochInfo(ctx, vesting.EpochIdentifier) - if !found { - continue - } - vestingDetail := commitmenttypes.VestingDetail{ Id: fmt.Sprintf("%d", i), - // The total vest for the current vest - TotalVest: commitmenttypes.BalanceAvailable{ + TotalVesting: commitmenttypes.BalanceAvailable{ Amount: vesting.TotalAmount, UsdAmount: sdk.NewDecFromInt(vesting.TotalAmount), }, - // The balance that's already vested - BalanceVested: commitmenttypes.BalanceAvailable{ - Amount: vested, - UsdAmount: sdk.NewDecFromInt(vested), + Claimed: commitmenttypes.BalanceAvailable{ + Amount: vesting.ClaimedAmount, + UsdAmount: edenDenomPrice.MulInt(vesting.ClaimedAmount), }, - // The remaining amount to vest - RemainingVest: commitmenttypes.BalanceAvailable{ - Amount: vesting.UnvestedAmount, - UsdAmount: sdk.NewDecFromInt(vesting.UnvestedAmount), + VestedSoFar: commitmenttypes.BalanceAvailable{ + Amount: vesting.VestedSoFar(ctx), + UsdAmount: edenDenomPrice.MulInt(vesting.VestedSoFar(ctx)), }, - RemainingTime: vesting.VestStartedTimestamp + vesting.NumEpochs*epochInfo.Duration.Milliseconds(), + RemainingBlocks: vesting.NumBlocks - (ctx.BlockHeight() - vesting.StartBlock), } vestingDetails = append(vestingDetails, vestingDetail) - totalVesting = totalVesting.Add(vesting.UnvestedAmount) + totalVesting = totalVesting.Add(vesting.TotalAmount.Sub(vesting.ClaimedAmount)) } res := commitmenttypes.QueryVestingInfoResponse{ diff --git a/x/commitment/keeper/commitments.go b/x/commitment/keeper/commitments.go index aec3d59b2..d3b95bf5d 100644 --- a/x/commitment/keeper/commitments.go +++ b/x/commitment/keeper/commitments.go @@ -34,6 +34,22 @@ func (k Keeper) GetAllCommitments(ctx sdk.Context) (list []*types.Commitments) { return } +// GetAllLegacyCommitments returns all legacy commitments +func (k Keeper) GetAllLegacyCommitments(ctx sdk.Context) (list []*types.LegacyCommitments) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.CommitmentsKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.LegacyCommitments + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, &val) + } + + return +} + // GetCommitments returns a commitments from its index func (k Keeper) GetCommitments(ctx sdk.Context, creator string) types.Commitments { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.CommitmentsKeyPrefix)) diff --git a/x/commitment/keeper/epoch_hooks.go b/x/commitment/keeper/epoch_hooks.go index 1d77a950d..dbc9bf4a9 100644 --- a/x/commitment/keeper/epoch_hooks.go +++ b/x/commitment/keeper/epoch_hooks.go @@ -3,27 +3,13 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" epochstypes "github.com/elys-network/elys/x/epochs/types" - ptypes "github.com/elys-network/elys/x/parameter/types" ) // BeforeEpochStart performs a no-op func (k Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ int64) {} // AfterEpochEnd distributes vested tokens at the end of each epoch -func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64) { - // Future Improvement: check all VestingInfos and get all VestingTokens by denom - // so we can iterate different denoms in different EpochIdentifiers - vestingInfo, _ := k.GetVestingInfo(ctx, ptypes.Eden) - if vestingInfo != nil { - if epochIdentifier == vestingInfo.EpochIdentifier { - k.Logger(ctx).Info("Vesting tokens for vestingInfo", vestingInfo) - if err := k.VestTokens(ctx, epochIdentifier); err != nil { - k.Logger(ctx).Error("Error vesting tokens", "vestingInfo", vestingInfo) - panic(err) - } - } - } -} +func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64) {} // ___________________________________________________________________________________________________ diff --git a/x/commitment/keeper/msg_server_cancel_vest.go b/x/commitment/keeper/msg_server_cancel_vest.go index 4a9532159..b28a416fb 100644 --- a/x/commitment/keeper/msg_server_cancel_vest.go +++ b/x/commitment/keeper/msg_server_cancel_vest.go @@ -7,12 +7,17 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/elys-network/elys/x/commitment/types" + ptypes "github.com/elys-network/elys/x/parameter/types" ) // CancelVest cancel the user's vesting and the user reject to get vested tokens func (k msgServer) CancelVest(goCtx context.Context, msg *types.MsgCancelVest) (*types.MsgCancelVestResponse, error) { ctx := sdk.UnwrapSDKContext(goCtx) + if msg.Denom != ptypes.Eden { + return nil, errorsmod.Wrapf(types.ErrInvalidDenom, "denom: %s", msg.Denom) + } + vestingInfo, _ := k.GetVestingInfo(ctx, msg.Denom) if vestingInfo == nil { return nil, errorsmod.Wrapf(types.ErrInvalidDenom, "denom: %s", msg.Denom) @@ -23,40 +28,25 @@ func (k msgServer) CancelVest(goCtx context.Context, msg *types.MsgCancelVest) ( remainingToCancel := msg.Amount - remainVestingTokens := make([]*types.VestingTokens, 0, len(commitments.VestingTokens)) - newVestingTokens := make([]*types.VestingTokens, 0, len(commitments.VestingTokens)) - for i := len(commitments.VestingTokens) - 1; i >= 0; i-- { vesting := commitments.VestingTokens[i] - cancelAmount := sdk.MinInt(remainingToCancel, vesting.UnvestedAmount) - if vesting.NumEpochs == 0 || vesting.TotalAmount.IsZero() { + if vesting.Denom != msg.Denom || vesting.NumBlocks == 0 || vesting.TotalAmount.IsZero() { continue } - amtPerEpoch := vesting.TotalAmount.Quo(sdk.NewInt(vesting.NumEpochs)) + cancelAmount := sdk.MinInt(remainingToCancel, vesting.TotalAmount.Sub(vesting.ClaimedAmount)) vesting.TotalAmount = vesting.TotalAmount.Sub(cancelAmount) - vesting.UnvestedAmount = vesting.UnvestedAmount.Sub(cancelAmount) - - if amtPerEpoch.IsZero() { - continue - } // Update the num epochs for the reduced amount - vesting.NumEpochs = vesting.TotalAmount.Quo(amtPerEpoch).Int64() - - if !vesting.TotalAmount.IsZero() { - remainVestingTokens = append(remainVestingTokens, vesting) - } + commitments.VestingTokens[i] = vesting remainingToCancel = remainingToCancel.Sub(cancelAmount) - if remainingToCancel.IsZero() { - newVestingTokens = append(newVestingTokens, commitments.VestingTokens[:i]...) - - break - } } - // Add the remaining vesting in reverse order. - for i := len(remainVestingTokens) - 1; i >= 0; i-- { - newVestingTokens = append(newVestingTokens, remainVestingTokens[i]) + newVestingTokens := []*types.VestingTokens{} + for _, vesting := range commitments.VestingTokens { + if vesting.ClaimedAmount.GTE(vesting.TotalAmount) { + continue + } + newVestingTokens = append(newVestingTokens, vesting) } commitments.VestingTokens = newVestingTokens diff --git a/x/commitment/keeper/msg_server_cancel_vest_test.go b/x/commitment/keeper/msg_server_cancel_vest_test.go index 51a7bf616..82201e316 100644 --- a/x/commitment/keeper/msg_server_cancel_vest_test.go +++ b/x/commitment/keeper/msg_server_cancel_vest_test.go @@ -9,7 +9,6 @@ import ( "github.com/elys-network/elys/app" commitmentkeeper "github.com/elys-network/elys/x/commitment/keeper" "github.com/elys-network/elys/x/commitment/types" - epochstypes "github.com/elys-network/elys/x/epochs/types" ptypes "github.com/elys-network/elys/x/parameter/types" "github.com/stretchr/testify/require" ) @@ -25,12 +24,11 @@ func TestCancelVest(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } @@ -59,12 +57,11 @@ func TestCancelVest(t *testing.T) { Creator: creator.String(), VestingTokens: []*types.VestingTokens{ { - Denom: ptypes.Eden, - TotalAmount: sdk.NewInt(100), - UnvestedAmount: sdk.NewInt(100), - EpochIdentifier: epochstypes.DayEpochID, - NumEpochs: 100, - CurrentEpoch: 0, + Denom: ptypes.Eden, + TotalAmount: sdk.NewInt(100), + ClaimedAmount: sdk.NewInt(1), + NumBlocks: 100, + StartBlock: 0, }, }, } @@ -78,12 +75,12 @@ func TestCancelVest(t *testing.T) { newCommitments := keeper.GetCommitments(ctx, cancelVestMsg.Creator) require.Len(t, newCommitments.VestingTokens, 1, "vesting tokens were not updated correctly") require.Equal(t, sdk.NewInt(75), newCommitments.VestingTokens[0].TotalAmount, "total amount was not updated correctly") - require.Equal(t, sdk.NewInt(75), newCommitments.VestingTokens[0].UnvestedAmount, "unvested amount was not updated correctly") + require.Equal(t, sdk.NewInt(1), newCommitments.VestingTokens[0].ClaimedAmount, "claimed amount was not updated correctly") // check if the unclaimed tokens were updated correctly require.Equal(t, sdk.NewInt(25), newCommitments.GetClaimedForDenom(ptypes.Eden)) // Try to cancel an amount that exceeds the unvested amount - cancelVestMsg.Amount = sdk.NewInt(101) + cancelVestMsg.Amount = sdk.NewInt(100) _, err = msgServer.CancelVest(ctx, cancelVestMsg) require.Error(t, err, "should throw an error when trying to cancel more tokens than available") require.True(t, types.ErrInsufficientVestingTokens.Is(err), "error should be insufficient vesting tokens") diff --git a/x/commitment/keeper/msg_server_claim_vesting.go b/x/commitment/keeper/msg_server_claim_vesting.go new file mode 100644 index 000000000..bb4b06117 --- /dev/null +++ b/x/commitment/keeper/msg_server_claim_vesting.go @@ -0,0 +1,46 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/elys-network/elys/x/commitment/types" +) + +// ClaimVesting claims already vested amount +func (k msgServer) ClaimVesting(goCtx context.Context, msg *types.MsgClaimVesting) (*types.MsgClaimVestingResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // Get the Commitments for the sender + commitments := k.GetCommitments(ctx, msg.Sender) + sender := sdk.MustAccAddressFromBech32(msg.Sender) + + newClaims := sdk.Coins{} + for i, vesting := range commitments.VestingTokens { + vestedSoFar := vesting.VestedSoFar(ctx) + newClaim := vestedSoFar.Sub(vesting.ClaimedAmount) + newClaims = newClaims.Add(sdk.NewCoin(vesting.Denom, newClaim)) + commitments.VestingTokens[i].ClaimedAmount = vestedSoFar + } + + if newClaims.IsAllPositive() { + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sender, newClaims) + if err != nil { + return nil, err + } + } + + k.SetCommitments(ctx, commitments) + + // Emit blockchain event + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeClaimVesting, + sdk.NewAttribute(types.AttributeCreator, msg.Sender), + sdk.NewAttribute(types.AttributeAmount, newClaims.String()), + ), + ) + + return &types.MsgClaimVestingResponse{}, nil +} diff --git a/x/commitment/keeper/msg_server_commit_claimed_rewards.go b/x/commitment/keeper/msg_server_commit_claimed_rewards.go index 7a553860d..09fe5fa6c 100644 --- a/x/commitment/keeper/msg_server_commit_claimed_rewards.go +++ b/x/commitment/keeper/msg_server_commit_claimed_rewards.go @@ -22,6 +22,10 @@ func (k msgServer) CommitClaimedRewards(goCtx context.Context, msg *types.MsgCom return nil, errorsmod.Wrapf(types.ErrCommitDisabled, "denom: %s", msg.Denom) } + params := k.GetParams(ctx) + params.TotalCommitted = params.TotalCommitted.Add(sdk.NewCoin(msg.Denom, msg.Amount)) + k.SetParams(ctx, params) + // Get the Commitments for the creator commitments := k.GetCommitments(ctx, msg.Creator) diff --git a/x/commitment/keeper/msg_server_commit_liquid_tokens.go b/x/commitment/keeper/msg_server_commit_liquid_tokens.go index 75762417e..3dc74cc44 100644 --- a/x/commitment/keeper/msg_server_commit_liquid_tokens.go +++ b/x/commitment/keeper/msg_server_commit_liquid_tokens.go @@ -37,6 +37,11 @@ func (k msgServer) CommitLiquidTokens(goCtx context.Context, msg *types.MsgCommi return nil, errorsmod.Wrap(sdkerrors.ErrInsufficientFunds, fmt.Sprintf("unable to send deposit tokens: %v", depositCoins)) } + // Update total commitment + params := k.GetParams(ctx) + params.TotalCommitted = params.TotalCommitted.Add(depositCoins...) + k.SetParams(ctx, params) + // Get the Commitments for the creator commitments := k.GetCommitments(ctx, msg.Creator) diff --git a/x/commitment/keeper/msg_server_uncommit_tokens.go b/x/commitment/keeper/msg_server_uncommit_tokens.go index 23405c590..0aec62eec 100644 --- a/x/commitment/keeper/msg_server_uncommit_tokens.go +++ b/x/commitment/keeper/msg_server_uncommit_tokens.go @@ -51,6 +51,11 @@ func (k msgServer) UncommitTokens(goCtx context.Context, msg *types.MsgUncommitT k.EdenUncommitted(ctx, msg.Creator, sdk.NewCoin(msg.Denom, msg.Amount)) } + // Update total commitment + params := k.GetParams(ctx) + params.TotalCommitted = params.TotalCommitted.Add(liquidCoins...) + k.SetParams(ctx, params) + // Emit blockchain event ctx.EventManager().EmitEvent( sdk.NewEvent( diff --git a/x/commitment/keeper/msg_server_update_vesting_info.go b/x/commitment/keeper/msg_server_update_vesting_info.go index a8acd7b40..3017d7f25 100644 --- a/x/commitment/keeper/msg_server_update_vesting_info.go +++ b/x/commitment/keeper/msg_server_update_vesting_info.go @@ -21,19 +21,17 @@ func (k msgServer) UpdateVestingInfo(goCtx context.Context, msg *types.MsgUpdate vestingInfo, index := k.GetVestingInfo(ctx, msg.BaseDenom) if vestingInfo == nil { vestingInfo = &types.VestingInfo{ - BaseDenom: msg.BaseDenom, - VestingDenom: msg.VestingDenom, - EpochIdentifier: msg.EpochIdentifier, - NumEpochs: msg.NumEpochs, - VestNowFactor: sdk.NewInt(msg.VestNowFactor), - NumMaxVestings: msg.NumMaxVestings, + BaseDenom: msg.BaseDenom, + VestingDenom: msg.VestingDenom, + NumBlocks: msg.NumBlocks, + VestNowFactor: sdk.NewInt(msg.VestNowFactor), + NumMaxVestings: msg.NumMaxVestings, } params.VestingInfos = append(params.VestingInfos, vestingInfo) } else { params.VestingInfos[index].BaseDenom = msg.BaseDenom params.VestingInfos[index].VestingDenom = msg.VestingDenom - params.VestingInfos[index].EpochIdentifier = msg.EpochIdentifier - params.VestingInfos[index].NumEpochs = msg.NumEpochs + params.VestingInfos[index].NumBlocks = msg.NumBlocks params.VestingInfos[index].VestNowFactor = sdk.NewInt(msg.VestNowFactor) params.VestingInfos[index].NumMaxVestings = msg.NumMaxVestings } diff --git a/x/commitment/keeper/msg_server_update_vesting_info_test.go b/x/commitment/keeper/msg_server_update_vesting_info_test.go index 95c0a56ec..80e4916df 100644 --- a/x/commitment/keeper/msg_server_update_vesting_info_test.go +++ b/x/commitment/keeper/msg_server_update_vesting_info_test.go @@ -29,13 +29,12 @@ func TestAddVestingInfo(t *testing.T) { // Call the Update Vesting Info function msg := types.MsgUpdateVestingInfo{ - Authority: signer, - BaseDenom: "test_denom", - VestingDenom: "test_denom", - EpochIdentifier: "day", - NumEpochs: 10, - VestNowFactor: 10, - NumMaxVestings: 10, + Authority: signer, + BaseDenom: "test_denom", + VestingDenom: "test_denom", + NumBlocks: 10, + VestNowFactor: 10, + NumMaxVestings: 10, } _, err := msgServer.UpdateVestingInfo(ctx, &msg) require.NoError(t, err) @@ -58,12 +57,11 @@ func TestUpdateVestingInfo(t *testing.T) { // Define the test data signer := govAddress.String() vestingInfo := &types.VestingInfo{ - BaseDenom: "test_denom", - VestingDenom: "test_denom", - EpochIdentifier: "month", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(10), - NumMaxVestings: 10, + BaseDenom: "test_denom", + VestingDenom: "test_denom", + NumBlocks: 10, + VestNowFactor: sdk.NewInt(10), + NumMaxVestings: 10, } params := keeper.GetParams(ctx) @@ -75,18 +73,13 @@ func TestUpdateVestingInfo(t *testing.T) { // Call the UpdateVestingInfo function msg := types.MsgUpdateVestingInfo{ - Authority: signer, - BaseDenom: "test_denom", - VestingDenom: "test_denom", - EpochIdentifier: "day", - NumEpochs: 10, - VestNowFactor: 10, - NumMaxVestings: 10, + Authority: signer, + BaseDenom: "test_denom", + VestingDenom: "test_denom", + NumBlocks: 10, + VestNowFactor: 10, + NumMaxVestings: 10, } _, err := msgServer.UpdateVestingInfo(ctx, &msg) require.NoError(t, err) - - // Check if the committed tokens have been added to the store - vestingInfo, _ = keeper.GetVestingInfo(ctx, "test_denom") - assert.Equal(t, vestingInfo.EpochIdentifier, "day", "Incorrect epoch identifier") } diff --git a/x/commitment/keeper/msg_server_vest.go b/x/commitment/keeper/msg_server_vest.go index 21b64deb9..c20f2c8fc 100644 --- a/x/commitment/keeper/msg_server_vest.go +++ b/x/commitment/keeper/msg_server_vest.go @@ -48,10 +48,8 @@ func (k Keeper) ProcessTokenVesting(ctx sdk.Context, denom string, amount math.I vestingTokens = append(vestingTokens, &types.VestingTokens{ Denom: vestingInfo.VestingDenom, TotalAmount: amount, - UnvestedAmount: amount, - EpochIdentifier: vestingInfo.EpochIdentifier, - NumEpochs: vestingInfo.NumEpochs, - CurrentEpoch: 0, + ClaimedAmount: sdk.ZeroInt(), + NumBlocks: vestingInfo.NumBlocks, VestStartedTimestamp: ctx.BlockTime().Unix(), }) commitments.VestingTokens = vestingTokens diff --git a/x/commitment/keeper/msg_server_vest_liquid_test.go b/x/commitment/keeper/msg_server_vest_liquid_test.go index 3b326f231..f734e2ea6 100644 --- a/x/commitment/keeper/msg_server_vest_liquid_test.go +++ b/x/commitment/keeper/msg_server_vest_liquid_test.go @@ -38,12 +38,11 @@ func TestLiquidVestWithExceed(t *testing.T) { msgServer := commitmentkeeper.NewMsgServerImpl(keeper) vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } diff --git a/x/commitment/keeper/msg_server_vest_now_test.go b/x/commitment/keeper/msg_server_vest_now_test.go index 741308b2c..5a914ecad 100644 --- a/x/commitment/keeper/msg_server_vest_now_test.go +++ b/x/commitment/keeper/msg_server_vest_now_test.go @@ -36,12 +36,11 @@ func TestVestNow(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } diff --git a/x/commitment/keeper/msg_server_vest_test.go b/x/commitment/keeper/msg_server_vest_test.go index b6222ffcf..73c3bfd20 100644 --- a/x/commitment/keeper/msg_server_vest_test.go +++ b/x/commitment/keeper/msg_server_vest_test.go @@ -33,12 +33,11 @@ func TestVest(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } @@ -113,12 +112,11 @@ func TestExceedVesting(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 1, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 1, }, } diff --git a/x/commitment/keeper/params.go b/x/commitment/keeper/params.go index 314ceb2ec..346292cfe 100644 --- a/x/commitment/keeper/params.go +++ b/x/commitment/keeper/params.go @@ -6,17 +6,37 @@ import ( ) // GetParams returns the current parameters of the Commitment module -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - var params types.Params +func (k Keeper) GetLegacyParams(ctx sdk.Context) types.LegacyParams { + var params types.LegacyParams k.paramstore.GetParamSet(ctx, ¶ms) return params } // SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { +func (k Keeper) SetLegacyParams(ctx sdk.Context, params types.LegacyParams) { k.paramstore.SetParamSet(ctx, ¶ms) } +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + + b := store.Get([]byte(types.ParamsKey)) + if b == nil { + return + } + + k.cdc.MustUnmarshal(b, ¶ms) + return +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + store := ctx.KVStore(k.storeKey) + b := k.cdc.MustMarshal(¶ms) + store.Set([]byte(types.ParamsKey), b) +} + // GetVestingDenom returns the vesting denom for the given base denom func (k Keeper) GetVestingInfo(ctx sdk.Context, baseDenom string) (*types.VestingInfo, int) { params := k.GetParams(ctx) diff --git a/x/commitment/keeper/params_test.go b/x/commitment/keeper/params_test.go index 616769840..52146d31e 100644 --- a/x/commitment/keeper/params_test.go +++ b/x/commitment/keeper/params_test.go @@ -22,12 +22,11 @@ func TestGetParams(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } @@ -44,17 +43,17 @@ func TestGetParams(t *testing.T) { func TestEncodeDecodeParams(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } params := types.Params{ - VestingInfos: vestingInfos, + VestingInfos: vestingInfos, + TotalCommitted: sdk.Coins{sdk.NewInt64Coin(ptypes.Eden, 10)}, } encoded, err := types.ModuleCdc.MarshalJSON(¶ms) @@ -77,12 +76,11 @@ func TestGetParamsNew(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } @@ -108,20 +106,18 @@ func TestGetVestingInfo(t *testing.T) { vestingInfos := []*types.VestingInfo{ { - BaseDenom: ptypes.Eden, - VestingDenom: ptypes.Elys, - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: ptypes.Eden, + VestingDenom: ptypes.Elys, + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, { - BaseDenom: "test", - VestingDenom: "test_vesting", - EpochIdentifier: "tenseconds", - NumEpochs: 10, - VestNowFactor: sdk.NewInt(90), - NumMaxVestings: 10, + BaseDenom: "test", + VestingDenom: "test_vesting", + NumBlocks: 10, + VestNowFactor: sdk.NewInt(90), + NumMaxVestings: 10, }, } diff --git a/x/commitment/keeper/vest.go b/x/commitment/keeper/vest.go deleted file mode 100644 index f31f34708..000000000 --- a/x/commitment/keeper/vest.go +++ /dev/null @@ -1,68 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/elys-network/elys/x/commitment/types" - ptypes "github.com/elys-network/elys/x/parameter/types" -) - -func (k Keeper) VestTokens(ctx sdk.Context, epochIdentifier string) error { - // Future Improvement: get all VestingTokens by denom and iterate - k.IterateCommitments(ctx, func(commitments types.Commitments) (stop bool) { - logger := k.Logger(ctx) - - newVestingTokens := make([]*types.VestingTokens, 0, len(commitments.VestingTokens)) - - for index := len(commitments.VestingTokens) - 1; index >= 0; index-- { - vesting := commitments.VestingTokens[index] - vesting.CurrentEpoch = vesting.CurrentEpoch + 1 - if vesting.NumEpochs == 0 || vesting.CurrentEpoch > vesting.NumEpochs || vesting.UnvestedAmount.IsZero() { - continue - } - - epochAmount := vesting.TotalAmount.Quo(sdk.NewInt(vesting.NumEpochs)) - - withdrawCoins := sdk.NewCoins(sdk.NewCoin(vesting.Denom, epochAmount)) - - // mint coins if vesting token is ELYS - if vesting.Denom == ptypes.Elys { - err := k.bankKeeper.MintCoins(ctx, types.ModuleName, withdrawCoins) - if err != nil { - logger.Debug( - "unable to mint vested tokens for ELYS token", - "vestingtokens", vesting, commitments.Creator, - ) - } - } - - // Send the coins to the user's account - err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.MustAccAddressFromBech32(commitments.Creator), withdrawCoins) - if err != nil { - logger.Debug( - "unable to send vested tokens", - "vestingtokens", vesting, commitments.Creator, - ) - } - - vesting.UnvestedAmount = vesting.UnvestedAmount.Sub(epochAmount) - } - - // Remove completed vesting items. - for index := 0; index < len(commitments.VestingTokens); index++ { - vesting := commitments.VestingTokens[index] - if vesting.CurrentEpoch >= vesting.NumEpochs || vesting.UnvestedAmount.IsZero() { - continue - } - - newVestingTokens = append(newVestingTokens, vesting) - } - - commitments.VestingTokens = newVestingTokens - // update commitments - k.SetCommitments(ctx, commitments) - return false - }) - - return nil -} diff --git a/x/commitment/migrations/v2_migration.go b/x/commitment/migrations/v2_migration.go index 066d40636..7b46d552b 100644 --- a/x/commitment/migrations/v2_migration.go +++ b/x/commitment/migrations/v2_migration.go @@ -10,7 +10,7 @@ func (m Migrator) V2Migration(ctx sdk.Context) error { if params.VestingInfos != nil { for _, vi := range params.VestingInfos { if vi != nil && vi.BaseDenom == ptypes.Eden { - vi.NumEpochs = 4320 // 10s * 4320 = 12 hrs + vi.NumBlocks = 4320 // 10s * 4320 = 12 hrs } } } diff --git a/x/commitment/migrations/v3_migration.go b/x/commitment/migrations/v3_migration.go new file mode 100644 index 000000000..f35600645 --- /dev/null +++ b/x/commitment/migrations/v3_migration.go @@ -0,0 +1,65 @@ +package migrations + +import ( + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/commitment/types" +) + +func (m Migrator) V3Migration(ctx sdk.Context) error { + legacyParams := m.keeper.GetLegacyParams(ctx) + + totalCommitted := sdk.Coins{} + legacyCommitments := m.keeper.GetAllLegacyCommitments(ctx) + for _, legacy := range legacyCommitments { + + vestingTokens := []*types.VestingTokens{} + for _, vt := range legacy.VestingTokens { + blockMultiplier := int64(17280) // "day" + if vt.EpochIdentifier == "tenseconds" { + blockMultiplier = int64(2) + } else { + blockMultiplier = int64(720) // "hour" + } + vestingTokens = append(vestingTokens, &types.VestingTokens{ + Denom: vt.Denom, + TotalAmount: vt.UnvestedAmount, + ClaimedAmount: math.ZeroInt(), + NumBlocks: vt.NumEpochs * blockMultiplier, + StartBlock: ctx.BlockHeight(), + VestStartedTimestamp: vt.VestStartedTimestamp, + }) + } + m.keeper.SetCommitments(ctx, types.Commitments{ + Creator: legacy.Creator, + CommittedTokens: legacy.CommittedTokens, + RewardsUnclaimed: legacy.RewardsUnclaimed, + Claimed: legacy.Claimed, + VestingTokens: vestingTokens, + RewardsByElysUnclaimed: legacy.RewardsByElysUnclaimed, + RewardsByEdenUnclaimed: legacy.RewardsByEdenUnclaimed, + RewardsByEdenbUnclaimed: legacy.RewardsByEdenbUnclaimed, + RewardsByUsdcUnclaimed: legacy.RewardsByUsdcUnclaimed, + }) + for _, token := range legacy.CommittedTokens { + totalCommitted = totalCommitted.Add(sdk.NewCoin(token.Denom, token.Amount)) + } + } + + vestingInfos := []*types.VestingInfo{} + for _, legacy := range legacyParams.VestingInfos { + vestingInfos = append(vestingInfos, &types.VestingInfo{ + BaseDenom: legacy.BaseDenom, + VestingDenom: legacy.VestingDenom, + NumBlocks: legacy.NumEpochs * 17280, + VestNowFactor: legacy.VestNowFactor, + NumMaxVestings: legacy.NumMaxVestings, + }) + } + + m.keeper.SetParams(ctx, types.Params{ + VestingInfos: vestingInfos, + TotalCommitted: totalCommitted, + }) + return nil +} diff --git a/x/commitment/module.go b/x/commitment/module.go index 0f49a72ed..0306370f4 100644 --- a/x/commitment/module.go +++ b/x/commitment/module.go @@ -117,7 +117,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) m := migrations.NewMigrator(am.keeper) - err := cfg.RegisterMigration(types.ModuleName, 1, m.V2Migration) + err := cfg.RegisterMigration(types.ModuleName, 2, m.V3Migration) if err != nil { panic(err) } @@ -144,7 +144,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock contains the logic that is automatically triggered at the beginning of each block func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} diff --git a/x/commitment/types/codec.go b/x/commitment/types/codec.go index 5c68ba32f..341616a0f 100644 --- a/x/commitment/types/codec.go +++ b/x/commitment/types/codec.go @@ -13,6 +13,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgClaimReward{}, "commitment/ClaimReward", nil) cdc.RegisterConcrete(&MsgCommitLiquidTokens{}, "commitment/CommitLiquidTokens", nil) cdc.RegisterConcrete(&MsgVest{}, "commitment/Vest", nil) + cdc.RegisterConcrete(&MsgClaimVesting{}, "commitment/ClaimVesting", nil) cdc.RegisterConcrete(&MsgCancelVest{}, "commitment/CancelVest", nil) cdc.RegisterConcrete(&MsgVestNow{}, "commitment/VestNow", nil) cdc.RegisterConcrete(&MsgUpdateVestingInfo{}, "commitment/UpdateVestingInfo", nil) @@ -26,36 +27,17 @@ func RegisterCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCommitClaimedRewards{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUncommitTokens{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgClaimReward{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgCommitLiquidTokens{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgVest{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgClaimVesting{}, &MsgCancelVest{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgVestNow{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateVestingInfo{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgVestLiquid{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgClaimRewards{}, &MsgStake{}, - ) - registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUnstake{}, ) // this line is used by starport scaffolding # 3 diff --git a/x/commitment/types/commitments.go b/x/commitment/types/commitments.go index d9e1daca8..0bb0031f7 100644 --- a/x/commitment/types/commitments.go +++ b/x/commitment/types/commitments.go @@ -328,3 +328,11 @@ func (c *Commitments) SubClaimed(amount sdk.Coin) error { c.Claimed = c.Claimed.Sub(amount) return nil } + +func (vesting *VestingTokens) VestedSoFar(ctx sdk.Context) math.Int { + totalBlocks := ctx.BlockHeight() - vesting.StartBlock + if totalBlocks > vesting.NumBlocks { + totalBlocks = vesting.NumBlocks + } + return vesting.TotalAmount.Mul(sdk.NewInt(totalBlocks)).Quo(sdk.NewInt(vesting.NumBlocks)) +} diff --git a/x/commitment/types/commitments.pb.go b/x/commitment/types/commitments.pb.go index b88a6cf69..bfc300c86 100644 --- a/x/commitment/types/commitments.pb.go +++ b/x/commitment/types/commitments.pb.go @@ -284,10 +284,9 @@ func (m *RewardsUnclaimed) GetDenom() string { type VestingTokens struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` TotalAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=total_amount,json=totalAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_amount"` - UnvestedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=unvested_amount,json=unvestedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"unvested_amount"` - EpochIdentifier string `protobuf:"bytes,4,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty"` - NumEpochs int64 `protobuf:"varint,5,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` - CurrentEpoch int64 `protobuf:"varint,6,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + ClaimedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=claimed_amount,json=claimedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"claimed_amount"` + NumBlocks int64 `protobuf:"varint,5,opt,name=num_blocks,json=numBlocks,proto3" json:"num_blocks,omitempty"` + StartBlock int64 `protobuf:"varint,6,opt,name=start_block,json=startBlock,proto3" json:"start_block,omitempty"` VestStartedTimestamp int64 `protobuf:"varint,7,opt,name=vest_started_timestamp,json=vestStartedTimestamp,proto3" json:"vest_started_timestamp,omitempty"` } @@ -331,91 +330,410 @@ func (m *VestingTokens) GetDenom() string { return "" } -func (m *VestingTokens) GetEpochIdentifier() string { +func (m *VestingTokens) GetNumBlocks() int64 { + if m != nil { + return m.NumBlocks + } + return 0 +} + +func (m *VestingTokens) GetStartBlock() int64 { + if m != nil { + return m.StartBlock + } + return 0 +} + +func (m *VestingTokens) GetVestStartedTimestamp() int64 { + if m != nil { + return m.VestStartedTimestamp + } + return 0 +} + +// GenesisState defines the commitment module's genesis state. +type LegacyCommitments struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + CommittedTokens []*CommittedTokens `protobuf:"bytes,2,rep,name=committed_tokens,json=committedTokens,proto3" json:"committed_tokens,omitempty"` + RewardsUnclaimed github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=rewards_unclaimed,json=rewardsUnclaimed,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards_unclaimed"` + Claimed github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=claimed,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"claimed"` + VestingTokens []*LegacyVestingTokens `protobuf:"bytes,5,rep,name=vesting_tokens,json=vestingTokens,proto3" json:"vesting_tokens,omitempty"` + RewardsByElysUnclaimed github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,6,rep,name=rewards_by_elys_unclaimed,json=rewardsByElysUnclaimed,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards_by_elys_unclaimed"` + RewardsByEdenUnclaimed github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=rewards_by_eden_unclaimed,json=rewardsByEdenUnclaimed,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards_by_eden_unclaimed"` + RewardsByEdenbUnclaimed github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=rewards_by_edenb_unclaimed,json=rewardsByEdenbUnclaimed,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards_by_edenb_unclaimed"` + RewardsByUsdcUnclaimed github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,9,rep,name=rewards_by_usdc_unclaimed,json=rewardsByUsdcUnclaimed,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"rewards_by_usdc_unclaimed"` +} + +func (m *LegacyCommitments) Reset() { *m = LegacyCommitments{} } +func (m *LegacyCommitments) String() string { return proto.CompactTextString(m) } +func (*LegacyCommitments) ProtoMessage() {} +func (*LegacyCommitments) Descriptor() ([]byte, []int) { + return fileDescriptor_47379c930fe66ed6, []int{5} +} +func (m *LegacyCommitments) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyCommitments) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyCommitments.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 *LegacyCommitments) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyCommitments.Merge(m, src) +} +func (m *LegacyCommitments) XXX_Size() int { + return m.Size() +} +func (m *LegacyCommitments) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyCommitments.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyCommitments proto.InternalMessageInfo + +func (m *LegacyCommitments) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *LegacyCommitments) GetCommittedTokens() []*CommittedTokens { + if m != nil { + return m.CommittedTokens + } + return nil +} + +func (m *LegacyCommitments) GetRewardsUnclaimed() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.RewardsUnclaimed + } + return nil +} + +func (m *LegacyCommitments) GetClaimed() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Claimed + } + return nil +} + +func (m *LegacyCommitments) GetVestingTokens() []*LegacyVestingTokens { + if m != nil { + return m.VestingTokens + } + return nil +} + +func (m *LegacyCommitments) GetRewardsByElysUnclaimed() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.RewardsByElysUnclaimed + } + return nil +} + +func (m *LegacyCommitments) GetRewardsByEdenUnclaimed() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.RewardsByEdenUnclaimed + } + return nil +} + +func (m *LegacyCommitments) GetRewardsByEdenbUnclaimed() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.RewardsByEdenbUnclaimed + } + return nil +} + +func (m *LegacyCommitments) GetRewardsByUsdcUnclaimed() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.RewardsByUsdcUnclaimed + } + return nil +} + +type LegacyVestingTokens struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` + TotalAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=total_amount,json=totalAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"total_amount"` + UnvestedAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=unvested_amount,json=unvestedAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"unvested_amount"` + EpochIdentifier string `protobuf:"bytes,4,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty"` + NumEpochs int64 `protobuf:"varint,5,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` + CurrentEpoch int64 `protobuf:"varint,6,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` + VestStartedTimestamp int64 `protobuf:"varint,7,opt,name=vest_started_timestamp,json=vestStartedTimestamp,proto3" json:"vest_started_timestamp,omitempty"` +} + +func (m *LegacyVestingTokens) Reset() { *m = LegacyVestingTokens{} } +func (m *LegacyVestingTokens) String() string { return proto.CompactTextString(m) } +func (*LegacyVestingTokens) ProtoMessage() {} +func (*LegacyVestingTokens) Descriptor() ([]byte, []int) { + return fileDescriptor_47379c930fe66ed6, []int{6} +} +func (m *LegacyVestingTokens) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyVestingTokens) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyVestingTokens.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 *LegacyVestingTokens) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyVestingTokens.Merge(m, src) +} +func (m *LegacyVestingTokens) XXX_Size() int { + return m.Size() +} +func (m *LegacyVestingTokens) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyVestingTokens.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyVestingTokens proto.InternalMessageInfo + +func (m *LegacyVestingTokens) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +func (m *LegacyVestingTokens) GetEpochIdentifier() string { if m != nil { return m.EpochIdentifier } return "" } -func (m *VestingTokens) GetNumEpochs() int64 { +func (m *LegacyVestingTokens) GetNumEpochs() int64 { if m != nil { return m.NumEpochs } return 0 } -func (m *VestingTokens) GetCurrentEpoch() int64 { +func (m *LegacyVestingTokens) GetCurrentEpoch() int64 { if m != nil { return m.CurrentEpoch } return 0 } -func (m *VestingTokens) GetVestStartedTimestamp() int64 { +func (m *LegacyVestingTokens) GetVestStartedTimestamp() int64 { if m != nil { return m.VestStartedTimestamp } return 0 } +type LegacyVestingInfo struct { + BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + VestingDenom string `protobuf:"bytes,2,opt,name=vesting_denom,json=vestingDenom,proto3" json:"vesting_denom,omitempty"` + EpochIdentifier string `protobuf:"bytes,3,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty"` + NumEpochs int64 `protobuf:"varint,4,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` + VestNowFactor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=vest_now_factor,json=vestNowFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"vest_now_factor"` + NumMaxVestings int64 `protobuf:"varint,6,opt,name=num_max_vestings,json=numMaxVestings,proto3" json:"num_max_vestings,omitempty"` +} + +func (m *LegacyVestingInfo) Reset() { *m = LegacyVestingInfo{} } +func (m *LegacyVestingInfo) String() string { return proto.CompactTextString(m) } +func (*LegacyVestingInfo) ProtoMessage() {} +func (*LegacyVestingInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_47379c930fe66ed6, []int{7} +} +func (m *LegacyVestingInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyVestingInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyVestingInfo.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 *LegacyVestingInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyVestingInfo.Merge(m, src) +} +func (m *LegacyVestingInfo) XXX_Size() int { + return m.Size() +} +func (m *LegacyVestingInfo) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyVestingInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyVestingInfo proto.InternalMessageInfo + +func (m *LegacyVestingInfo) GetBaseDenom() string { + if m != nil { + return m.BaseDenom + } + return "" +} + +func (m *LegacyVestingInfo) GetVestingDenom() string { + if m != nil { + return m.VestingDenom + } + return "" +} + +func (m *LegacyVestingInfo) GetEpochIdentifier() string { + if m != nil { + return m.EpochIdentifier + } + return "" +} + +func (m *LegacyVestingInfo) GetNumEpochs() int64 { + if m != nil { + return m.NumEpochs + } + return 0 +} + +func (m *LegacyVestingInfo) GetNumMaxVestings() int64 { + if m != nil { + return m.NumMaxVestings + } + return 0 +} + +// Params defines the parameters for the module. +type LegacyParams struct { + VestingInfos []*LegacyVestingInfo `protobuf:"bytes,1,rep,name=vesting_infos,json=vestingInfos,proto3" json:"vesting_infos,omitempty"` +} + +func (m *LegacyParams) Reset() { *m = LegacyParams{} } +func (*LegacyParams) ProtoMessage() {} +func (*LegacyParams) Descriptor() ([]byte, []int) { + return fileDescriptor_47379c930fe66ed6, []int{8} +} +func (m *LegacyParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LegacyParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LegacyParams.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 *LegacyParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_LegacyParams.Merge(m, src) +} +func (m *LegacyParams) XXX_Size() int { + return m.Size() +} +func (m *LegacyParams) XXX_DiscardUnknown() { + xxx_messageInfo_LegacyParams.DiscardUnknown(m) +} + +var xxx_messageInfo_LegacyParams proto.InternalMessageInfo + +func (m *LegacyParams) GetVestingInfos() []*LegacyVestingInfo { + if m != nil { + return m.VestingInfos + } + return nil +} + func init() { proto.RegisterType((*Commitments)(nil), "elys.commitment.Commitments") proto.RegisterType((*Lockup)(nil), "elys.commitment.Lockup") proto.RegisterType((*CommittedTokens)(nil), "elys.commitment.CommittedTokens") proto.RegisterType((*RewardsUnclaimed)(nil), "elys.commitment.RewardsUnclaimed") proto.RegisterType((*VestingTokens)(nil), "elys.commitment.VestingTokens") + proto.RegisterType((*LegacyCommitments)(nil), "elys.commitment.LegacyCommitments") + proto.RegisterType((*LegacyVestingTokens)(nil), "elys.commitment.LegacyVestingTokens") + proto.RegisterType((*LegacyVestingInfo)(nil), "elys.commitment.LegacyVestingInfo") + proto.RegisterType((*LegacyParams)(nil), "elys.commitment.LegacyParams") } func init() { proto.RegisterFile("elys/commitment/commitments.proto", fileDescriptor_47379c930fe66ed6) } var fileDescriptor_47379c930fe66ed6 = []byte{ - // 719 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4b, 0x4f, 0xdb, 0x4c, - 0x14, 0x8d, 0x93, 0x90, 0x7c, 0x0c, 0x8f, 0x04, 0x0b, 0x81, 0x41, 0x5f, 0x9d, 0x34, 0x95, 0xaa, - 0x74, 0x81, 0x5d, 0xda, 0x4a, 0x5d, 0x13, 0x44, 0x25, 0xd4, 0x6e, 0xea, 0x42, 0x2b, 0x75, 0x63, - 0xf9, 0x31, 0x04, 0x2b, 0x9e, 0x19, 0xcb, 0x33, 0x06, 0xa2, 0xee, 0xab, 0x2e, 0xfb, 0x33, 0xaa, - 0xfe, 0x8c, 0xae, 0x58, 0xb2, 0xac, 0xba, 0xa0, 0x15, 0xf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 0x13, - 0x29, 0x46, 0x83, 0x67, 0xcc, 0x4a, 0x90, 0x67, 0xe9, 0xcf, 0xc0, 0x52, 0x4e, 0xef, 0x52, 0xe6, - 0xa5, 0xfc, 0xe9, 0x99, 0x6c, 0xc8, 0x26, 0xcf, 0x5e, 0xcc, 0x57, 0xdf, 0x88, 0xc5, 0xc9, 0xae, - 0x1c, 0x6c, 0x1f, 0x9f, 0x99, 0xda, 0xc9, 0x99, 0xa9, 0xfd, 0x3a, 0x33, 0xb5, 0xcf, 0xe7, 0x66, - 0xe5, 0xe4, 0xdc, 0xac, 0x7c, 0x3f, 0x37, 0x2b, 0xef, 0xed, 0xc2, 0xd8, 0xf9, 0xb6, 0x59, 0xc3, - 0x90, 0x1d, 0x92, 0x74, 0xc4, 0x03, 0xfb, 0xa8, 0xf8, 0x78, 0x72, 0x0f, 0xfc, 0x06, 0x7f, 0x29, - 0x9f, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x13, 0xc3, 0xb1, 0xe9, 0x22, 0x08, 0x00, 0x00, + // 940 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xda, 0x8e, 0x4d, 0x5e, 0x3e, 0xec, 0x2c, 0x51, 0xeb, 0x44, 0x60, 0x07, 0x17, 0x21, + 0x73, 0xe8, 0x2e, 0x05, 0x24, 0x24, 0x6e, 0x75, 0x48, 0x51, 0xd4, 0x82, 0x60, 0x69, 0x8a, 0x84, + 0x84, 0x56, 0xb3, 0xbb, 0x63, 0x77, 0x65, 0xef, 0x8c, 0xb5, 0x33, 0x9b, 0xc4, 0xe2, 0x8e, 0x38, + 0x72, 0xe4, 0x88, 0xc4, 0x05, 0xf1, 0x67, 0x20, 0x21, 0xf5, 0x84, 0x7a, 0x44, 0x1c, 0x0a, 0x4a, + 0xfe, 0x0d, 0x0e, 0x68,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x7c, 0x4a, 0x0f, 0x1e, 0xc8, + 0x20, 0x76, 0x0f, 0x9a, 0x22, 0x6d, 0x82, 0x0e, 0x7d, 0x5d, 0x39, 0xd3, 0xcc, 0xae, 0x92, 0x2c, + 0xf9, 0x04, 0x1d, 0x6a, 0x4a, 0x58, 0xf7, 0x6b, 0x58, 0x56, 0x24, 0x7d, 0x26, 0xbf, 0xa2, 0xec, + 0x8f, 0xe7, 0x04, 0xc4, 0x64, 0x40, 0x59, 0xcb, 0x92, 0x0f, 0xa6, 0xfb, 0xdf, 0x32, 0x29, 0xa8, + 0x9d, 0x91, 0x24, 0x0c, 0xf6, 0x61, 0xf5, 0x87, 0x1f, 0x3b, 0xa5, 0xfe, 0xee, 0xb3, 0xa3, 0xb6, + 0xf5, 0xfc, 0xa8, 0x6d, 0xfd, 0x7d, 0xd4, 0xb6, 0xbe, 0x3f, 0x6e, 0x97, 0x9e, 0x1f, 0xb7, 0x4b, + 0x7f, 0x1c, 0xb7, 0x4b, 0x5f, 0xb9, 0xb9, 0xce, 0x44, 0xec, 0xbb, 0x04, 0xf3, 0x03, 0x9a, 0x8e, + 0xa4, 0xe1, 0x1e, 0xe6, 0x3f, 0xf0, 0x64, 0x9b, 0x41, 0x4d, 0x7e, 0xcd, 0xbd, 0xf7, 0x6f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xea, 0x49, 0x0b, 0x4e, 0xc6, 0x0e, 0x00, 0x00, } func (m *Commitments) Marshal() (dAtA []byte, err error) { @@ -717,27 +1035,20 @@ func (m *VestingTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x38 } - if m.CurrentEpoch != 0 { - i = encodeVarintCommitments(dAtA, i, uint64(m.CurrentEpoch)) + if m.StartBlock != 0 { + i = encodeVarintCommitments(dAtA, i, uint64(m.StartBlock)) i-- dAtA[i] = 0x30 } - if m.NumEpochs != 0 { - i = encodeVarintCommitments(dAtA, i, uint64(m.NumEpochs)) + if m.NumBlocks != 0 { + i = encodeVarintCommitments(dAtA, i, uint64(m.NumBlocks)) i-- dAtA[i] = 0x28 } - if len(m.EpochIdentifier) > 0 { - i -= len(m.EpochIdentifier) - copy(dAtA[i:], m.EpochIdentifier) - i = encodeVarintCommitments(dAtA, i, uint64(len(m.EpochIdentifier))) - i-- - dAtA[i] = 0x22 - } { - size := m.UnvestedAmount.Size() + size := m.ClaimedAmount.Size() i -= size - if _, err := m.UnvestedAmount.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.ClaimedAmount.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintCommitments(dAtA, i, uint64(size)) @@ -764,165 +1075,1541 @@ func (m *VestingTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func encodeVarintCommitments(dAtA []byte, offset int, v uint64) int { - offset -= sovCommitments(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *LegacyCommitments) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *Commitments) Size() (n int) { - if m == nil { - return 0 - } + +func (m *LegacyCommitments) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyCommitments) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Creator) - if l > 0 { - n += 1 + l + sovCommitments(uint64(l)) + if len(m.RewardsByUsdcUnclaimed) > 0 { + for iNdEx := len(m.RewardsByUsdcUnclaimed) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RewardsByUsdcUnclaimed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } } - if len(m.CommittedTokens) > 0 { - for _, e := range m.CommittedTokens { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + if len(m.RewardsByEdenbUnclaimed) > 0 { + for iNdEx := len(m.RewardsByEdenbUnclaimed) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RewardsByEdenbUnclaimed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 } } - if len(m.RewardsUnclaimed) > 0 { - for _, e := range m.RewardsUnclaimed { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + if len(m.RewardsByEdenUnclaimed) > 0 { + for iNdEx := len(m.RewardsByEdenUnclaimed) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RewardsByEdenUnclaimed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } } - if len(m.Claimed) > 0 { - for _, e := range m.Claimed { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + if len(m.RewardsByElysUnclaimed) > 0 { + for iNdEx := len(m.RewardsByElysUnclaimed) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RewardsByElysUnclaimed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } } if len(m.VestingTokens) > 0 { - for _, e := range m.VestingTokens { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + for iNdEx := len(m.VestingTokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VestingTokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a } } - if len(m.RewardsByElysUnclaimed) > 0 { - for _, e := range m.RewardsByElysUnclaimed { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + if len(m.Claimed) > 0 { + for iNdEx := len(m.Claimed) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Claimed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } } - if len(m.RewardsByEdenUnclaimed) > 0 { - for _, e := range m.RewardsByEdenUnclaimed { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + if len(m.RewardsUnclaimed) > 0 { + for iNdEx := len(m.RewardsUnclaimed) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RewardsUnclaimed[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a } } - if len(m.RewardsByEdenbUnclaimed) > 0 { - for _, e := range m.RewardsByEdenbUnclaimed { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + if len(m.CommittedTokens) > 0 { + for iNdEx := len(m.CommittedTokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CommittedTokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 } } - if len(m.RewardsByUsdcUnclaimed) > 0 { - for _, e := range m.RewardsByUsdcUnclaimed { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) - } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintCommitments(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil } -func (m *Lockup) Size() (n int) { - if m == nil { - return 0 +func (m *LegacyVestingTokens) 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 *LegacyVestingTokens) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyVestingTokens) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = m.Amount.Size() - n += 1 + l + sovCommitments(uint64(l)) - if m.UnlockTimestamp != 0 { - n += 1 + sovCommitments(uint64(m.UnlockTimestamp)) + if m.VestStartedTimestamp != 0 { + i = encodeVarintCommitments(dAtA, i, uint64(m.VestStartedTimestamp)) + i-- + dAtA[i] = 0x38 } - return n + if m.CurrentEpoch != 0 { + i = encodeVarintCommitments(dAtA, i, uint64(m.CurrentEpoch)) + i-- + dAtA[i] = 0x30 + } + if m.NumEpochs != 0 { + i = encodeVarintCommitments(dAtA, i, uint64(m.NumEpochs)) + i-- + dAtA[i] = 0x28 + } + if len(m.EpochIdentifier) > 0 { + i -= len(m.EpochIdentifier) + copy(dAtA[i:], m.EpochIdentifier) + i = encodeVarintCommitments(dAtA, i, uint64(len(m.EpochIdentifier))) + i-- + dAtA[i] = 0x22 + } + { + size := m.UnvestedAmount.Size() + i -= size + if _, err := m.UnvestedAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.TotalAmount.Size() + i -= size + if _, err := m.TotalAmount.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintCommitments(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *CommittedTokens) Size() (n int) { - if m == nil { - return 0 +func (m *LegacyVestingInfo) 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 *LegacyVestingInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyVestingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovCommitments(uint64(l)) + if m.NumMaxVestings != 0 { + i = encodeVarintCommitments(dAtA, i, uint64(m.NumMaxVestings)) + i-- + dAtA[i] = 0x30 } - l = m.Amount.Size() - n += 1 + l + sovCommitments(uint64(l)) - if len(m.Lockups) > 0 { - for _, e := range m.Lockups { - l = e.Size() - n += 1 + l + sovCommitments(uint64(l)) + { + size := m.VestNowFactor.Size() + i -= size + if _, err := m.VestNowFactor.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if m.NumEpochs != 0 { + i = encodeVarintCommitments(dAtA, i, uint64(m.NumEpochs)) + i-- + dAtA[i] = 0x20 + } + if len(m.EpochIdentifier) > 0 { + i -= len(m.EpochIdentifier) + copy(dAtA[i:], m.EpochIdentifier) + i = encodeVarintCommitments(dAtA, i, uint64(len(m.EpochIdentifier))) + i-- + dAtA[i] = 0x1a + } + if len(m.VestingDenom) > 0 { + i -= len(m.VestingDenom) + copy(dAtA[i:], m.VestingDenom) + i = encodeVarintCommitments(dAtA, i, uint64(len(m.VestingDenom))) + i-- + dAtA[i] = 0x12 + } + if len(m.BaseDenom) > 0 { + i -= len(m.BaseDenom) + copy(dAtA[i:], m.BaseDenom) + i = encodeVarintCommitments(dAtA, i, uint64(len(m.BaseDenom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LegacyParams) 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 *LegacyParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LegacyParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.VestingInfos) > 0 { + for iNdEx := len(m.VestingInfos) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VestingInfos[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintCommitments(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintCommitments(dAtA []byte, offset int, v uint64) int { + offset -= sovCommitments(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Commitments) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + if len(m.CommittedTokens) > 0 { + for _, e := range m.CommittedTokens { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsUnclaimed) > 0 { + for _, e := range m.RewardsUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.Claimed) > 0 { + for _, e := range m.Claimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.VestingTokens) > 0 { + for _, e := range m.VestingTokens { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByElysUnclaimed) > 0 { + for _, e := range m.RewardsByElysUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByEdenUnclaimed) > 0 { + for _, e := range m.RewardsByEdenUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByEdenbUnclaimed) > 0 { + for _, e := range m.RewardsByEdenbUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByUsdcUnclaimed) > 0 { + for _, e := range m.RewardsByUsdcUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + return n +} + +func (m *Lockup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovCommitments(uint64(l)) + if m.UnlockTimestamp != 0 { + n += 1 + sovCommitments(uint64(m.UnlockTimestamp)) + } + return n +} + +func (m *CommittedTokens) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovCommitments(uint64(l)) + if len(m.Lockups) > 0 { + for _, e := range m.Lockups { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + return n +} + +func (m *RewardsUnclaimed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + l = m.Amount.Size() + n += 1 + l + sovCommitments(uint64(l)) + return n +} + +func (m *VestingTokens) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + l = m.TotalAmount.Size() + n += 1 + l + sovCommitments(uint64(l)) + l = m.ClaimedAmount.Size() + n += 1 + l + sovCommitments(uint64(l)) + if m.NumBlocks != 0 { + n += 1 + sovCommitments(uint64(m.NumBlocks)) + } + if m.StartBlock != 0 { + n += 1 + sovCommitments(uint64(m.StartBlock)) + } + if m.VestStartedTimestamp != 0 { + n += 1 + sovCommitments(uint64(m.VestStartedTimestamp)) + } + return n +} + +func (m *LegacyCommitments) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + if len(m.CommittedTokens) > 0 { + for _, e := range m.CommittedTokens { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsUnclaimed) > 0 { + for _, e := range m.RewardsUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.Claimed) > 0 { + for _, e := range m.Claimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.VestingTokens) > 0 { + for _, e := range m.VestingTokens { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByElysUnclaimed) > 0 { + for _, e := range m.RewardsByElysUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByEdenUnclaimed) > 0 { + for _, e := range m.RewardsByEdenUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByEdenbUnclaimed) > 0 { + for _, e := range m.RewardsByEdenbUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + if len(m.RewardsByUsdcUnclaimed) > 0 { + for _, e := range m.RewardsByUsdcUnclaimed { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + return n +} + +func (m *LegacyVestingTokens) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + l = m.TotalAmount.Size() + n += 1 + l + sovCommitments(uint64(l)) + l = m.UnvestedAmount.Size() + n += 1 + l + sovCommitments(uint64(l)) + l = len(m.EpochIdentifier) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + if m.NumEpochs != 0 { + n += 1 + sovCommitments(uint64(m.NumEpochs)) + } + if m.CurrentEpoch != 0 { + n += 1 + sovCommitments(uint64(m.CurrentEpoch)) + } + if m.VestStartedTimestamp != 0 { + n += 1 + sovCommitments(uint64(m.VestStartedTimestamp)) + } + return n +} + +func (m *LegacyVestingInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BaseDenom) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + l = len(m.VestingDenom) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + l = len(m.EpochIdentifier) + if l > 0 { + n += 1 + l + sovCommitments(uint64(l)) + } + if m.NumEpochs != 0 { + n += 1 + sovCommitments(uint64(m.NumEpochs)) + } + l = m.VestNowFactor.Size() + n += 1 + l + sovCommitments(uint64(l)) + if m.NumMaxVestings != 0 { + n += 1 + sovCommitments(uint64(m.NumMaxVestings)) + } + return n +} + +func (m *LegacyParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.VestingInfos) > 0 { + for _, e := range m.VestingInfos { + l = e.Size() + n += 1 + l + sovCommitments(uint64(l)) + } + } + return n +} + +func sovCommitments(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozCommitments(x uint64) (n int) { + return sovCommitments(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Commitments) 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 ErrIntOverflowCommitments + } + 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: Commitments: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Commitments: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CommittedTokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CommittedTokens = append(m.CommittedTokens, &CommittedTokens{}) + if err := m.CommittedTokens[len(m.CommittedTokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardsUnclaimed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardsUnclaimed = append(m.RewardsUnclaimed, types.Coin{}) + if err := m.RewardsUnclaimed[len(m.RewardsUnclaimed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Claimed = append(m.Claimed, types.Coin{}) + if err := m.Claimed[len(m.Claimed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingTokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingTokens = append(m.VestingTokens, &VestingTokens{}) + if err := m.VestingTokens[len(m.VestingTokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardsByElysUnclaimed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardsByElysUnclaimed = append(m.RewardsByElysUnclaimed, types.Coin{}) + if err := m.RewardsByElysUnclaimed[len(m.RewardsByElysUnclaimed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardsByEdenUnclaimed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardsByEdenUnclaimed = append(m.RewardsByEdenUnclaimed, types.Coin{}) + if err := m.RewardsByEdenUnclaimed[len(m.RewardsByEdenUnclaimed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardsByEdenbUnclaimed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardsByEdenbUnclaimed = append(m.RewardsByEdenbUnclaimed, types.Coin{}) + if err := m.RewardsByEdenbUnclaimed[len(m.RewardsByEdenbUnclaimed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardsByUsdcUnclaimed", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardsByUsdcUnclaimed = append(m.RewardsByUsdcUnclaimed, types.Coin{}) + if err := m.RewardsByUsdcUnclaimed[len(m.RewardsByUsdcUnclaimed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommitments(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitments + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Lockup) 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 ErrIntOverflowCommitments + } + 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: Lockup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Lockup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnlockTimestamp", wireType) + } + m.UnlockTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnlockTimestamp |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCommitments(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitments + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CommittedTokens) 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 ErrIntOverflowCommitments + } + 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: CommittedTokens: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommittedTokens: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Lockups", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Lockups = append(m.Lockups, Lockup{}) + if err := m.Lockups[len(m.Lockups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommitments(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitments + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RewardsUnclaimed) 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 ErrIntOverflowCommitments + } + 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: RewardsUnclaimed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RewardsUnclaimed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCommitments(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitments + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *VestingTokens) 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 ErrIntOverflowCommitments + } + 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: VestingTokens: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VestingTokens: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.TotalAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClaimedAmount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + 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 ErrInvalidLengthCommitments + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ClaimedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocks", wireType) + } + m.NumBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumBlocks |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartBlock", wireType) + } + m.StartBlock = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartBlock |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VestStartedTimestamp", wireType) + } + m.VestStartedTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VestStartedTimestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipCommitments(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitments + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy } } - return n -} - -func (m *RewardsUnclaimed) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovCommitments(uint64(l)) - } - l = m.Amount.Size() - n += 1 + l + sovCommitments(uint64(l)) - return n -} -func (m *VestingTokens) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Denom) - if l > 0 { - n += 1 + l + sovCommitments(uint64(l)) - } - l = m.TotalAmount.Size() - n += 1 + l + sovCommitments(uint64(l)) - l = m.UnvestedAmount.Size() - n += 1 + l + sovCommitments(uint64(l)) - l = len(m.EpochIdentifier) - if l > 0 { - n += 1 + l + sovCommitments(uint64(l)) - } - if m.NumEpochs != 0 { - n += 1 + sovCommitments(uint64(m.NumEpochs)) - } - if m.CurrentEpoch != 0 { - n += 1 + sovCommitments(uint64(m.CurrentEpoch)) - } - if m.VestStartedTimestamp != 0 { - n += 1 + sovCommitments(uint64(m.VestStartedTimestamp)) + if iNdEx > l { + return io.ErrUnexpectedEOF } - return n -} - -func sovCommitments(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCommitments(x uint64) (n int) { - return sovCommitments(uint64((x << 1) ^ uint64((int64(x) >> 63)))) + return nil } -func (m *Commitments) Unmarshal(dAtA []byte) error { +func (m *LegacyCommitments) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -945,10 +2632,10 @@ func (m *Commitments) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Commitments: wiretype end group for non-group") + return fmt.Errorf("proto: LegacyCommitments: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Commitments: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LegacyCommitments: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1114,7 +2801,7 @@ func (m *Commitments) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.VestingTokens = append(m.VestingTokens, &VestingTokens{}) + m.VestingTokens = append(m.VestingTokens, &LegacyVestingTokens{}) if err := m.VestingTokens[len(m.VestingTokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1276,110 +2963,7 @@ func (m *Commitments) Unmarshal(dAtA []byte) error { } return nil } -func (m *Lockup) 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 ErrIntOverflowCommitments - } - 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: Lockup: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Lockup: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommitments - } - 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 ErrInvalidLengthCommitments - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommitments - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UnlockTimestamp", wireType) - } - m.UnlockTimestamp = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommitments - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.UnlockTimestamp |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipCommitments(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommitments - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *CommittedTokens) Unmarshal(dAtA []byte) error { +func (m *LegacyVestingTokens) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1402,10 +2986,10 @@ func (m *CommittedTokens) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CommittedTokens: wiretype end group for non-group") + return fmt.Errorf("proto: LegacyVestingTokens: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CommittedTokens: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LegacyVestingTokens: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1442,7 +3026,7 @@ func (m *CommittedTokens) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TotalAmount", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1470,15 +3054,15 @@ func (m *CommittedTokens) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TotalAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Lockups", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UnvestedAmount", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCommitments @@ -1488,79 +3072,29 @@ func (m *CommittedTokens) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthCommitments } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthCommitments } if postIndex > l { return io.ErrUnexpectedEOF } - m.Lockups = append(m.Lockups, Lockup{}) - if err := m.Lockups[len(m.Lockups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.UnvestedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCommitments(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCommitments - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RewardsUnclaimed) 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 ErrIntOverflowCommitments - } - 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: RewardsUnclaimed: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RewardsUnclaimed: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EpochIdentifier", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1588,13 +3122,13 @@ func (m *RewardsUnclaimed) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.EpochIdentifier = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) } - var stringLen uint64 + m.NumEpochs = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCommitments @@ -1604,26 +3138,49 @@ func (m *RewardsUnclaimed) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.NumEpochs |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthCommitments + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCommitments + m.CurrentEpoch = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CurrentEpoch |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - if postIndex > l { - return io.ErrUnexpectedEOF + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VestStartedTimestamp", wireType) } - if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.VestStartedTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VestStartedTimestamp |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCommitments(dAtA[iNdEx:]) @@ -1645,7 +3202,7 @@ func (m *RewardsUnclaimed) Unmarshal(dAtA []byte) error { } return nil } -func (m *VestingTokens) Unmarshal(dAtA []byte) error { +func (m *LegacyVestingInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1668,15 +3225,15 @@ func (m *VestingTokens) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: VestingTokens: wiretype end group for non-group") + return fmt.Errorf("proto: LegacyVestingInfo: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: VestingTokens: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: LegacyVestingInfo: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BaseDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1704,11 +3261,11 @@ func (m *VestingTokens) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + m.BaseDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VestingDenom", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1736,13 +3293,11 @@ func (m *VestingTokens) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.VestingDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field UnvestedAmount", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field EpochIdentifier", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1770,13 +3325,30 @@ func (m *VestingTokens) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.UnvestedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.EpochIdentifier = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + } + m.NumEpochs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCommitments + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumEpochs |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochIdentifier", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VestNowFactor", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1804,13 +3376,15 @@ func (m *VestingTokens) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.EpochIdentifier = string(dAtA[iNdEx:postIndex]) + if err := m.VestNowFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 5: + case 6: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumMaxVestings", wireType) } - m.NumEpochs = 0 + m.NumMaxVestings = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCommitments @@ -1820,35 +3394,66 @@ func (m *VestingTokens) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumEpochs |= int64(b&0x7F) << shift + m.NumMaxVestings |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentEpoch", wireType) + default: + iNdEx = preIndex + skippy, err := skipCommitments(dAtA[iNdEx:]) + if err != nil { + return err } - m.CurrentEpoch = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCommitments - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CurrentEpoch |= int64(b&0x7F) << shift - if b < 0x80 { - break - } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthCommitments } - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VestStartedTimestamp", wireType) + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF } - m.VestStartedTimestamp = 0 + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LegacyParams) 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 ErrIntOverflowCommitments + } + 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: LegacyParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LegacyParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VestingInfos", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCommitments @@ -1858,11 +3463,26 @@ func (m *VestingTokens) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VestStartedTimestamp |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthCommitments + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCommitments + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VestingInfos = append(m.VestingInfos, &LegacyVestingInfo{}) + if err := m.VestingInfos[len(m.VestingInfos)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCommitments(dAtA[iNdEx:]) diff --git a/x/commitment/types/events.go b/x/commitment/types/events.go index f3d10a70c..f42e1e450 100644 --- a/x/commitment/types/events.go +++ b/x/commitment/types/events.go @@ -3,6 +3,7 @@ package types // epochs events const ( EventTypeCommitmentChanged = "commitment_changed" + EventTypeClaimVesting = "claim_vesting" AttributeCreator = "creator" AttributeAmount = "token_amount" diff --git a/x/commitment/types/keys.go b/x/commitment/types/keys.go index 95ab10139..ae1bae7a2 100644 --- a/x/commitment/types/keys.go +++ b/x/commitment/types/keys.go @@ -12,6 +12,9 @@ const ( // MemStoreKey defines the in-memory store key MemStoreKey = "mem_commitment" + + // ParamsKey is the prefix to retrieve all Params + ParamsKey = "Params/value/" ) func KeyPrefix(p string) []byte { diff --git a/x/commitment/types/message_claim_vesting.go b/x/commitment/types/message_claim_vesting.go new file mode 100644 index 000000000..28f28abb3 --- /dev/null +++ b/x/commitment/types/message_claim_vesting.go @@ -0,0 +1,46 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgClaimVesting = "claim_vesting" + +var _ sdk.Msg = &MsgClaimVesting{} + +func NewMsgClaimVesting(sender string) *MsgClaimVesting { + return &MsgClaimVesting{ + Sender: sender, + } +} + +func (msg *MsgClaimVesting) Route() string { + return RouterKey +} + +func (msg *MsgClaimVesting) Type() string { + return TypeMsgClaimVesting +} + +func (msg *MsgClaimVesting) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgClaimVesting) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgClaimVesting) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address (%s)", err) + } + return nil +} diff --git a/x/commitment/types/message_update_vesting_info.go b/x/commitment/types/message_update_vesting_info.go index ffca26212..234051e7d 100644 --- a/x/commitment/types/message_update_vesting_info.go +++ b/x/commitment/types/message_update_vesting_info.go @@ -10,15 +10,14 @@ const TypeMsgUpdateVestingInfo = "update_vesting_info" var _ sdk.Msg = &MsgUpdateVestingInfo{} -func NewMsgUpdateVestingInfo(creator string, baseDenom string, vestingDenom string, epochIdentifier string, numEpochs int64, vestNowFactor int64, numMaxVestings int64) *MsgUpdateVestingInfo { +func NewMsgUpdateVestingInfo(creator string, baseDenom string, vestingDenom string, epochIdentifier string, numBlocks int64, vestNowFactor int64, numMaxVestings int64) *MsgUpdateVestingInfo { return &MsgUpdateVestingInfo{ - Authority: creator, - BaseDenom: baseDenom, - VestingDenom: vestingDenom, - EpochIdentifier: epochIdentifier, - NumEpochs: numEpochs, - VestNowFactor: vestNowFactor, - NumMaxVestings: numMaxVestings, + Authority: creator, + BaseDenom: baseDenom, + VestingDenom: vestingDenom, + NumBlocks: numBlocks, + VestNowFactor: vestNowFactor, + NumMaxVestings: numMaxVestings, } } diff --git a/x/commitment/types/params.go b/x/commitment/types/params.go index 1dbbdb670..7d22e6a34 100644 --- a/x/commitment/types/params.go +++ b/x/commitment/types/params.go @@ -3,38 +3,53 @@ package types import ( fmt "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) -var _ paramtypes.ParamSet = (*Params)(nil) +var _ paramtypes.ParamSet = (*LegacyParams)(nil) var KeyVestingInfos = []byte("VestingInfos") // ParamKeyTable the param key table for launch module func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) + return paramtypes.NewKeyTable().RegisterParamSet(&LegacyParams{}) } -// NewParams creates a new Params instance -func NewParams(vestingInfos []*VestingInfo) Params { - return Params{ +// NewLegacyParams creates a new LegacyParams instance +func NewLegacyParams(vestingInfos []*LegacyVestingInfo) LegacyParams { + return LegacyParams{ VestingInfos: vestingInfos, } } // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams(nil) + return Params{ + VestingInfos: nil, + TotalCommitted: sdk.Coins(nil), + } } // ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { +func (p *LegacyParams) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(KeyVestingInfos, &p.VestingInfos, validateVestingInfos), } } +// Validate validates the set of params +func (p LegacyParams) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p LegacyParams) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} + // Validate validates the set of params func (p Params) Validate() error { return nil @@ -71,12 +86,8 @@ func validateVestingInfo(info *VestingInfo) error { return fmt.Errorf("vesting_denom cannot be empty") } - if info.EpochIdentifier == "" { - return fmt.Errorf("epoch_identifier cannot be empty") - } - - if info.NumEpochs <= 0 { - return fmt.Errorf("num_epochs must be greater than zero") + if info.NumBlocks <= 0 { + return fmt.Errorf("num_blocks must be greater than zero") } if info.NumMaxVestings < 0 { diff --git a/x/commitment/types/params.pb.go b/x/commitment/types/params.pb.go index 33f3f04d4..d41f17029 100644 --- a/x/commitment/types/params.pb.go +++ b/x/commitment/types/params.pb.go @@ -5,7 +5,9 @@ package types import ( fmt "fmt" + _ "github.com/cosmos/cosmos-proto" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" io "io" @@ -63,7 +65,8 @@ func (EarnType) EnumDescriptor() ([]byte, []int) { // Params defines the parameters for the module. type Params struct { - VestingInfos []*VestingInfo `protobuf:"bytes,1,rep,name=vesting_infos,json=vestingInfos,proto3" json:"vesting_infos,omitempty"` + VestingInfos []*VestingInfo `protobuf:"bytes,1,rep,name=vesting_infos,json=vestingInfos,proto3" json:"vesting_infos,omitempty"` + TotalCommitted github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=total_committed,json=totalCommitted,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total_committed"` } func (m *Params) Reset() { *m = Params{} } @@ -105,13 +108,19 @@ func (m *Params) GetVestingInfos() []*VestingInfo { return nil } +func (m *Params) GetTotalCommitted() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.TotalCommitted + } + return nil +} + type VestingInfo struct { - BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` - VestingDenom string `protobuf:"bytes,2,opt,name=vesting_denom,json=vestingDenom,proto3" json:"vesting_denom,omitempty"` - EpochIdentifier string `protobuf:"bytes,3,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty"` - NumEpochs int64 `protobuf:"varint,4,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` - VestNowFactor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=vest_now_factor,json=vestNowFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"vest_now_factor"` - NumMaxVestings int64 `protobuf:"varint,6,opt,name=num_max_vestings,json=numMaxVestings,proto3" json:"num_max_vestings,omitempty"` + BaseDenom string `protobuf:"bytes,1,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + VestingDenom string `protobuf:"bytes,2,opt,name=vesting_denom,json=vestingDenom,proto3" json:"vesting_denom,omitempty"` + NumBlocks int64 `protobuf:"varint,3,opt,name=num_blocks,json=numBlocks,proto3" json:"num_blocks,omitempty"` + VestNowFactor github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=vest_now_factor,json=vestNowFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"vest_now_factor"` + NumMaxVestings int64 `protobuf:"varint,5,opt,name=num_max_vestings,json=numMaxVestings,proto3" json:"num_max_vestings,omitempty"` } func (m *VestingInfo) Reset() { *m = VestingInfo{} } @@ -161,16 +170,9 @@ func (m *VestingInfo) GetVestingDenom() string { return "" } -func (m *VestingInfo) GetEpochIdentifier() string { - if m != nil { - return m.EpochIdentifier - } - return "" -} - -func (m *VestingInfo) GetNumEpochs() int64 { +func (m *VestingInfo) GetNumBlocks() int64 { if m != nil { - return m.NumEpochs + return m.NumBlocks } return 0 } @@ -191,36 +193,39 @@ func init() { func init() { proto.RegisterFile("elys/commitment/params.proto", fileDescriptor_92e317feaf73ff7e) } var fileDescriptor_92e317feaf73ff7e = []byte{ - // 452 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0x41, 0x8f, 0xd2, 0x40, - 0x14, 0xc7, 0x3b, 0xc0, 0x12, 0x19, 0x76, 0x85, 0x9d, 0x68, 0xd2, 0x98, 0xb5, 0x90, 0x35, 0x31, - 0x68, 0xb2, 0x6d, 0xa2, 0x37, 0x6f, 0x20, 0xb8, 0x69, 0x02, 0x88, 0x5d, 0xdd, 0x44, 0x2f, 0x93, - 0x52, 0xa6, 0xdd, 0x66, 0x9d, 0x99, 0xa6, 0x33, 0x5d, 0x20, 0x7e, 0x09, 0x8f, 0x5e, 0x4c, 0xfc, - 0x38, 0x7b, 0xdc, 0xa3, 0xf1, 0x40, 0x0c, 0x7c, 0x11, 0x33, 0x53, 0x2c, 0x64, 0x4f, 0xed, 0xfc, - 0xde, 0xbf, 0xff, 0xff, 0xbc, 0xd7, 0x07, 0x4f, 0xc8, 0xd7, 0xa5, 0x70, 0x02, 0x4e, 0x69, 0x2c, - 0x29, 0x61, 0xd2, 0x49, 0xfc, 0xd4, 0xa7, 0xc2, 0x4e, 0x52, 0x2e, 0x39, 0x6a, 0xa8, 0xa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 0x26, 0x3d, 0x7d, 0xeb, 0x31, 0x9f, 0xbf, 0xd3, 0x26, 0xa8, 0x03, 0x9b, - 0x2a, 0x96, 0xfa, 0x0b, 0xbc, 0xbd, 0xb9, 0x30, 0xab, 0x3a, 0xfc, 0x21, 0xcb, 0xe8, 0xc8, 0x5f, - 0x6c, 0x47, 0x22, 0x5e, 0x7e, 0x83, 0x0f, 0x06, 0x7e, 0xca, 0x3e, 0x2e, 0x13, 0x82, 0x1a, 0xb0, - 0xde, 0x1d, 0x0e, 0xf1, 0xc4, 0x7b, 0x7f, 0xee, 0x75, 0x47, 0x4d, 0x03, 0x35, 0xe1, 0xe1, 0xa7, - 0x8b, 0xfe, 0xdb, 0x82, 0x00, 0x45, 0x06, 0xc3, 0xcf, 0x17, 0x05, 0x29, 0x69, 0xd2, 0x1f, 0x8c, - 0x0b, 0x52, 0x46, 0xc7, 0xf0, 0x48, 0x91, 0x5e, 0x81, 0x2a, 0xe8, 0x31, 0x3c, 0x1e, 0x4e, 0xf0, - 0xc8, 0x1d, 0xbb, 0xe3, 0xf3, 0x02, 0x1f, 0xf4, 0xdc, 0xdb, 0xb5, 0x05, 0xee, 0xd6, 0x16, 0xf8, - 0xbb, 0xb6, 0xc0, 0xf7, 0x8d, 0x65, 0xdc, 0x6d, 0x2c, 0xe3, 0xf7, 0xc6, 0x32, 0xbe, 0x38, 0x7b, - 0x7d, 0xab, 0x5f, 0x7e, 0xc6, 0x88, 0x9c, 0xf3, 0xf4, 0x5a, 0x1f, 0x9c, 0xc5, 0xfe, 0xa2, 0xe9, - 0x21, 0x4c, 0xab, 0x7a, 0x83, 0x5e, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xab, 0x59, 0xee, 0x78, - 0x88, 0x02, 0x00, 0x00, + // 506 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcd, 0x6e, 0xd3, 0x40, + 0x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 0x90, 0xbd, + 0x5b, 0x4e, 0x08, 0xca, 0xc3, 0x5c, 0xa5, 0xd5, 0xc2, 0x5d, 0xf7, 0xed, 0xa5, 0x5b, 0x69, 0x17, + 0x0c, 0x54, 0x80, 0x7b, 0xef, 0xaf, 0xea, 0xb5, 0x04, 0x01, 0x0a, 0x69, 0xb4, 0x3e, 0x5c, 0x25, + 0x48, 0x4a, 0x23, 0xf5, 0x46, 0x27, 0x41, 0xd2, 0xe8, 0x10, 0xee, 0x2b, 0xa4, 0x9a, 0x40, 0x19, + 0xf4, 0x04, 0x1e, 0xb6, 0xba, 0xb8, 0xdd, 0xec, 0x34, 0x3b, 0x97, 0x09, 0xbc, 0x53, 0x6d, 0xde, + 0xac, 0x2c, 0x70, 0xbb, 0xb2, 0xc0, 0x9f, 0x95, 0x05, 0xbe, 0xac, 0x2d, 0xe3, 0x76, 0x6d, 0x19, + 0x3f, 0xd7, 0x96, 0xf1, 0xd1, 0xd9, 0xea, 0xad, 0xae, 0xe7, 0x9c, 0x11, 0x39, 0xe7, 0xe1, 0x48, + 0x0f, 0xce, 0x62, 0xfb, 0xde, 0xf5, 0x4f, 0xe8, 0xed, 0xea, 0x6b, 0x7c, 0xf5, 0x2f, 0x00, 0x00, + 0xff, 0xff, 0x37, 0x4a, 0xd4, 0x4a, 0x0f, 0x03, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -243,6 +248,20 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.TotalCommitted) > 0 { + for iNdEx := len(m.TotalCommitted) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.TotalCommitted[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } if len(m.VestingInfos) > 0 { for iNdEx := len(m.VestingInfos) - 1; iNdEx >= 0; iNdEx-- { { @@ -283,7 +302,7 @@ func (m *VestingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.NumMaxVestings != 0 { i = encodeVarintParams(dAtA, i, uint64(m.NumMaxVestings)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x28 } { size := m.VestNowFactor.Size() @@ -294,18 +313,11 @@ func (m *VestingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintParams(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x2a - if m.NumEpochs != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.NumEpochs)) - i-- - dAtA[i] = 0x20 - } - if len(m.EpochIdentifier) > 0 { - i -= len(m.EpochIdentifier) - copy(dAtA[i:], m.EpochIdentifier) - i = encodeVarintParams(dAtA, i, uint64(len(m.EpochIdentifier))) + dAtA[i] = 0x22 + if m.NumBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.NumBlocks)) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x18 } if len(m.VestingDenom) > 0 { i -= len(m.VestingDenom) @@ -347,6 +359,12 @@ func (m *Params) Size() (n int) { n += 1 + l + sovParams(uint64(l)) } } + if len(m.TotalCommitted) > 0 { + for _, e := range m.TotalCommitted { + l = e.Size() + n += 1 + l + sovParams(uint64(l)) + } + } return n } @@ -364,12 +382,8 @@ func (m *VestingInfo) Size() (n int) { if l > 0 { n += 1 + l + sovParams(uint64(l)) } - l = len(m.EpochIdentifier) - if l > 0 { - n += 1 + l + sovParams(uint64(l)) - } - if m.NumEpochs != 0 { - n += 1 + sovParams(uint64(m.NumEpochs)) + if m.NumBlocks != 0 { + n += 1 + sovParams(uint64(m.NumBlocks)) } l = m.VestNowFactor.Size() n += 1 + l + sovParams(uint64(l)) @@ -448,6 +462,40 @@ func (m *Params) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TotalCommitted", 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 + } + m.TotalCommitted = append(m.TotalCommitted, types.Coin{}) + if err := m.TotalCommitted[len(m.TotalCommitted)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipParams(dAtA[iNdEx:]) @@ -563,42 +611,10 @@ func (m *VestingInfo) Unmarshal(dAtA []byte) error { m.VestingDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochIdentifier", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - 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 ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EpochIdentifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocks", wireType) } - m.NumEpochs = 0 + m.NumBlocks = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowParams @@ -608,12 +624,12 @@ func (m *VestingInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumEpochs |= int64(b&0x7F) << shift + m.NumBlocks |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field VestNowFactor", wireType) } @@ -647,7 +663,7 @@ func (m *VestingInfo) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NumMaxVestings", wireType) } diff --git a/x/commitment/types/query.pb.gw.go b/x/commitment/types/query.pb.gw.go index de5026737..228e19d02 100644 --- a/x/commitment/types/query.pb.gw.go +++ b/x/commitment/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryParamsRequest @@ -108,14 +106,12 @@ func local_request_Query_ShowCommitments_0(ctx context.Context, marshaler runtim // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) if err != nil { @@ -123,7 +119,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv 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) @@ -137,8 +132,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_ShowCommitments_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 { @@ -146,7 +139,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_ShowCommitments_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) diff --git a/x/commitment/types/tx.pb.go b/x/commitment/types/tx.pb.go index 2232d4bfa..f2e34c30b 100644 --- a/x/commitment/types/tx.pb.go +++ b/x/commitment/types/tx.pb.go @@ -571,6 +571,86 @@ func (m *MsgCancelVestResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgCancelVestResponse proto.InternalMessageInfo +type MsgClaimVesting struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` +} + +func (m *MsgClaimVesting) Reset() { *m = MsgClaimVesting{} } +func (m *MsgClaimVesting) String() string { return proto.CompactTextString(m) } +func (*MsgClaimVesting) ProtoMessage() {} +func (*MsgClaimVesting) Descriptor() ([]byte, []int) { + return fileDescriptor_eda78aafe7eb119c, []int{12} +} +func (m *MsgClaimVesting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimVesting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimVesting.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 *MsgClaimVesting) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimVesting.Merge(m, src) +} +func (m *MsgClaimVesting) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimVesting) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimVesting.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimVesting proto.InternalMessageInfo + +func (m *MsgClaimVesting) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +type MsgClaimVestingResponse struct { +} + +func (m *MsgClaimVestingResponse) Reset() { *m = MsgClaimVestingResponse{} } +func (m *MsgClaimVestingResponse) String() string { return proto.CompactTextString(m) } +func (*MsgClaimVestingResponse) ProtoMessage() {} +func (*MsgClaimVestingResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_eda78aafe7eb119c, []int{13} +} +func (m *MsgClaimVestingResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgClaimVestingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgClaimVestingResponse.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 *MsgClaimVestingResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgClaimVestingResponse.Merge(m, src) +} +func (m *MsgClaimVestingResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgClaimVestingResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgClaimVestingResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgClaimVestingResponse proto.InternalMessageInfo + type MsgVestNow struct { Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` Amount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=amount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"amount"` @@ -581,7 +661,7 @@ func (m *MsgVestNow) Reset() { *m = MsgVestNow{} } func (m *MsgVestNow) String() string { return proto.CompactTextString(m) } func (*MsgVestNow) ProtoMessage() {} func (*MsgVestNow) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{12} + return fileDescriptor_eda78aafe7eb119c, []int{14} } func (m *MsgVestNow) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -631,7 +711,7 @@ func (m *MsgVestNowResponse) Reset() { *m = MsgVestNowResponse{} } func (m *MsgVestNowResponse) String() string { return proto.CompactTextString(m) } func (*MsgVestNowResponse) ProtoMessage() {} func (*MsgVestNowResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{13} + return fileDescriptor_eda78aafe7eb119c, []int{15} } func (m *MsgVestNowResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -661,20 +741,19 @@ func (m *MsgVestNowResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgVestNowResponse proto.InternalMessageInfo type MsgUpdateVestingInfo struct { - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - BaseDenom string `protobuf:"bytes,2,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` - VestingDenom string `protobuf:"bytes,3,opt,name=vesting_denom,json=vestingDenom,proto3" json:"vesting_denom,omitempty"` - EpochIdentifier string `protobuf:"bytes,4,opt,name=epoch_identifier,json=epochIdentifier,proto3" json:"epoch_identifier,omitempty"` - NumEpochs int64 `protobuf:"varint,5,opt,name=num_epochs,json=numEpochs,proto3" json:"num_epochs,omitempty"` - VestNowFactor int64 `protobuf:"varint,6,opt,name=vest_now_factor,json=vestNowFactor,proto3" json:"vest_now_factor,omitempty"` - NumMaxVestings int64 `protobuf:"varint,7,opt,name=num_max_vestings,json=numMaxVestings,proto3" json:"num_max_vestings,omitempty"` + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + BaseDenom string `protobuf:"bytes,2,opt,name=base_denom,json=baseDenom,proto3" json:"base_denom,omitempty"` + VestingDenom string `protobuf:"bytes,3,opt,name=vesting_denom,json=vestingDenom,proto3" json:"vesting_denom,omitempty"` + NumBlocks int64 `protobuf:"varint,4,opt,name=num_blocks,json=numBlocks,proto3" json:"num_blocks,omitempty"` + VestNowFactor int64 `protobuf:"varint,5,opt,name=vest_now_factor,json=vestNowFactor,proto3" json:"vest_now_factor,omitempty"` + NumMaxVestings int64 `protobuf:"varint,6,opt,name=num_max_vestings,json=numMaxVestings,proto3" json:"num_max_vestings,omitempty"` } func (m *MsgUpdateVestingInfo) Reset() { *m = MsgUpdateVestingInfo{} } func (m *MsgUpdateVestingInfo) String() string { return proto.CompactTextString(m) } func (*MsgUpdateVestingInfo) ProtoMessage() {} func (*MsgUpdateVestingInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{14} + return fileDescriptor_eda78aafe7eb119c, []int{16} } func (m *MsgUpdateVestingInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -724,16 +803,9 @@ func (m *MsgUpdateVestingInfo) GetVestingDenom() string { return "" } -func (m *MsgUpdateVestingInfo) GetEpochIdentifier() string { - if m != nil { - return m.EpochIdentifier - } - return "" -} - -func (m *MsgUpdateVestingInfo) GetNumEpochs() int64 { +func (m *MsgUpdateVestingInfo) GetNumBlocks() int64 { if m != nil { - return m.NumEpochs + return m.NumBlocks } return 0 } @@ -759,7 +831,7 @@ func (m *MsgUpdateVestingInfoResponse) Reset() { *m = MsgUpdateVestingIn func (m *MsgUpdateVestingInfoResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateVestingInfoResponse) ProtoMessage() {} func (*MsgUpdateVestingInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{15} + return fileDescriptor_eda78aafe7eb119c, []int{17} } func (m *MsgUpdateVestingInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -798,7 +870,7 @@ func (m *MsgVestLiquid) Reset() { *m = MsgVestLiquid{} } func (m *MsgVestLiquid) String() string { return proto.CompactTextString(m) } func (*MsgVestLiquid) ProtoMessage() {} func (*MsgVestLiquid) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{16} + return fileDescriptor_eda78aafe7eb119c, []int{18} } func (m *MsgVestLiquid) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -848,7 +920,7 @@ func (m *MsgVestLiquidResponse) Reset() { *m = MsgVestLiquidResponse{} } func (m *MsgVestLiquidResponse) String() string { return proto.CompactTextString(m) } func (*MsgVestLiquidResponse) ProtoMessage() {} func (*MsgVestLiquidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{17} + return fileDescriptor_eda78aafe7eb119c, []int{19} } func (m *MsgVestLiquidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -885,7 +957,7 @@ func (m *MsgClaimRewards) Reset() { *m = MsgClaimRewards{} } func (m *MsgClaimRewards) String() string { return proto.CompactTextString(m) } func (*MsgClaimRewards) ProtoMessage() {} func (*MsgClaimRewards) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{18} + return fileDescriptor_eda78aafe7eb119c, []int{20} } func (m *MsgClaimRewards) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -928,7 +1000,7 @@ func (m *MsgClaimRewardsResponse) Reset() { *m = MsgClaimRewardsResponse func (m *MsgClaimRewardsResponse) String() string { return proto.CompactTextString(m) } func (*MsgClaimRewardsResponse) ProtoMessage() {} func (*MsgClaimRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{19} + return fileDescriptor_eda78aafe7eb119c, []int{21} } func (m *MsgClaimRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -968,7 +1040,7 @@ func (m *MsgStake) Reset() { *m = MsgStake{} } func (m *MsgStake) String() string { return proto.CompactTextString(m) } func (*MsgStake) ProtoMessage() {} func (*MsgStake) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{20} + return fileDescriptor_eda78aafe7eb119c, []int{22} } func (m *MsgStake) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1027,7 +1099,7 @@ func (m *MsgStakeResponse) Reset() { *m = MsgStakeResponse{} } func (m *MsgStakeResponse) String() string { return proto.CompactTextString(m) } func (*MsgStakeResponse) ProtoMessage() {} func (*MsgStakeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{21} + return fileDescriptor_eda78aafe7eb119c, []int{23} } func (m *MsgStakeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1081,7 +1153,7 @@ func (m *MsgUnstake) Reset() { *m = MsgUnstake{} } func (m *MsgUnstake) String() string { return proto.CompactTextString(m) } func (*MsgUnstake) ProtoMessage() {} func (*MsgUnstake) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{22} + return fileDescriptor_eda78aafe7eb119c, []int{24} } func (m *MsgUnstake) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1140,7 +1212,7 @@ func (m *MsgUnstakeResponse) Reset() { *m = MsgUnstakeResponse{} } func (m *MsgUnstakeResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnstakeResponse) ProtoMessage() {} func (*MsgUnstakeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_eda78aafe7eb119c, []int{23} + return fileDescriptor_eda78aafe7eb119c, []int{25} } func (m *MsgUnstakeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1196,6 +1268,8 @@ func init() { proto.RegisterType((*MsgVestResponse)(nil), "elys.commitment.MsgVestResponse") proto.RegisterType((*MsgCancelVest)(nil), "elys.commitment.MsgCancelVest") proto.RegisterType((*MsgCancelVestResponse)(nil), "elys.commitment.MsgCancelVestResponse") + proto.RegisterType((*MsgClaimVesting)(nil), "elys.commitment.MsgClaimVesting") + proto.RegisterType((*MsgClaimVestingResponse)(nil), "elys.commitment.MsgClaimVestingResponse") proto.RegisterType((*MsgVestNow)(nil), "elys.commitment.MsgVestNow") proto.RegisterType((*MsgVestNowResponse)(nil), "elys.commitment.MsgVestNowResponse") proto.RegisterType((*MsgUpdateVestingInfo)(nil), "elys.commitment.MsgUpdateVestingInfo") @@ -1213,62 +1287,62 @@ func init() { func init() { proto.RegisterFile("elys/commitment/tx.proto", fileDescriptor_eda78aafe7eb119c) } var fileDescriptor_eda78aafe7eb119c = []byte{ - // 867 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x97, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0xeb, 0x36, 0x6d, 0xc8, 0x13, 0xdb, 0x1f, 0xa3, 0xb0, 0xeb, 0xba, 0xbb, 0x6e, 0xd7, - 0x2b, 0xa2, 0xc0, 0xaa, 0x09, 0x82, 0x3b, 0x82, 0x2e, 0xbb, 0x52, 0x04, 0xe9, 0xc1, 0x6c, 0x39, - 0x70, 0x31, 0xae, 0x3d, 0x75, 0xad, 0xd8, 0x33, 0xc1, 0x33, 0xde, 0xa4, 0x47, 0x24, 0x10, 0x48, - 0x5c, 0x40, 0xe2, 0xef, 0x00, 0xf1, 0x5f, 0xec, 0x71, 0x8f, 0x88, 0x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9d, 0x3d, 0xea, 0xbd, 0xbc, 0xb4, 0x8d, 0x57, 0x97, 0xb6, 0xf1, 0xd7, 0xa5, 0x6d, 0xfc, 0x74, - 0x65, 0xaf, 0xbc, 0xba, 0xb2, 0x57, 0xfe, 0xb8, 0xb2, 0x57, 0xbe, 0xec, 0x96, 0xca, 0x8a, 0x08, - 0x74, 0x48, 0x30, 0x1f, 0xd1, 0x6c, 0x20, 0x07, 0xdd, 0xf1, 0xcc, 0x67, 0x8b, 0xa8, 0x31, 0xa7, - 0x1b, 0xf2, 0x9b, 0xe4, 0x83, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x2c, 0x1a, 0xf6, 0xc9, 0xd6, - 0x0c, 0x00, 0x00, + // 877 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x57, 0xcf, 0x6f, 0xdb, 0x36, + 0x14, 0x8e, 0x1a, 0x27, 0x99, 0x1f, 0xda, 0xfc, 0x20, 0xbc, 0x56, 0x51, 0x5a, 0x25, 0x55, 0x31, + 0xc3, 0x5b, 0x11, 0x7b, 0xd8, 0xee, 0xc3, 0xe6, 0x76, 0x05, 0x82, 0xcd, 0x39, 0x68, 0xcd, 0x0e, + 0xbd, 0x68, 0xb2, 0xc5, 0xaa, 0x82, 0x25, 0xd2, 0x13, 0xa9, 0xda, 0x39, 0x0e, 0x18, 0xb0, 0x01, + 0xbb, 0x6c, 0xff, 0xc8, 0x86, 0xfd, 0x17, 0x3d, 0xf6, 0x38, 0xec, 0x50, 0x6c, 0xc9, 0x69, 0xff, + 0xc5, 0x40, 0x52, 0xa2, 0x65, 0x47, 0x4e, 0x82, 0x1d, 0x66, 0xf4, 0x64, 0xf3, 0x7d, 0x1f, 0x3f, + 0x7e, 0x8f, 0x7a, 0xe4, 0x93, 0xc0, 0xc4, 0xf1, 0x29, 0xeb, 0x0c, 0x68, 0x92, 0x44, 0x3c, 0xc1, + 0x84, 0x77, 0xf8, 0xa4, 0x3d, 0x4a, 0x29, 0xa7, 0x68, 0x4b, 0x20, 0xed, 0x29, 0x62, 0x35, 0x42, + 0x1a, 0x52, 0x89, 0x75, 0xc4, 0x3f, 0x45, 0x73, 0x7e, 0x31, 0xe0, 0x4e, 0x8f, 0x85, 0x8f, 0x24, + 0xef, 0x51, 0xec, 0x47, 0x09, 0x0e, 0x5c, 0x3c, 0xf6, 0xd3, 0x80, 0x21, 0x13, 0x36, 0x06, 0x29, + 0xf6, 0x39, 0x4d, 0x4d, 0xe3, 0xc0, 0x68, 0xd5, 0xdd, 0x62, 0x88, 0x9e, 0xc0, 0xba, 0x9f, 0xd0, + 0x8c, 0x70, 0xf3, 0x86, 0x00, 0xba, 0xed, 0x57, 0x6f, 0xf6, 0x57, 0xfe, 0x7c, 0xb3, 0xdf, 0x0c, + 0x23, 0xfe, 0x22, 0xeb, 0x8b, 0x65, 0x3b, 0x03, 0xca, 0x12, 0xca, 0xf2, 0x9f, 0x43, 0x16, 0x0c, + 0x3b, 0xfc, 0x74, 0x84, 0x59, 0xfb, 0x88, 0x70, 0x37, 0x9f, 0x8d, 0x1a, 0xb0, 0x16, 0x60, 0x42, + 0x13, 0x73, 0x55, 0xea, 0xab, 0x81, 0x73, 0x1f, 0xf6, 0x17, 0x58, 0x72, 0x31, 0x1b, 0x51, 0xc2, + 0xb0, 0xf3, 0x93, 0x01, 0x3b, 0x3d, 0x16, 0x9e, 0x10, 0x95, 0xe0, 0x53, 0x3a, 0xc4, 0x64, 0x79, + 0x86, 0xf7, 0x60, 0xf7, 0x82, 0x19, 0x6d, 0xf5, 0x47, 0x03, 0x36, 0x45, 0x3a, 0x22, 0x11, 0x95, + 0xc6, 0xd2, 0x7c, 0x9a, 0x70, 0x7b, 0xd6, 0x89, 0x36, 0xf9, 0xab, 0x01, 0xef, 0xea, 0x3d, 0xff, + 0x32, 0xfa, 0x36, 0x8b, 0x82, 0xe5, 0xee, 0x29, 0xba, 0x07, 0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x04, 0xf3, 0x31, 0x4d, + 0x87, 0x72, 0xd0, 0x99, 0xcc, 0x7c, 0x2d, 0x89, 0xfb, 0xab, 0xbf, 0x2e, 0x3f, 0x85, 0x3e, 0xfe, + 0x37, 0x00, 0x00, 0xff, 0xff, 0x52, 0xfb, 0x05, 0x97, 0x4d, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1299,6 +1373,8 @@ type MsgClient interface { VestLiquid(ctx context.Context, in *MsgVestLiquid, opts ...grpc.CallOption) (*MsgVestLiquidResponse, error) // CancelVest cancel the user's vesting and the user reject to get vested tokens CancelVest(ctx context.Context, in *MsgCancelVest, opts ...grpc.CallOption) (*MsgCancelVestResponse, error) + // ClaimVesting claims already vested amount + ClaimVesting(ctx context.Context, in *MsgClaimVesting, opts ...grpc.CallOption) (*MsgClaimVestingResponse, error) // UpdateVestingInfo add/update specific vesting info by denom on Params UpdateVestingInfo(ctx context.Context, in *MsgUpdateVestingInfo, opts ...grpc.CallOption) (*MsgUpdateVestingInfoResponse, error) Stake(ctx context.Context, in *MsgStake, opts ...grpc.CallOption) (*MsgStakeResponse, error) @@ -1376,6 +1452,15 @@ func (c *msgClient) CancelVest(ctx context.Context, in *MsgCancelVest, opts ...g return out, nil } +func (c *msgClient) ClaimVesting(ctx context.Context, in *MsgClaimVesting, opts ...grpc.CallOption) (*MsgClaimVestingResponse, error) { + out := new(MsgClaimVestingResponse) + err := c.cc.Invoke(ctx, "/elys.commitment.Msg/ClaimVesting", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) UpdateVestingInfo(ctx context.Context, in *MsgUpdateVestingInfo, opts ...grpc.CallOption) (*MsgUpdateVestingInfoResponse, error) { out := new(MsgUpdateVestingInfoResponse) err := c.cc.Invoke(ctx, "/elys.commitment.Msg/UpdateVestingInfo", in, out, opts...) @@ -1421,6 +1506,8 @@ type MsgServer interface { VestLiquid(context.Context, *MsgVestLiquid) (*MsgVestLiquidResponse, error) // CancelVest cancel the user's vesting and the user reject to get vested tokens CancelVest(context.Context, *MsgCancelVest) (*MsgCancelVestResponse, error) + // ClaimVesting claims already vested amount + ClaimVesting(context.Context, *MsgClaimVesting) (*MsgClaimVestingResponse, error) // UpdateVestingInfo add/update specific vesting info by denom on Params UpdateVestingInfo(context.Context, *MsgUpdateVestingInfo) (*MsgUpdateVestingInfoResponse, error) Stake(context.Context, *MsgStake) (*MsgStakeResponse, error) @@ -1452,6 +1539,9 @@ func (*UnimplementedMsgServer) VestLiquid(ctx context.Context, req *MsgVestLiqui func (*UnimplementedMsgServer) CancelVest(ctx context.Context, req *MsgCancelVest) (*MsgCancelVestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelVest not implemented") } +func (*UnimplementedMsgServer) ClaimVesting(ctx context.Context, req *MsgClaimVesting) (*MsgClaimVestingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ClaimVesting not implemented") +} func (*UnimplementedMsgServer) UpdateVestingInfo(ctx context.Context, req *MsgUpdateVestingInfo) (*MsgUpdateVestingInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateVestingInfo not implemented") } @@ -1592,6 +1682,24 @@ func _Msg_CancelVest_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Msg_ClaimVesting_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClaimVesting) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ClaimVesting(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/elys.commitment.Msg/ClaimVesting", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ClaimVesting(ctx, req.(*MsgClaimVesting)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_UpdateVestingInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgUpdateVestingInfo) if err := dec(in); err != nil { @@ -1678,6 +1786,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CancelVest", Handler: _Msg_CancelVest_Handler, }, + { + MethodName: "ClaimVesting", + Handler: _Msg_ClaimVesting_Handler, + }, { MethodName: "UpdateVestingInfo", Handler: _Msg_UpdateVestingInfo_Handler, @@ -2120,6 +2232,59 @@ func (m *MsgCancelVestResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *MsgClaimVesting) 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 *MsgClaimVesting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimVesting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgClaimVestingResponse) 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 *MsgClaimVestingResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgClaimVestingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgVestNow) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2213,24 +2378,17 @@ func (m *MsgUpdateVestingInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.NumMaxVestings != 0 { i = encodeVarintTx(dAtA, i, uint64(m.NumMaxVestings)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } if m.VestNowFactor != 0 { i = encodeVarintTx(dAtA, i, uint64(m.VestNowFactor)) i-- - dAtA[i] = 0x30 - } - if m.NumEpochs != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.NumEpochs)) - i-- dAtA[i] = 0x28 } - if len(m.EpochIdentifier) > 0 { - i -= len(m.EpochIdentifier) - copy(dAtA[i:], m.EpochIdentifier) - i = encodeVarintTx(dAtA, i, uint64(len(m.EpochIdentifier))) + if m.NumBlocks != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NumBlocks)) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x20 } if len(m.VestingDenom) > 0 { i -= len(m.VestingDenom) @@ -2762,6 +2920,28 @@ func (m *MsgCancelVestResponse) Size() (n int) { return n } +func (m *MsgClaimVesting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgClaimVestingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgVestNow) Size() (n int) { if m == nil { return 0 @@ -2808,12 +2988,8 @@ func (m *MsgUpdateVestingInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.EpochIdentifier) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.NumEpochs != 0 { - n += 1 + sovTx(uint64(m.NumEpochs)) + if m.NumBlocks != 0 { + n += 1 + sovTx(uint64(m.NumBlocks)) } if m.VestNowFactor != 0 { n += 1 + sovTx(uint64(m.VestNowFactor)) @@ -4174,6 +4350,138 @@ func (m *MsgCancelVestResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgClaimVesting) 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: MsgClaimVesting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimVesting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", 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.Sender = string(dAtA[iNdEx:postIndex]) + 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 *MsgClaimVestingResponse) 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: MsgClaimVestingResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgClaimVestingResponse: 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 *MsgVestNow) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4498,42 +4806,10 @@ func (m *MsgUpdateVestingInfo) Unmarshal(dAtA []byte) error { m.VestingDenom = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EpochIdentifier", 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.EpochIdentifier = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumEpochs", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocks", wireType) } - m.NumEpochs = 0 + m.NumBlocks = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -4543,12 +4819,12 @@ func (m *MsgUpdateVestingInfo) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.NumEpochs |= int64(b&0x7F) << shift + m.NumBlocks |= int64(b&0x7F) << shift if b < 0x80 { break } } - case 6: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field VestNowFactor", wireType) } @@ -4567,7 +4843,7 @@ func (m *MsgUpdateVestingInfo) Unmarshal(dAtA []byte) error { break } } - case 7: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field NumMaxVestings", wireType) } diff --git a/x/commitment/types/types_cw.pb.go b/x/commitment/types/types_cw.pb.go index 368a26c3f..c31367078 100644 --- a/x/commitment/types/types_cw.pb.go +++ b/x/commitment/types/types_cw.pb.go @@ -1159,13 +1159,13 @@ func (m *QueryVestingInfoRequest) GetAddress() string { type VestingDetail struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // The total vest for the current vest - TotalVest BalanceAvailable `protobuf:"bytes,2,opt,name=total_vest,json=totalVest,proto3" json:"total_vest"` + TotalVesting BalanceAvailable `protobuf:"bytes,2,opt,name=total_vesting,json=totalVesting,proto3" json:"total_vesting"` // The balance that's already vested - BalanceVested BalanceAvailable `protobuf:"bytes,3,opt,name=balance_vested,json=balanceVested,proto3" json:"balance_vested"` - // The remaining amount to vest - RemainingVest BalanceAvailable `protobuf:"bytes,4,opt,name=remaining_vest,json=remainingVest,proto3" json:"remaining_vest"` - // Remaining time to vest. Javascript timestamp. - RemainingTime int64 `protobuf:"varint,5,opt,name=remaining_time,json=remainingTime,proto3" json:"remaining_time,omitempty"` + Claimed BalanceAvailable `protobuf:"bytes,3,opt,name=claimed,proto3" json:"claimed"` + // The amount vested so far + VestedSoFar BalanceAvailable `protobuf:"bytes,4,opt,name=vested_so_far,json=vestedSoFar,proto3" json:"vested_so_far"` + // Remaining blocks + RemainingBlocks int64 `protobuf:"varint,5,opt,name=remaining_blocks,json=remainingBlocks,proto3" json:"remaining_blocks,omitempty"` } func (m *VestingDetail) Reset() { *m = VestingDetail{} } @@ -1208,30 +1208,30 @@ func (m *VestingDetail) GetId() string { return "" } -func (m *VestingDetail) GetTotalVest() BalanceAvailable { +func (m *VestingDetail) GetTotalVesting() BalanceAvailable { if m != nil { - return m.TotalVest + return m.TotalVesting } return BalanceAvailable{} } -func (m *VestingDetail) GetBalanceVested() BalanceAvailable { +func (m *VestingDetail) GetClaimed() BalanceAvailable { if m != nil { - return m.BalanceVested + return m.Claimed } return BalanceAvailable{} } -func (m *VestingDetail) GetRemainingVest() BalanceAvailable { +func (m *VestingDetail) GetVestedSoFar() BalanceAvailable { if m != nil { - return m.RemainingVest + return m.VestedSoFar } return BalanceAvailable{} } -func (m *VestingDetail) GetRemainingTime() int64 { +func (m *VestingDetail) GetRemainingBlocks() int64 { if m != nil { - return m.RemainingTime + return m.RemainingBlocks } return 0 } @@ -1317,85 +1317,86 @@ func init() { func init() { proto.RegisterFile("elys/commitment/types_cw.proto", fileDescriptor_f36c2a6a76250be7) } var fileDescriptor_f36c2a6a76250be7 = []byte{ - // 1237 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcd, 0x4f, 0x24, 0x45, - 0x14, 0xa7, 0x87, 0x8f, 0x91, 0xc7, 0x32, 0x03, 0x0d, 0x71, 0x87, 0xdd, 0x75, 0x80, 0xf6, 0x8b, - 0xdd, 0x84, 0x99, 0x2c, 0x1c, 0xbc, 0x18, 0x13, 0x46, 0x30, 0x8b, 0x6b, 0x36, 0x6b, 0xc3, 0x92, - 0xf8, 0x91, 0xb4, 0x35, 0xd3, 0xe5, 0x50, 0x61, 0xba, 0x6a, 0xec, 0xaa, 0x1e, 0xc4, 0xab, 0x89, - 0x47, 0xf5, 0x0f, 0xf0, 0x0f, 0xf0, 0x68, 0xcc, 0xc6, 0x9b, 0x47, 0x93, 0x3d, 0x99, 0xcd, 0xc6, - 0x83, 0xf1, 0xb0, 0x1a, 0x38, 0x78,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x78, 0x78, 0x58, 0x35, 0x7e, 0x3b, - 0xac, 0x1a, 0x5f, 0x1e, 0x55, 0x87, 0x1e, 0x1e, 0x55, 0x87, 0x7e, 0x3e, 0xaa, 0x0e, 0xbd, 0x5b, - 0x4f, 0x8d, 0x65, 0x09, 0xbf, 0x4c, 0xb1, 0xd8, 0x67, 0xfe, 0x9e, 0x7a, 0xa9, 0x7f, 0x9c, 0xfb, - 0xa5, 0xa5, 0x39, 0xa6, 0x7e, 0xb1, 0x58, 0xfd, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x3a, 0xf4, 0x29, - 0x95, 0x89, 0x11, 0x00, 0x00, + // 1250 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0xda, 0x69, 0x4c, 0x9e, 0x1b, 0xdb, 0x9d, 0x46, 0xd4, 0xfd, 0xc0, 0x4d, 0x96, 0xaf, + 0xb6, 0x52, 0x6c, 0x35, 0x3d, 0x70, 0x41, 0x48, 0x31, 0x49, 0xd4, 0x00, 0xaa, 0xd2, 0x4d, 0x5a, + 0x89, 0x0f, 0x69, 0x19, 0x7b, 0xa7, 0xce, 0x28, 0xbb, 0x33, 0x66, 0x67, 0xd6, 0x21, 0x5c, 0x91, + 0x38, 0x02, 0x7f, 0x00, 0x7f, 0x00, 0x47, 0x84, 0x2a, 0xf8, 0x0b, 0x90, 0x7a, 0x42, 0x55, 0xc5, + 0x01, 0x71, 0x28, 0x28, 0x39, 0x70, 0x45, 0xe2, 0x8c, 0x84, 0x76, 0x76, 0xf6, 0xc3, 0xeb, 0x24, + 0x4d, 0x53, 0x0b, 0x81, 0xb8, 0x24, 0xbb, 0xf3, 0xe6, 0xfd, 0xde, 0x7b, 0xbf, 0xf7, 0x31, 0xb3, + 0x86, 0x06, 0x71, 0x77, 0x45, 0xab, 0xcb, 0x3d, 0x8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b5, 0xb0, + 0xac, 0x28, 0xeb, 0x25, 0xec, 0xfe, 0xaf, 0x79, 0x35, 0xbf, 0x35, 0xa0, 0x12, 0x35, 0xda, 0x3a, + 0x17, 0x54, 0x1d, 0x42, 0x79, 0x3e, 0xde, 0x82, 0xe9, 0x64, 0xc2, 0xe8, 0xcb, 0xd3, 0x28, 0xfb, + 0x79, 0x56, 0xb3, 0xec, 0xa7, 0xea, 0x99, 0x34, 0x16, 0x9f, 0x21, 0x8d, 0x3e, 0x5c, 0x54, 0x63, + 0x75, 0xd8, 0xf1, 0x64, 0xa2, 0x6e, 0x40, 0x35, 0xda, 0x68, 0xf7, 0xb5, 0x48, 0x8f, 0xd5, 0xcb, + 0x07, 0xba, 0x9d, 0x22, 0x64, 0x6d, 0x55, 0xc4, 0x90, 0xc8, 0xfc, 0xd5, 0x80, 0xda, 0x1d, 0x26, + 0xfe, 0x39, 0xaa, 0x5e, 0x86, 0x8a, 0x4f, 0x3c, 0x4c, 0x59, 0x58, 0x5b, 0xea, 0x86, 0x56, 0x54, + 0x97, 0x97, 0x99, 0x64, 0x55, 0x5d, 0xd0, 0x6e, 0xc2, 0x73, 0x81, 0x76, 0x4b, 0xd5, 0xde, 0xd3, + 0x72, 0x9a, 0x68, 0x9b, 0x9f, 0xc0, 0x0b, 0x8a, 0xd5, 0x7c, 0x94, 0x09, 0xaf, 0xef, 0xc2, 0x99, + 0x78, 0x73, 0x9e, 0xd9, 0xf9, 0x03, 0x8e, 0x63, 0x71, 0x28, 0xb7, 0xb5, 0x20, 0x27, 0x34, 0x3f, + 0x35, 0xe0, 0x52, 0x94, 0xd2, 0xa0, 0xd3, 0x0e, 0xba, 0xdb, 0x44, 0x6a, 0x9f, 0xe3, 0x03, 0xb9, + 0x9e, 0xfb, 0x60, 0x4b, 0x9b, 0x72, 0x16, 0x4e, 0x39, 0x84, 0x71, 0x4f, 0x37, 0x6b, 0xf4, 0x82, + 0x6e, 0x40, 0xa9, 0xef, 0xf3, 0x9e, 0x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 0x7b, 0xad, 0xcc, 0x40, 0x0e, + 0xe1, 0x17, 0x18, 0x91, 0x3b, 0xdc, 0xdf, 0x56, 0x2f, 0xad, 0x8f, 0x47, 0x7e, 0x63, 0xe9, 0x4c, + 0xa9, 0xdf, 0x2a, 0x6e, 0xfc, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x64, 0xc5, 0x3e, 0xd1, 0x83, 0x11, + 0x00, 0x00, } func (m *QueryBorrowAmountRequest) Marshal() (dAtA []byte, err error) { @@ -2337,13 +2338,13 @@ func (m *VestingDetail) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.RemainingTime != 0 { - i = encodeVarintTypesCw(dAtA, i, uint64(m.RemainingTime)) + if m.RemainingBlocks != 0 { + i = encodeVarintTypesCw(dAtA, i, uint64(m.RemainingBlocks)) i-- dAtA[i] = 0x28 } { - size, err := m.RemainingVest.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.VestedSoFar.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2353,7 +2354,7 @@ func (m *VestingDetail) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x22 { - size, err := m.BalanceVested.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Claimed.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2363,7 +2364,7 @@ func (m *VestingDetail) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1a { - size, err := m.TotalVest.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TotalVesting.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -2808,14 +2809,14 @@ func (m *VestingDetail) Size() (n int) { if l > 0 { n += 1 + l + sovTypesCw(uint64(l)) } - l = m.TotalVest.Size() + l = m.TotalVesting.Size() n += 1 + l + sovTypesCw(uint64(l)) - l = m.BalanceVested.Size() + l = m.Claimed.Size() n += 1 + l + sovTypesCw(uint64(l)) - l = m.RemainingVest.Size() + l = m.VestedSoFar.Size() n += 1 + l + sovTypesCw(uint64(l)) - if m.RemainingTime != 0 { - n += 1 + sovTypesCw(uint64(m.RemainingTime)) + if m.RemainingBlocks != 0 { + n += 1 + sovTypesCw(uint64(m.RemainingBlocks)) } return n } @@ -5502,7 +5503,7 @@ func (m *VestingDetail) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVest", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TotalVesting", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5529,13 +5530,13 @@ func (m *VestingDetail) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.TotalVest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TotalVesting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BalanceVested", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Claimed", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5562,13 +5563,13 @@ func (m *VestingDetail) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.BalanceVested.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Claimed.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RemainingVest", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VestedSoFar", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -5595,15 +5596,15 @@ func (m *VestingDetail) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RemainingVest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.VestedSoFar.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RemainingTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RemainingBlocks", wireType) } - m.RemainingTime = 0 + m.RemainingBlocks = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTypesCw @@ -5613,7 +5614,7 @@ func (m *VestingDetail) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RemainingTime |= int64(b&0x7F) << shift + m.RemainingBlocks |= int64(b&0x7F) << shift if b < 0x80 { break }