keeper

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 21 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, sdk.AccAddress) types.Commitments
}

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) error

AfterEpochEnd implements EpochHooks

func (Hooks) BeforeEpochStart

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

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) AddEdenEdenBOnAccount added in v0.31.0

func (k Keeper) AddEdenEdenBOnAccount(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) sdk.Coins

func (Keeper) AddEdenEdenBOnModule added in v0.31.0

func (k Keeper) AddEdenEdenBOnModule(ctx sdk.Context, moduleName string, amt sdk.Coins) sdk.Coins

func (Keeper) AfterEpochEnd

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

AfterEpochEnd distributes vested tokens at the end of each epoch

func (Keeper) BankKeeper

func (k Keeper) BankKeeper() types.BankKeeper

func (Keeper) BeforeEpochStart

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

BeforeEpochStart performs a no-op

func (Keeper) BlockedAddr added in v0.31.0

func (k Keeper) BlockedAddr(addr sdk.AccAddress) bool

func (Keeper) BurnCoins added in v0.31.0

func (k Keeper) BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error

func (Keeper) BurnEdenBoost added in v0.15.0

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

func (Keeper) CommitLiquidTokens added in v0.31.0

func (k Keeper) CommitLiquidTokens(ctx sdk.Context, addr sdk.AccAddress, denom string, amount math.Int, lockUntil uint64) error

CommitLiquidTokens commit the tokens from user's balance

func (Keeper) CommitmentChanged added in v0.31.0

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

Committed executes the indicated for committed hook

func (Keeper) CommitmentVestingInfo added in v0.38.1

func (Keeper) CommittedTokensLocked added in v0.37.0

func (Keeper) DeductClaimed added in v0.15.0

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

func (Keeper) DeleteLegacyCommitments added in v0.42.0

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

remove after migration

func (Keeper) DeleteLegacyParams added in v0.42.0

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

func (Keeper) DepositLiquidTokensClaimed added in v0.15.0

func (k Keeper) DepositLiquidTokensClaimed(ctx sdk.Context, denom string, amount math.Int, sender sdk.AccAddress) 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 sdk.AccAddress, amount sdk.Coin) error

Committed executes the indicated for committed hook

func (Keeper) GetAllBalances added in v0.31.0

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

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.Commitments)

remove after migration

func (Keeper) GetCommitments

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

GetCommitments returns a commitments from its index

func (Keeper) GetLegacyParams added in v0.29.31

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

remove after migration

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) HasCommitments added in v0.31.0

func (k Keeper) HasCommitments(ctx sdk.Context, creator sdk.AccAddress) bool

func (Keeper) HasLegacyCommitments added in v0.42.0

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

remove after migration

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) MintCoins added in v0.31.0

func (k Keeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error

func (Keeper) NumberOfCommitments added in v0.31.0

func (Keeper) Params

func (Keeper) ProcessTokenVesting added in v0.13.0

func (k Keeper) ProcessTokenVesting(ctx sdk.Context, denom string, amount math.Int, creator sdk.AccAddress) 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) RemoveCommitments

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

RemoveCommitments removes a commitments from the store

func (Keeper) SendCoinsFromAccountToModule added in v0.31.0

func (k Keeper) SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error

func (Keeper) SendCoinsFromModuleToAccount added in v0.31.0

func (k Keeper) SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error

func (Keeper) SendCoinsFromModuleToModule added in v0.31.0

func (k Keeper) SendCoinsFromModuleToModule(ctx sdk.Context, senderModule string, recipientModule string, amt sdk.Coins) error

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) SetParams

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

SetParams set the params

func (Keeper) SpendableCoins added in v0.31.0

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

func (Keeper) SubEdenEdenBOnModule added in v0.31.0

func (k Keeper) SubEdenEdenBOnModule(ctx sdk.Context, moduleName string, amt sdk.Coins) (sdk.Coins, error)

func (Keeper) TotalNumberOfCommitments added in v0.31.0

func (k Keeper) TotalNumberOfCommitments(ctx sdk.Context) int64

NumberOfCommitments returns total number of commitment items

func (Keeper) UncommitTokens added in v0.31.0

func (k Keeper) UncommitTokens(ctx sdk.Context, addr sdk.AccAddress, denom string, amount math.Int, isLiquidation bool) error

type MultiCommitmentHooks

type MultiCommitmentHooks []types.CommitmentHooks

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

func NewMultiCommitmentHooks added in v0.31.0

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

func (MultiCommitmentHooks) BeforeEdenBCommitChange added in v0.31.0

func (mh MultiCommitmentHooks) BeforeEdenBCommitChange(ctx sdk.Context, addr sdk.AccAddress) error

func (MultiCommitmentHooks) BeforeEdenBInitialCommit added in v0.31.0

func (mh MultiCommitmentHooks) BeforeEdenBInitialCommit(ctx sdk.Context, addr sdk.AccAddress) error

func (MultiCommitmentHooks) BeforeEdenCommitChange added in v0.31.0

func (mh MultiCommitmentHooks) BeforeEdenCommitChange(ctx sdk.Context, addr sdk.AccAddress) error

func (MultiCommitmentHooks) BeforeEdenInitialCommit added in v0.31.0

func (mh MultiCommitmentHooks) BeforeEdenInitialCommit(ctx sdk.Context, addr sdk.AccAddress) error

func (MultiCommitmentHooks) CommitmentChanged

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

Committed is called when staker committed his token

func (MultiCommitmentHooks) EdenUncommitted added in v0.12.0

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

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