keeper

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const SecondsPerYear = 365 * 24 * 3600

Variables

This section is empty.

Functions

func CalculateStakingAnnualPercentage added in v0.24.1

func CalculateStakingAnnualPercentage(totalSupply, totalBonded sdkmath.Int, inflationRate, communityTax, rewardsPerSecond sdkmath.LegacyDec) sdkmath.LegacyDec

CalculateStakingAnnualPercentage returns the annualized staking reward rate. It assumes that staking comes from one of two sources depending on if inflation is enabled or not.

func HandleCommunityCDPRepayDebtProposal added in v0.23.0

func HandleCommunityCDPRepayDebtProposal(ctx sdk.Context, k Keeper, p *types.CommunityCDPRepayDebtProposal) error

HandleCommunityCDPRepayDebtProposal is a handler for executing a passed community pool cdp repay debt proposal.

func HandleCommunityCDPWithdrawCollateralProposal added in v0.23.0

func HandleCommunityCDPWithdrawCollateralProposal(
	ctx sdk.Context,
	k Keeper,
	p *types.CommunityCDPWithdrawCollateralProposal,
) error

HandleCommunityCDPWithdrawCollateralProposal is a handler for executing a passed community pool cdp withdraw collateral proposal.

func HandleCommunityPoolLendDepositProposal

func HandleCommunityPoolLendDepositProposal(ctx sdk.Context, k Keeper, p *types.CommunityPoolLendDepositProposal) error

HandleCommunityPoolLendDepositProposal is a handler for executing a passed community pool lend deposit proposal.

func HandleCommunityPoolLendWithdrawProposal

func HandleCommunityPoolLendWithdrawProposal(ctx sdk.Context, k Keeper, p *types.CommunityPoolLendWithdrawProposal) error

HandleCommunityPoolLendWithdrawProposal is a handler for executing a passed community pool lend withdraw proposal.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the community MsgServer interface for the provided Keeper.

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) types.QueryServer

NewQueryServerImpl creates a new server for handling gRPC queries.

Types

type Keeper

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

Keeper of the community store

func NewKeeper

NewKeeper creates a new community Keeper instance

func (Keeper) CheckAndDisableMintAndKavaDistInflation added in v0.25.0

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

CheckAndDisableMintAndKavaDistInflation compares the disable inflation time and block time, and disables inflation if time is set and before block time. Inflation time is reset, so this method is safe to call more than once.

func (Keeper) DistributeFromCommunityPool

func (k Keeper) DistributeFromCommunityPool(ctx sdk.Context, recipient sdk.AccAddress, amount sdk.Coins) error

DistributeFromCommunityPool transfers coins from the community pool to recipient.

func (Keeper) FundCommunityPool

func (k Keeper) FundCommunityPool(ctx sdk.Context, sender sdk.AccAddress, amount sdk.Coins) error

FundCommunityPool transfers coins from the sender to the community module account.

func (Keeper) GetAuthority added in v0.25.0

func (k Keeper) GetAuthority() sdk.AccAddress

GetAuthority returns the x/community module's authority.

func (Keeper) GetModuleAccountBalance

func (k Keeper) GetModuleAccountBalance(ctx sdk.Context) sdk.Coins

GetModuleAccountBalance returns all the coins held by the community module account

func (Keeper) GetParams added in v0.25.0

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

GetParams returns the params from the store

func (Keeper) GetStakingRewardsState added in v0.25.0

func (k Keeper) GetStakingRewardsState(ctx sdk.Context) types.StakingRewardsState

GetStakingRewardsState returns the staking reward state or the default state if not set

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) PayoutAccumulatedStakingRewards added in v0.25.0

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

PayoutAccumulatedStakingRewards calculates and transfers taking rewards to the fee collector address

func (Keeper) SetParams added in v0.25.0

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

SetParams sets params on the store

func (Keeper) SetStakingRewardsState added in v0.25.0

func (k Keeper) SetStakingRewardsState(ctx sdk.Context, state types.StakingRewardsState)

SetStakingRewardsState validates and sets the staking rewards state in the store

func (Keeper) StartCommunityFundConsolidation added in v0.25.0

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

StartCommunityFundConsolidation consolidates the community funds from x/distribution and x/kavadist into the x/community module account

type Migrator added in v0.25.0

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

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

func NewMigrator added in v0.25.0

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v0.25.0

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

Migrate1to2 migrates from version 1 to 2.

Jump to

Keyboard shortcuts

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