Documentation ¶
Index ¶
- func IPTokenToBondCoin(amount *big.Int) (sdk.Coin, sdk.Coins)
- func Logger(ctx sdk.Context) log.Logger
- func NewMsgServerImpl(keeper *Keeper) types.MsgServiceServer
- type Keeper
- func (k Keeper) AddWithdrawalToQueue(ctx context.Context, withdrawal types.Withdrawal) error
- func (k Keeper) DequeueEligibleWithdrawals(ctx context.Context) (withdrawals etypes.Withdrawals, err error)
- func (k *Keeper) EndBlock(ctx context.Context) (abci.ValidatorUpdates, error)
- func (k Keeper) EnqueueEligiblePartialWithdrawal(ctx context.Context, withdrawals []estypes.Withdrawal) error
- func (k Keeper) ExpectedPartialWithdrawals(ctx context.Context) ([]estypes.Withdrawal, 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) GetNextValidatorSweepIndex(ctx context.Context) (nextValIndex sdk.IntProto, err error)
- func (k Keeper) GetParams(ctx context.Context) (params types.Params, err 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) 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.IPTokenSlashingUnjail, error)
- func (k Keeper) ParseWithdrawLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingWithdraw, error)
- func (k Keeper) PeekEligibleWithdrawals(ctx context.Context) (withdrawals etypes.Withdrawals, err error)
- func (k Keeper) ProcessCreateValidator(ctx context.Context, ev *bindings.IPTokenStakingCreateValidator) error
- func (k Keeper) ProcessDeposit(ctx context.Context, ev *bindings.IPTokenStakingDeposit) error
- func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStakingRedelegate) error
- func (k Keeper) ProcessSetWithdrawalAddress(ctx context.Context, ev *bindings.IPTokenStakingSetWithdrawalAddress) error
- func (k Keeper) ProcessStakingEvents(ctx context.Context, height uint64, logs []*evmenginetypes.EVMEvent) error
- func (k Keeper) ProcessUnjail(ctx context.Context, ev *bindings.IPTokenSlashingUnjail) error
- func (k Keeper) ProcessWithdraw(ctx context.Context, ev *bindings.IPTokenStakingWithdraw) error
- func (k Keeper) SetNextValidatorSweepIndex(ctx context.Context, nextValIndex sdk.IntProto) error
- func (k Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k Keeper) ValidateGenesis(gs *types.GenesisState) error
- func (k Keeper) ValidatorAddressCodec() addresscodec.Codec
- type UnbondedEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 NewMsgServerImpl ¶
func NewMsgServerImpl(keeper *Keeper) types.MsgServiceServer
Types ¶
type Keeper ¶
type Keeper struct { WithdrawalQueue addcollections.Queue[types.Withdrawal] DelegatorMap collections.Map[string, string] // bech32 to evm address (TODO: confirm that it's one-to-one or many-bech32-to-one-evm) // 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) AddWithdrawalToQueue ¶
AddWithdrawalToQueue inserts a withdrawal into the queue.
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) EnqueueEligiblePartialWithdrawal ¶
func (Keeper) ExpectedPartialWithdrawals ¶
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) GetNextValidatorSweepIndex ¶
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) 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) PeekEligibleWithdrawals ¶
func (Keeper) ProcessCreateValidator ¶
func (Keeper) ProcessDeposit ¶
func (Keeper) ProcessRedelegate ¶
func (Keeper) ProcessSetWithdrawalAddress ¶
func (Keeper) ProcessStakingEvents ¶
func (k Keeper) ProcessStakingEvents(ctx context.Context, height uint64, logs []*evmenginetypes.EVMEvent) error
TODO: Return log event results to properly manage failures.
func (Keeper) ProcessUnjail ¶
func (Keeper) ProcessWithdraw ¶
func (Keeper) SetNextValidatorSweepIndex ¶
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.
type UnbondedEntry ¶
type UnbondedEntry struct {
// contains filtered or unexported fields
}