keeper

package
v0.9.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2024 License: GPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPTokenToBondCoin

func IPTokenToBondCoin(amount *big.Int) (sdk.Coin, sdk.Coins)

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 Logger

func Logger(ctx sdk.Context) log.Logger

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

func (k Keeper) AddWithdrawalToQueue(ctx context.Context, withdrawal types.Withdrawal) error

AddWithdrawalToQueue inserts a withdrawal into the queue.

func (Keeper) DequeueEligibleWithdrawals

func (k Keeper) DequeueEligibleWithdrawals(ctx context.Context) (withdrawals etypes.Withdrawals, err error)

func (*Keeper) EndBlock

func (k *Keeper) EndBlock(ctx context.Context) (abci.ValidatorUpdates, error)

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 (k Keeper) EnqueueEligiblePartialWithdrawal(ctx context.Context, withdrawals []estypes.Withdrawal) error

func (Keeper) ExpectedPartialWithdrawals

func (k Keeper) ExpectedPartialWithdrawals(ctx context.Context) ([]estypes.Withdrawal, error)

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

func (k Keeper) GetAllWithdrawals(ctx context.Context) (withdrawals []types.Withdrawal, err error)

GetAllWithdrawals gets the set of all withdrawals with no limits.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

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 (k Keeper) GetNextValidatorSweepIndex(ctx context.Context) (nextValIndex sdk.IntProto, err error)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (params types.Params, err error)

func (Keeper) GetWithdrawalQueue

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 (k Keeper) InitGenesis(ctx context.Context, gs *types.GenesisState) error

func (Keeper) MaxSweepPerBlock

func (k Keeper) MaxSweepPerBlock(ctx context.Context) (uint32, error)

func (Keeper) MaxWithdrawalPerBlock

func (k Keeper) MaxWithdrawalPerBlock(ctx context.Context) (uint32, error)

func (Keeper) MinPartialWithdrawalAmount

func (k Keeper) MinPartialWithdrawalAmount(ctx context.Context) (uint64, error)

func (Keeper) Params

func (Keeper) ParseCreateValidatorLog

func (k Keeper) ParseCreateValidatorLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingCreateValidator, error)

func (Keeper) ParseDepositLog

func (k Keeper) ParseDepositLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingDeposit, error)

func (Keeper) ParseRedelegateLog

func (k Keeper) ParseRedelegateLog(ethLog ethtypes.Log) (*bindings.IPTokenStakingRedelegate, error)

func (Keeper) ParseUnjailLog

func (k Keeper) ParseUnjailLog(ethlog ethtypes.Log) (*bindings.IPTokenSlashingUnjail, error)

func (Keeper) ParseWithdrawLog

func (k Keeper) ParseWithdrawLog(ethlog ethtypes.Log) (*bindings.IPTokenStakingWithdraw, error)

func (Keeper) PeekEligibleWithdrawals

func (k Keeper) PeekEligibleWithdrawals(ctx context.Context) (withdrawals etypes.Withdrawals, err error)

func (Keeper) ProcessCreateValidator

func (k Keeper) ProcessCreateValidator(ctx context.Context, ev *bindings.IPTokenStakingCreateValidator) error

func (Keeper) ProcessDeposit

func (k Keeper) ProcessDeposit(ctx context.Context, ev *bindings.IPTokenStakingDeposit) error

func (Keeper) ProcessRedelegate

func (k Keeper) ProcessRedelegate(ctx context.Context, ev *bindings.IPTokenStakingRedelegate) error

func (Keeper) ProcessSetWithdrawalAddress

func (k Keeper) ProcessSetWithdrawalAddress(ctx context.Context, ev *bindings.IPTokenStakingSetWithdrawalAddress) error

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 (k Keeper) ProcessUnjail(ctx context.Context, ev *bindings.IPTokenSlashingUnjail) error

func (Keeper) ProcessWithdraw

func (k Keeper) ProcessWithdraw(ctx context.Context, ev *bindings.IPTokenStakingWithdraw) error

func (Keeper) SetNextValidatorSweepIndex

func (k Keeper) SetNextValidatorSweepIndex(ctx context.Context, nextValIndex sdk.IntProto) error

func (Keeper) SetParams

func (k Keeper) SetParams(ctx context.Context, params types.Params) error

This method performs no validation of the parameters.

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL