keeper

package
v0.0.0-...-1c33bd2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CalculateEquivalentCoin

type CalculateEquivalentCoin func(ctx sdk.Context, coin sdk.Coin, targetDenom string) (sdk.Coin, error)

TODO Temporarily use this method to feed prices !!!

type Hooks

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

func (Hooks) AfterDelegationModified

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

AfterDelegationModified implements types.StakingHooks

func (Hooks) AfterEpochEnd

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

func (Hooks) AfterValidatorBeginUnbonding

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

AfterValidatorBeginUnbonding implements types.StakingHooks

func (Hooks) AfterValidatorBonded

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

AfterValidatorBonded implements types.StakingHooks

func (Hooks) AfterValidatorCreated

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

AfterValidatorCreated implements types.StakingHooks

func (Hooks) AfterValidatorRemoved

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

AfterValidatorRemoved implements types.StakingHooks

func (Hooks) BeforeDelegationCreated

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

BeforeDelegationCreated implements types.StakingHooks

func (Hooks) BeforeDelegationRemoved

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

BeforeDelegationRemoved implements types.StakingHooks

func (Hooks) BeforeDelegationSharesModified

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

BeforeDelegationSharesModified implements types.StakingHooks

func (Hooks) BeforeEpochStart

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

BeforeEpochStart implements types.EpochHooks

func (Hooks) BeforeValidatorModified

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

BeforeValidatorModified implements types.StakingHooks

func (Hooks) BeforeValidatorSlashed

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

BeforeValidatorSlashed implements types.StakingHooks

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeKey storetypes.StoreKey,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	epochKeeper types.EpochKeeper,
	stakingKeeper types.StakingKeeper,
	distributionKeeper types.DistributionKeeper,
) Keeper

func (Keeper) CollectAgentsReward

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

func (Keeper) CompleteUnbonding

func (k Keeper) CompleteUnbonding(ctx sdk.Context, delegator string, agentID uint64) (sdk.Coins, error)

func (Keeper) DecreaseMultiStakingShares

func (k Keeper) DecreaseMultiStakingShares(ctx sdk.Context, shares math.Int, agentID uint64, delegator string) error

func (Keeper) DequeueAllMatureUBDQueue

func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DAPair)

func (Keeper) EndBlocker

func (k Keeper) EndBlocker(ctx sdk.Context) ([]abci.ValidatorUpdate, error)

func (Keeper) GenerateAccount

func (k Keeper) GenerateAccount(ctx sdk.Context, prefix, suffix string) *authtypes.ModuleAccount

func (Keeper) GetAllAgent

func (k Keeper) GetAllAgent(ctx sdk.Context) []types.MultiStakingAgent

func (Keeper) GetAllAgentsByVal

func (k Keeper) GetAllAgentsByVal(ctx sdk.Context, valAddr sdk.ValAddress) []types.MultiStakingAgent

func (Keeper) GetExpectedDelegationAmount

func (k Keeper) GetExpectedDelegationAmount(ctx sdk.Context, coin sdk.Coin) (sdk.Coin, error)

func (Keeper) GetLatestMultiStakingAgentID

func (k Keeper) GetLatestMultiStakingAgentID(ctx sdk.Context) uint64

func (Keeper) GetMultiStakingAgent

func (k Keeper) GetMultiStakingAgent(ctx sdk.Context, denom string, valAddr string) (*types.MultiStakingAgent, bool)

func (Keeper) GetMultiStakingAgentByID

func (k Keeper) GetMultiStakingAgentByID(ctx sdk.Context, id uint64) (*types.MultiStakingAgent, bool)

func (Keeper) GetMultiStakingAgentIDByDenomAndVal

func (k Keeper) GetMultiStakingAgentIDByDenomAndVal(ctx sdk.Context, denom string, valAddr string) (uint64, bool)

func (Keeper) GetMultiStakingDenomWhiteList

func (k Keeper) GetMultiStakingDenomWhiteList(ctx sdk.Context) (*types.MultiStakingDenomWhiteList, bool)

func (Keeper) GetMultiStakingShares

func (k Keeper) GetMultiStakingShares(ctx sdk.Context, agentID uint64, delegator string) math.Int

func (Keeper) GetMultiStakingUnbonding

func (k Keeper) GetMultiStakingUnbonding(ctx sdk.Context, agentID uint64, delegatorAddr string) (*types.MultiStakingUnbonding, bool)

func (Keeper) GetOrCreateMultiStakingAgent

func (k Keeper) GetOrCreateMultiStakingAgent(ctx sdk.Context, denom, valAddr string) *types.MultiStakingAgent

func (Keeper) GetOrCreateMultiStakingUnbonding

func (k Keeper) GetOrCreateMultiStakingUnbonding(ctx sdk.Context, agentID uint64, delegatorAddr string) *types.MultiStakingUnbonding

func (Keeper) GetUBDQueueTimeSlice

func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DAPair)

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

func (Keeper) IncreaseMultiStakingShares

func (k Keeper) IncreaseMultiStakingShares(ctx sdk.Context, shares math.Int, agentID uint64, delegator string) error

func (Keeper) InsertUBDQueue

func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd *types.MultiStakingUnbonding, completionTime time.Time)

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MultiStakingDelegate

func (k Keeper) MultiStakingDelegate(ctx sdk.Context, msg types.MsgMultiStakingDelegate) error

func (Keeper) MultiStakingUndelegate

func (k Keeper) MultiStakingUndelegate(ctx sdk.Context, msg *types.MsgMultiStakingUndelegate) error

func (Keeper) ProcessCompletedUnbonding

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

func (Keeper) RefreshAgentDelegationAmount

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

func (Keeper) RemoveMultiStakingUnbonding

func (k Keeper) RemoveMultiStakingUnbonding(ctx sdk.Context, agentID uint64, delegatorAddr string)

func (Keeper) SetLatestMultiStakingAgentID

func (k Keeper) SetLatestMultiStakingAgentID(ctx sdk.Context, id uint64)

func (Keeper) SetMultiStakingAgent

func (k Keeper) SetMultiStakingAgent(ctx sdk.Context, agent *types.MultiStakingAgent)

func (Keeper) SetMultiStakingAgentIDByDenomAndVal

func (k Keeper) SetMultiStakingAgentIDByDenomAndVal(ctx sdk.Context, id uint64, denom, valAddr string)

func (Keeper) SetMultiStakingDenom

func (k Keeper) SetMultiStakingDenom(ctx sdk.Context, denom string) bool

func (Keeper) SetMultiStakingUnbonding

func (k Keeper) SetMultiStakingUnbonding(ctx sdk.Context, agentID uint64, delegatorAddr string, unbonding *types.MultiStakingUnbonding)

func (Keeper) SetUBDQueueTimeSlice

func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DAPair)

func (Keeper) SlashAgentByValidatorSlash

func (k Keeper) SlashAgentByValidatorSlash(ctx sdk.Context, valAddr sdk.ValAddress, slashFactor sdk.Dec)

TODO more detailed research about slash

func (Keeper) UBDQueueIterator

func (k Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

UBDQueueIterator returns all the unbonding queue timeslices from time 0 until endTime.

func (Keeper) WithdrawRestakingReward

func (k Keeper) WithdrawRestakingReward(ctx sdk.Context, agentID uint64, delegator string) (sdk.Coin, error)

Jump to

Keyboard shortcuts

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