keeper

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EdenValPubKey     cryptotypes.PubKey
	EdenBValPubKey    cryptotypes.PubKey
	EdenValPubKeyAny  *codectypes.Any
	EdenBValPubKeyAny *codectypes.Any
)

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type CommitmentHooks

type CommitmentHooks struct {
	// contains filtered or unexported fields
}

Hooks wrapper struct for incentive keeper

func (CommitmentHooks) BeforeEdenBCommitChange

func (h CommitmentHooks) BeforeEdenBCommitChange(ctx sdk.Context, addr sdk.AccAddress) error

func (CommitmentHooks) BeforeEdenBInitialCommit

func (h CommitmentHooks) BeforeEdenBInitialCommit(ctx sdk.Context, addr sdk.AccAddress) error

func (CommitmentHooks) BeforeEdenCommitChange

func (h CommitmentHooks) BeforeEdenCommitChange(ctx sdk.Context, addr sdk.AccAddress) error

func (CommitmentHooks) BeforeEdenInitialCommit

func (h CommitmentHooks) BeforeEdenInitialCommit(ctx sdk.Context, addr sdk.AccAddress) error

func (CommitmentHooks) CommitmentChanged

func (h CommitmentHooks) CommitmentChanged(ctx sdk.Context, creator string, amount sdk.Coins) error

CommitmentChanged implements CommentmentHook

func (CommitmentHooks) EdenUncommitted

func (h CommitmentHooks) EdenUncommitted(ctx sdk.Context, creator string, amount sdk.Coin) error

EdenUncommitted implements EdenUncommitted

type Keeper

type Keeper struct {
	*stakingkeeper.Keeper
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	parameterKeeper types.ParameterKeeper,
	stakingKeeper *stakingkeeper.Keeper,
	commKeeper types.CommitmentKeeper,
	distrKeeper types.DistrKeeper,
	assetProfileKeeper types.AssetProfileKeeper,
	tokenomicsKeeper types.TokenomicsKeeper,
	authority string,
) *Keeper

func (Keeper) AfterDelegationModified

func (k Keeper) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Updating commitments on delegation changes

func (Keeper) BeforeDelegationCreated

func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Creating a commitment object for a delegator if one does not exist:

func (Keeper) BeforeDelegationRemoved

func (k Keeper) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Keeper) BeforeDelegationSharesModified

func (k Keeper) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (Keeper) BeforeEdenBCommitChange

func (k Keeper) BeforeEdenBCommitChange(ctx sdk.Context, addr sdk.AccAddress) error

func (Keeper) BeforeEdenBInitialCommit

func (k Keeper) BeforeEdenBInitialCommit(ctx sdk.Context, addr sdk.AccAddress) error

func (Keeper) BeforeEdenCommitChange

func (k Keeper) BeforeEdenCommitChange(ctx sdk.Context, addr sdk.AccAddress) error

func (Keeper) BeforeEdenInitialCommit

func (k Keeper) BeforeEdenInitialCommit(ctx sdk.Context, addr sdk.AccAddress) error

func (Keeper) BurnEdenBFromEdenUncommitted

func (k Keeper) BurnEdenBFromEdenUncommitted(ctx sdk.Context, delegator string, uncommitAmt math.Int) error

Burn EdenBoost from Eden unclaimed

func (Keeper) BurnEdenBFromElysUnstaking

func (k Keeper) BurnEdenBFromElysUnstaking(ctx sdk.Context, delegator sdk.AccAddress)

Burn EdenBoost from Elys unstaked

func (Keeper) BurnEdenBIfElysStakingReduced

func (k Keeper) BurnEdenBIfElysStakingReduced(ctx sdk.Context)

func (Keeper) CalcBondedDelegationAmount

func (k Keeper) CalcBondedDelegationAmount(ctx sdk.Context, delAddr sdk.AccAddress) math.Int

Calculate delegation to bonded validators

func (Keeper) CalcDelegationAmount

func (k Keeper) CalcDelegationAmount(ctx sdk.Context, delegator sdk.AccAddress) math.Int

Calculate the delegated amount

func (Keeper) CommitmentChanged

func (k Keeper) CommitmentChanged(ctx sdk.Context, creator string, amount sdk.Coins) error

Process commitmentChanged hook

func (Keeper) CommitmentHooks

func (k Keeper) CommitmentHooks() CommitmentHooks

Return the wrapper struct

func (Keeper) Delegation

func (k Keeper) Delegation(ctx sdk.Context, addrDel sdk.AccAddress, addrVal sdk.ValAddress) stakingtypes.DelegationI

func (Keeper) DelegationRewards

func (k Keeper) DelegationRewards(ctx sdk.Context, delegatorAddress string, validatorAddress string) (sdk.DecCoins, error)

func (Keeper) EdenUncommitted

func (k Keeper) EdenUncommitted(ctx sdk.Context, creator string, amount sdk.Coin) error

Process eden uncommitted hook

func (Keeper) EndBlocker

func (k Keeper) EndBlocker(ctx sdk.Context)

EndBlocker of incentive module

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the module's exported genesis

func (Keeper) GetAllElysStakeChange

func (k Keeper) GetAllElysStakeChange(ctx sdk.Context) (list []sdk.AccAddress)

func (Keeper) GetAllElysStaked

func (k Keeper) GetAllElysStaked(ctx sdk.Context) (list []types.ElysStaked)

GetAllElysStaked returns all elysStaked

func (Keeper) GetEdenBValidator

func (k Keeper) GetEdenBValidator(ctx sdk.Context) stakingtypes.ValidatorI

func (Keeper) GetEdenValidator

func (k Keeper) GetEdenValidator(ctx sdk.Context) stakingtypes.ValidatorI

func (Keeper) GetElysStakeChange

func (k Keeper) GetElysStakeChange(ctx sdk.Context, addr sdk.AccAddress) (found bool)

func (Keeper) GetElysStaked

func (k Keeper) GetElysStaked(ctx sdk.Context, address string) math.Int

GetElysStaked returns a elysStaked from its index

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)

InitGenesis initializes the module's state from a provided genesis state.

func (Keeper) Invariant added in v0.32.0

func (Keeper) IterateBondedValidatorsByPower

func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator stakingtypes.ValidatorI) (stop bool))

iterate through the bonded validator set and perform the provided function

func (Keeper) IterateDelegations

func (k Keeper) IterateDelegations(ctx sdk.Context, delegator sdk.AccAddress,
	fn func(index int64, delegation stakingtypes.DelegationI) (stop bool))

func (Keeper) IterateValidators

func (k Keeper) IterateValidators(ctx sdk.Context,
	fn func(index int64, validator stakingtypes.ValidatorI) (stop bool))

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Params

func (Keeper) ProcessRewardsDistribution

func (k Keeper) ProcessRewardsDistribution(ctx sdk.Context)

Rewards distribution

func (Keeper) ProcessUpdateIncentiveParams

func (k Keeper) ProcessUpdateIncentiveParams(ctx sdk.Context)

func (Keeper) RemoveElysStakeChange

func (k Keeper) RemoveElysStakeChange(ctx sdk.Context, address sdk.AccAddress)

func (Keeper) RemoveElysStaked

func (k Keeper) RemoveElysStaked(ctx sdk.Context, address string)

RemoveElysStaked removes a elysStaked from the store

func (Keeper) Rewards

func (Keeper) SetElysStakeChange

func (k Keeper) SetElysStakeChange(ctx sdk.Context, addr sdk.AccAddress)

func (Keeper) SetElysStaked

func (k Keeper) SetElysStaked(ctx sdk.Context, elysStaked types.ElysStaked)

SetElysStaked set a specific elysStaked in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) Slash

func (k Keeper) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec) math.Int

func (Keeper) SlashWithInfractionReason

func (k Keeper) SlashWithInfractionReason(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec, infraction stakingtypes.Infraction) math.Int

func (Keeper) StakingHooks

func (k Keeper) StakingHooks() StakingHooks

Return the wrapper struct

func (Keeper) TakeDelegationSnapshot

func (k Keeper) TakeDelegationSnapshot(ctx sdk.Context, addr sdk.AccAddress)

func (Keeper) TotalBondedTokens

func (k Keeper) TotalBondedTokens(ctx sdk.Context) math.Int

func (Keeper) UpdateStakersRewards

func (k Keeper) UpdateStakersRewards(ctx sdk.Context) error

func (Keeper) Validator

func (k Keeper) Validator(ctx sdk.Context, address sdk.ValAddress) stakingtypes.ValidatorI

extended staking keeper functionalities

func (Keeper) WithdrawAllRewards

func (Keeper) WithdrawEdenBReward

func (k Keeper) WithdrawEdenBReward(ctx sdk.Context, addr sdk.AccAddress) error

func (Keeper) WithdrawEdenReward

func (k Keeper) WithdrawEdenReward(ctx sdk.Context, addr sdk.AccAddress) error

type StakingHooks

type StakingHooks struct {
	// contains filtered or unexported fields
}

StakingHooks wrapper struct for slashing keeper

func (StakingHooks) AfterDelegationModified

func (h StakingHooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

func (StakingHooks) AfterUnbondingInitiated

func (h StakingHooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error

staking StakingHooks Must be called when a validator is created

func (StakingHooks) AfterValidatorBeginUnbonding

func (h StakingHooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

Must be called when a validator begins unbonding

func (StakingHooks) AfterValidatorBonded

func (h StakingHooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

Must be called when a validator is bonded

func (StakingHooks) AfterValidatorCreated

func (h StakingHooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error

staking StakingHooks Must be called when a validator is created

func (StakingHooks) AfterValidatorRemoved

func (h StakingHooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error

Must be called when a validator is deleted

func (StakingHooks) BeforeDelegationCreated

func (h StakingHooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Must be called when a delegation is created

func (StakingHooks) BeforeDelegationRemoved

func (h StakingHooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Must be called when a delegation is removed

func (StakingHooks) BeforeDelegationSharesModified

func (h StakingHooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error

Must be called when a delegation's shares are modified

func (StakingHooks) BeforeValidatorModified

func (h StakingHooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error

Must be called when a validator's state changes

func (StakingHooks) BeforeValidatorSlashed

func (h StakingHooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error

Jump to

Keyboard shortcuts

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