Documentation ¶
Index ¶
- func CmpPubKeyToEVMAddress(cmpPubKey []byte) (common.Address, error)
- func CmpPubKeyToUncmpPubkey(compressedPubKeyBytes []byte) ([]byte, error)
- func IPTokenToBondCoin(amount *big.Int) (sdk.Coin, sdk.Coins)
- func Logger(ctx sdk.Context) log.Logger
- func UncmpPubKeyToCmpPubKey(uncmpPubKey []byte) ([]byte, error)
- type Keeper
- func (k Keeper) AddRewardWithdrawalToQueue(ctx context.Context, withdrawal types.Withdrawal) error
- func (k Keeper) AddWithdrawalToQueue(ctx context.Context, withdrawal types.Withdrawal) error
- func (k Keeper) DequeueEligibleRewardWithdrawals(ctx context.Context, maxDequeue uint32) (withdrawals etypes.Withdrawals, err error)
- func (k Keeper) DequeueEligibleWithdrawals(ctx context.Context, maxDequeue uint32) (withdrawals etypes.Withdrawals, err error)
- func (k *Keeper) EndBlock(ctx context.Context) (abci.ValidatorUpdates, error)
- func (k Keeper) EnqueueRewardWithdrawal(ctx context.Context, delAddrBech32, valAddrBech32 string, claimedReward uint64) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllWithdrawals(ctx context.Context) (withdrawals []types.Withdrawal, err error)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetMatureUnbondedDelegations(ctx context.Context) (matureUnbonds []stypes.DVPair, err error)
- func (k Keeper) GetOldValidatorSweepIndex(ctx context.Context) (nextValIndex uint64, err error)
- func (k Keeper) GetParams(ctx context.Context) (params types.Params, err error)
- func (k Keeper) GetValidatorSweepIndex(ctx context.Context) (types.ValidatorSweepIndex, error)
- func (k Keeper) GetWithdrawalQueue(ctx context.Context, request *types.QueryGetWithdrawalQueueRequest) (*types.QueryGetWithdrawalQueueResponse, error)
- func (k Keeper) GetWithdrawals(ctx context.Context, maxRetrieve uint32) (withdrawals []types.Withdrawal, err error)
- func (k Keeper) InitGenesis(ctx context.Context, gs *types.GenesisState) error
- func (k *Keeper) IsSingularity(ctx context.Context) (bool, error)
- func (k Keeper) MaxSweepPerBlock(ctx context.Context) (uint32, error)
- func (k Keeper) MaxWithdrawalPerBlock(ctx context.Context) (uint32, error)
- func (k Keeper) MinPartialWithdrawalAmount(ctx context.Context) (uint64, error)
- func (k Keeper) Params(ctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ParseCreateValidatorLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingCreateValidator, error)
- func (k Keeper) ParseDepositLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingDeposit, error)
- func (k Keeper) ParseRedelegateLog(ethLog ethtypes.Log) (*bindings.IPTokenStakingRedelegate, error)
- func (k Keeper) ParseUnjailLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingUnjail, error)
- func (k Keeper) ParseWithdrawLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingWithdraw, error)
- func (k Keeper) PeekEligibleRewardWithdrawals(ctx context.Context, maxPeek uint32) (withdrawals etypes.Withdrawals, err error)
- func (k Keeper) PeekEligibleWithdrawals(ctx context.Context, maxPeek uint32) (withdrawals etypes.Withdrawals, err error)
- func (k Keeper) ProcessAddOperator(ctx context.Context, ev *bindings.IPTokenStakingAddOperator) (err error)
- func (k Keeper) ProcessCreateValidator(ctx context.Context, ev *bindings.IPTokenStakingCreateValidator) (err error)
- func (k Keeper) ProcessDeposit(ctx context.Context, ev *bindings.IPTokenStakingDeposit) (err error)
- func (k Keeper) ProcessEligibleRewardWithdrawal(ctx context.Context, delegation stypes.Delegation, validator stypes.Validator, ...) error
- func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStakingRedelegate) (err error)
- func (k Keeper) ProcessRemoveOperator(ctx context.Context, ev *bindings.IPTokenStakingRemoveOperator) (err error)
- func (k Keeper) ProcessRewardWithdrawals(ctx context.Context) error
- func (k Keeper) ProcessSetRewardAddress(ctx context.Context, ev *bindings.IPTokenStakingSetRewardAddress) (err error)
- func (k Keeper) ProcessSetWithdrawalAddress(ctx context.Context, ev *bindings.IPTokenStakingSetWithdrawalAddress) (err error)
- func (k Keeper) ProcessStakingEvents(ctx context.Context, height uint64, logs []*evmenginetypes.EVMEvent) error
- func (k Keeper) ProcessUbiWithdrawal(ctx context.Context) error
- func (k Keeper) ProcessUnbondingWithdrawals(ctx context.Context, unbondedEntries []stypes.UnbondedEntry) error
- func (k Keeper) ProcessUnjail(ctx context.Context, ev *bindings.IPTokenStakingUnjail) (err error)
- func (k Keeper) ProcessUpdateValidatorCommission(ctx context.Context, ev *bindings.IPTokenStakingUpdateValidatorCommssion) (err error)
- func (k Keeper) ProcessWithdraw(ctx context.Context, ev *bindings.IPTokenStakingWithdraw) (err error)
- func (k Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k Keeper) SetValidatorSweepIndex(ctx context.Context, validatorSweepIndex types.ValidatorSweepIndex) error
- func (k Keeper) ValidateGenesis(gs *types.GenesisState) error
- func (k Keeper) ValidatorAddressCodec() addresscodec.Codec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CmpPubKeyToEVMAddress ¶ added in v0.12.0
func CmpPubKeyToUncmpPubkey ¶ added in v0.12.0
func IPTokenToBondCoin ¶
IPTokenToBondCoin converts the IP amount into a $STAKE coin. TODO: At this point, it is 1-to1, but this might change in the future. TODO: parameterized bondDenom.
func UncmpPubKeyToCmpPubKey ¶ added in v0.12.0
Types ¶
type Keeper ¶
type Keeper struct { WithdrawalQueue addcollections.Queue[types.Withdrawal] RewardWithdrawalQueue addcollections.Queue[types.Withdrawal] DelegatorWithdrawAddress collections.Map[string, string] DelegatorRewardAddress collections.Map[string, string] DelegatorOperatorAddress collections.Map[string, string] // contains filtered or unexported fields }
Keeper of the x/evmstaking store.
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, ak types.AccountKeeper, bk types.BankKeeper, slk types.SlashingKeeper, stk types.StakingKeeper, dk types.DistributionKeeper, authority string, ethCl ethclient.Client, validatorAddressCodec addresscodec.Codec, ) *Keeper
NewKeeper creates a new evmstaking Keeper instance.
func (Keeper) AddRewardWithdrawalToQueue ¶ added in v0.12.0
AddRewardWithdrawalToQueue inserts a reward withdrawal into the queue.
func (Keeper) AddWithdrawalToQueue ¶
AddWithdrawalToQueue inserts a withdrawal into the queue.
func (Keeper) DequeueEligibleRewardWithdrawals ¶ added in v0.12.0
func (Keeper) DequeueEligibleWithdrawals ¶
func (*Keeper) EndBlock ¶
Query staking module's UnbondingDelegation (UBD Queue) to get the matured unbonding delegations. Then, insert the matured unbonding delegations into the withdrawal queue. TODO: check if unbonded delegations in staking module must be distinguished based on source of generation, CL or EL.
func (Keeper) EnqueueRewardWithdrawal ¶ added in v0.13.0
func (k Keeper) EnqueueRewardWithdrawal(ctx context.Context, delAddrBech32, valAddrBech32 string, claimedReward uint64) error
EnqueueRewardWithdrawal enqueues the reward withdrawal to mint reward IP token on EL side.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
func (Keeper) GetAllWithdrawals ¶
GetAllWithdrawals gets the set of all withdrawals with no limits.
func (Keeper) GetAuthority ¶
GetAuthority returns the x/evmstaking module's authority.
func (Keeper) GetMatureUnbondedDelegations ¶
func (k Keeper) GetMatureUnbondedDelegations(ctx context.Context) (matureUnbonds []stypes.DVPair, err error)
Modified from https://github.com/cosmos/cosmos-sdk/blob/v0.50.7/x/staking/keeper/delegation.go#L521
func (Keeper) GetOldValidatorSweepIndex ¶ added in v0.10.0
func (Keeper) GetValidatorSweepIndex ¶ added in v0.10.0
func (Keeper) GetWithdrawalQueue ¶
func (k Keeper) GetWithdrawalQueue(ctx context.Context, request *types.QueryGetWithdrawalQueueRequest) (*types.QueryGetWithdrawalQueueResponse, error)
GetWithdrawalQueue returns the withdrawal queue in pagination. TODO: GetWithdrawalQueue tests.
func (Keeper) GetWithdrawals ¶
func (k Keeper) GetWithdrawals(ctx context.Context, maxRetrieve uint32) (withdrawals []types.Withdrawal, err error)
GetWithdrawals returns at max the requested amount of withdrawals.
func (Keeper) InitGenesis ¶
func (*Keeper) IsSingularity ¶ added in v0.12.0
func (Keeper) MaxSweepPerBlock ¶
func (Keeper) MaxWithdrawalPerBlock ¶
func (Keeper) MinPartialWithdrawalAmount ¶
func (Keeper) Params ¶
func (k Keeper) Params(ctx context.Context, request *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) ParseCreateValidatorLog ¶
func (Keeper) ParseDepositLog ¶
func (Keeper) ParseRedelegateLog ¶
func (Keeper) ParseUnjailLog ¶
func (Keeper) ParseWithdrawLog ¶
func (Keeper) PeekEligibleRewardWithdrawals ¶ added in v0.12.0
func (Keeper) PeekEligibleWithdrawals ¶
func (Keeper) ProcessAddOperator ¶ added in v0.12.0
func (Keeper) ProcessCreateValidator ¶
func (Keeper) ProcessDeposit ¶
func (Keeper) ProcessEligibleRewardWithdrawal ¶ added in v0.13.0
func (k Keeper) ProcessEligibleRewardWithdrawal(ctx context.Context, delegation stypes.Delegation, validator stypes.Validator, minRewardWithdrawalAmount uint64) error
ProcessEligibleRewardWithdrawal processes the reward withdrawal of delegation.
func (Keeper) ProcessRedelegate ¶
func (Keeper) ProcessRemoveOperator ¶ added in v0.12.0
func (Keeper) ProcessRewardWithdrawals ¶ added in v0.12.0
func (Keeper) ProcessSetRewardAddress ¶ added in v0.12.0
func (Keeper) ProcessSetWithdrawalAddress ¶
func (Keeper) ProcessStakingEvents ¶
func (Keeper) ProcessUbiWithdrawal ¶ added in v0.12.0
func (Keeper) ProcessUnbondingWithdrawals ¶ added in v0.12.0
func (Keeper) ProcessUnjail ¶
func (Keeper) ProcessUpdateValidatorCommission ¶ added in v0.12.0
func (Keeper) ProcessWithdraw ¶
func (Keeper) SetValidatorSweepIndex ¶ added in v0.10.0
func (Keeper) ValidateGenesis ¶
func (k Keeper) ValidateGenesis(gs *types.GenesisState) error
func (Keeper) ValidatorAddressCodec ¶
func (k Keeper) ValidatorAddressCodec() addresscodec.Codec
ValidatorAddressCodec returns the app validator address codec.