keeper

package
v0.0.0-...-7868e01 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

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

func (Hooks) AfterDistributeMintedCoins

func (h Hooks) AfterDistributeMintedCoins(ctx sdk.Context, fees sdk.Coins)

Distribute coins after minter module allocate assets to pool-incentives module

func (Hooks) AfterExitPool

func (h Hooks) AfterExitPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, shareInAmount sdk.Int, exitCoins sdk.Coins)

AfterExitPool hook is a noop

func (Hooks) AfterJoinPool

func (h Hooks) AfterJoinPool(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, enterCoins sdk.Coins, shareOutAmount sdk.Int)

AfterJoinPool hook is a noop

func (Hooks) AfterPoolCreated

func (h Hooks) AfterPoolCreated(ctx sdk.Context, sender sdk.AccAddress, poolId uint64)

AfterPoolCreated creates a pot for each pool’s lockable duration

func (Hooks) AfterSwap

func (h Hooks) AfterSwap(ctx sdk.Context, sender sdk.AccAddress, poolId uint64, input sdk.Coins, output sdk.Coins)

AfterSwap hook is a noop

type Keeper

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

func NewKeeper

func NewKeeper(cdc codec.BinaryMarshaler, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, incentivesKeeper types.IncentivesKeeper, distrKeeper types.DistrKeeper, communityPoolName string, feeCollectorName string) Keeper

func (Keeper) AllocateAsset

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

AllocateAsset allocates and distributes coin according a pot’s proportional weight that is recorded in the record

func (Keeper) CreatePoolPots

func (k Keeper) CreatePoolPots(ctx sdk.Context, poolId uint64) error

func (Keeper) ExportGenesis

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

func (Keeper) FundCommunityPoolFromModule

func (k Keeper) FundCommunityPoolFromModule(ctx sdk.Context, asset sdk.Coin) error

func (Keeper) GetDistrInfo

func (k Keeper) GetDistrInfo(ctx sdk.Context) types.DistrInfo

func (Keeper) GetLockableDurations

func (k Keeper) GetLockableDurations(ctx sdk.Context) []time.Duration

func (Keeper) GetParams

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

func (Keeper) GetPoolPotId

func (k Keeper) GetPoolPotId(ctx sdk.Context, poolId uint64, lockableDuration time.Duration) (uint64, error)

func (Keeper) HandleUpdatePoolIncentivesProposal

func (k Keeper) HandleUpdatePoolIncentivesProposal(ctx sdk.Context, p *types.UpdatePoolIncentivesProposal) error

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Create new pool incentives hooks

func (Keeper) InitGenesis

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

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) PotIds

func (Keeper) SetDistrInfo

func (k Keeper) SetDistrInfo(ctx sdk.Context, distrInfo types.DistrInfo)

func (Keeper) SetLockableDurations

func (k Keeper) SetLockableDurations(ctx sdk.Context, lockableDurations []time.Duration)

func (Keeper) SetParams

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

func (Keeper) SetPoolPotId

func (k Keeper) SetPoolPotId(ctx sdk.Context, poolId uint64, lockableDuration time.Duration, potId uint64)

func (Keeper) UpdateDistrRecords

func (k Keeper) UpdateDistrRecords(ctx sdk.Context, records ...types.DistrRecord) error

Jump to

Keyboard shortcuts

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