keeper

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VestNowEnabled = false

VestNow is not enabled at this stage

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

Types

type CommitmentKeeperI

type CommitmentKeeperI interface {
	// Iterate all commitments
	IterateCommitments(sdk.Context, func(types.Commitments) (stop bool))

	// Update commitment
	SetCommitments(ctx sdk.Context, commitments types.Commitments)

	// Get commitment
	GetCommitments(sdk.Context, string) types.Commitments

	// Update commitments for claim reward operation
	RecordClaimReward(sdk.Context, string, string, math.Int, types.EarnType) error

	// Update commitments for validator's commission withdrawal to self delegator
	RecordWithdrawValidatorCommission(sdk.Context, string, string, string, math.Int) error
}

Interface declearation

type Hooks

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

Hooks wrapper struct for commitments keeper

func (Hooks) AfterEpochEnd

func (h Hooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)

AfterEpochEnd implements EpochHooks

func (Hooks) BeforeEpochStart

func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)

BeforeEpochStart implements EpochHooks

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,

	bankKeeper types.BankKeeper,
	stakingKeeper types.StakingKeeper,
	assetProfileKeeper types.AssetProfileKeeper,
	authority string,
) *Keeper

func (Keeper) AfterCommitmentChange

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

Committed executes the indicated for committed hook

func (Keeper) AfterEpochEnd

func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, _ int64)

AfterEpochEnd distributes vested tokens at the end of each epoch

func (Keeper) BankKeeper

func (k Keeper) BankKeeper() types.BankKeeper

func (Keeper) BeforeDelegationCreated added in v0.15.0

func (k Keeper) BeforeDelegationCreated(ctx sdk.Context, delegator string, validator string) error

Process delegation hook - create commitment entities for delegator and validator

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(_ sdk.Context, _ string, _ int64)

BeforeEpochStart performs a no-op

func (Keeper) BurnEdenBoost added in v0.15.0

func (k Keeper) BurnEdenBoost(ctx sdk.Context, creator string, denom string, amount math.Int) (types.Commitments, error)

func (Keeper) DeductClaimed added in v0.15.0

func (k Keeper) DeductClaimed(ctx sdk.Context, creator string, denom string, amount math.Int) (types.Commitments, error)

func (Keeper) DeductUnclaimed added in v0.15.0

func (k Keeper) DeductUnclaimed(ctx sdk.Context, creator string, denom string, amount math.Int) (types.Commitments, error)

func (Keeper) DepositLiquidTokensClaimed added in v0.15.0

func (k Keeper) DepositLiquidTokensClaimed(ctx sdk.Context, denom string, amount math.Int, sender string) error

accounting the liquid token as a claimed token in commitment module.

func (Keeper) EdenUncommitted added in v0.12.0

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

Committed executes the indicated for committed hook

func (Keeper) GetAllCommitments added in v0.21.0

func (k Keeper) GetAllCommitments(ctx sdk.Context) (list []*types.Commitments)

GetAllCommitments returns all commitments

func (Keeper) GetAllLegacyCommitments added in v0.29.31

func (k Keeper) GetAllLegacyCommitments(ctx sdk.Context) (list []*types.LegacyCommitments)

GetAllLegacyCommitments returns all legacy commitments

func (Keeper) GetCommitments

func (k Keeper) GetCommitments(ctx sdk.Context, creator string) types.Commitments

GetCommitments returns a commitments from its index

func (Keeper) GetLegacyParams added in v0.29.31

func (k Keeper) GetLegacyParams(ctx sdk.Context) types.LegacyParams

GetParams returns the current parameters of the Commitment module

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetVestingInfo

func (k Keeper) GetVestingInfo(ctx sdk.Context, baseDenom string) (*types.VestingInfo, int)

GetVestingDenom returns the vesting denom for the given base denom

func (Keeper) HandleWithdrawFromCommitment added in v0.15.0

func (k Keeper) HandleWithdrawFromCommitment(ctx sdk.Context, commitments *types.Commitments, amount sdk.Coins, sendCoins bool, addr sdk.AccAddress) error

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Return the wrapper struct

func (Keeper) IterateCommitments

func (k Keeper) IterateCommitments(ctx sdk.Context, handlerFn func(commitments types.Commitments) (stop bool))

IterateCommitments iterates over all Commitments and performs a callback.

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) ProcessTokenVesting added in v0.13.0

func (k Keeper) ProcessTokenVesting(ctx sdk.Context, denom string, amount math.Int, creator string) error

Vesting token Check if vesting entity count is not exceeding the maximum and if it is fine, creates a new vesting entity Deduct from unclaimed bucket. If it is insufficent, deduct from committed bucket as well.

func (Keeper) RecordClaimReward added in v0.15.0

func (k Keeper) RecordClaimReward(ctx sdk.Context, creator string, denom string, amount math.Int, withdrawMode types.EarnType) error

Update commitments for claim reward operation

func (Keeper) RecordWithdrawValidatorCommission added in v0.15.0

func (k Keeper) RecordWithdrawValidatorCommission(ctx sdk.Context, delegator string, creator string, denom string, amount math.Int) error

Update commitments for validator's commission withdrawal to self delegator

func (Keeper) RemoveCommitments

func (k Keeper) RemoveCommitments(ctx sdk.Context, creator string)

RemoveCommitments removes a commitments from the store

func (Keeper) SetCommitments

func (k Keeper) SetCommitments(ctx sdk.Context, commitments types.Commitments)

SetCommitments set a specific commitments in the store from its index

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(eh types.CommitmentHooks) *Keeper

SetHooks set the epoch hooks

func (Keeper) SetLegacyParams added in v0.29.31

func (k Keeper) SetLegacyParams(ctx sdk.Context, params types.LegacyParams)

SetParams set the params

func (Keeper) SetParams

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

SetParams set the params

type MultiCommitmentHooks

type MultiCommitmentHooks []types.CommitmentHooks

combine multiple commitment hooks, all hook functions are run in array sequence

func NewMultiEpochHooks

func NewMultiEpochHooks(hooks ...types.CommitmentHooks) MultiCommitmentHooks

func (MultiCommitmentHooks) CommitmentChanged

func (mh MultiCommitmentHooks) CommitmentChanged(ctx sdk.Context, creator string, amount sdk.Coins)

Committed is called when staker committed his token

func (MultiCommitmentHooks) EdenUncommitted added in v0.12.0

func (mh MultiCommitmentHooks) EdenUncommitted(ctx sdk.Context, creator string, amount sdk.Coin)

Committed is called when staker committed his token

Jump to

Keyboard shortcuts

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