Documentation ¶
Index ¶
- func ExportGenesis(ctx sdk.Context, k Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Context, k Keeper, gs types.GenesisState)
- type Keeper
- func (k Keeper) AllocateTokens(ctx sdk.Context, totalPreviousPower int64, totalDistribution sdk.DecCoins, ...) sdk.DecCoins
- func (k Keeper) AllocateTokensToValidator(ctx sdk.Context, val stakingtypes.ValidatorI, tokens sdk.DecCoins)
- func (k Keeper) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock)
- func (k Keeper) EndBlocker(ctx sdk.Context)
- func (k Keeper) GetAPY(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetParamSet(ctx sdk.Context) types.Params
- func (k Keeper) GetParamSetIfExists(ctx sdk.Context) types.Params
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) QueryAPY(c context.Context, _ *types.QueryAPYRequest) (*types.QueryAPYResponse, error)
- func (k Keeper) QueryParams(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- type Migrator
- type ValidatorInfo
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 (Keeper) GetParamSet ¶
GetParamSet returns the parameters
func (Keeper) GetParamSetIfExists ¶
func (Keeper) QueryAPY ¶
func (k Keeper) QueryAPY(c context.Context, _ *types.QueryAPYRequest) (*types.QueryAPYResponse, error)
func (Keeper) QueryParams ¶
func (k Keeper) QueryParams(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
QueryParams implements QueryServer
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
type ValidatorInfo ¶
type ValidatorInfo struct { Validator stakingtypes.ValidatorI Power int64 }