keeper

package
v8.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportGenesis

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

func InitGenesis

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

InitGenesis initialize default parameters and the keeper's address to pubkey map

Types

type Keeper

type Keeper struct {
	DistributionKeeper types.DistributionKeeper
	BankKeeper         types.BankKeeper
	MintKeeper         types.MintKeeper
	StakingKeeper      types.StakingKeeper
	// contains filtered or unexported fields
}

Keeper of the incentives store

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	paramSpace paramtypes.Subspace,
	distributionKeeper types.DistributionKeeper,
	bankKeeper types.BankKeeper,
	mintKeeper types.MintKeeper,
	stakingKeeper types.StakingKeeper,
) Keeper

func (Keeper) AllocateTokens

func (k Keeper) AllocateTokens(ctx sdk.Context, totalPreviousPower int64, totalDistribution sdk.DecCoins, qualifyingVoters []ValidatorInfo, maxFraction sdk.Dec) sdk.DecCoins

AllocateTokens performs reward distribution to the provided validators proportionally to their power with a cap

func (Keeper) AllocateTokensToValidator

func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins)

AllocateTokensToValidator allocates tokens to a particular validator. All tokens go to the validator.

func (Keeper) BeginBlocker

func (k Keeper) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock)

BeginBlocker defines distribution rewards for validators

1) Subtract the total distribution from the community pool 2) Get a list of qualifying validators sorted by descending power 3) Allocate tokens to qualifying validators proportionally to their power with a cap 4) Add the remaining coins back to the community pool

func (Keeper) EndBlocker

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

func (Keeper) GetAPY

func (k Keeper) GetAPY(ctx sdk.Context) sdk.Dec

func (Keeper) GetParamSet

func (k Keeper) GetParamSet(ctx sdk.Context) types.Params

GetParamSet returns the parameters

func (Keeper) GetParamSetIfExists

func (k Keeper) GetParamSetIfExists(ctx sdk.Context) types.Params

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) QueryAPY

func (Keeper) QueryParams

QueryParams implements QueryServer

func (Keeper) SetParams

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

setParams sets the parameters in the store

type Migrator

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migrates from consensus version 1 to 2.

type ValidatorInfo

type ValidatorInfo struct {
	Validator stakingtypes.ValidatorI
	Power     int64
}

Jump to

Keyboard shortcuts

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