Documentation ¶
Index ¶
- func CalculateFixedValidatorRewards(avgBlockTimeString string) (sdk.Dec, error)
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AddObserverEmission(ctx sdk.Context, address string, amount sdkmath.Int)
- func (k Keeper) GetAllWithdrawableEmission(ctx sdk.Context) (list []types.WithdrawableEmissions)
- func (k Keeper) GetAuthKeeper() types.AccountKeeper
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetBankKeeper() types.BankKeeper
- func (k Keeper) GetBlockRewardComponents(ctx sdk.Context, params types.Params) (sdk.Dec, sdk.Dec, sdk.Dec)
- func (k Keeper) GetEmissionsFactors(goCtx context.Context, _ *types.QueryGetEmissionsFactorsRequest) (*types.QueryGetEmissionsFactorsResponse, error)
- func (k Keeper) GetFeeCollector() string
- func (k Keeper) GetFixedBlockRewards() (sdk.Dec, error)
- func (k Keeper) GetObserverKeeper() types.ObserverKeeper
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params, found bool)
- func (k Keeper) GetReservesFactor(ctx sdk.Context) sdk.Dec
- func (k Keeper) GetStakingKeeper() types.StakingKeeper
- func (k Keeper) GetWithdrawableEmission(ctx sdk.Context, address string) (val types.WithdrawableEmissions, found bool)
- func (k Keeper) ListPoolAddresses(_ context.Context, req *types.QueryListPoolAddressesRequest) (*types.QueryListPoolAddressesResponse, error)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveWithdrawableEmission(ctx sdk.Context, address string, amount sdkmath.Int) error
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k Keeper) SetWithdrawableEmission(ctx sdk.Context, we types.WithdrawableEmissions)
- func (k Keeper) ShowAvailableEmissions(goCtx context.Context, req *types.QueryShowAvailableEmissionsRequest) (*types.QueryShowAvailableEmissionsResponse, error)
- func (k Keeper) SlashObserverEmission(ctx sdk.Context, address string, slashAmount sdkmath.Int)
- type Migrator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, feeCollectorName string, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, observerKeeper types.ObserverKeeper, authKeeper types.AccountKeeper, authority string, ) *Keeper
func (Keeper) AddObserverEmission ¶
AddObserverEmission adds the given amount to the withdrawable emission of a given address. If the address does not have a withdrawable emission, it will create a new withdrawable emission with the given amount.
func (Keeper) GetAllWithdrawableEmission ¶
func (k Keeper) GetAllWithdrawableEmission(ctx sdk.Context) (list []types.WithdrawableEmissions)
func (Keeper) GetAuthKeeper ¶
func (k Keeper) GetAuthKeeper() types.AccountKeeper
func (Keeper) GetAuthority ¶
func (Keeper) GetBankKeeper ¶
func (k Keeper) GetBankKeeper() types.BankKeeper
func (Keeper) GetBlockRewardComponents ¶
func (Keeper) GetEmissionsFactors ¶
func (k Keeper) GetEmissionsFactors( goCtx context.Context, _ *types.QueryGetEmissionsFactorsRequest, ) (*types.QueryGetEmissionsFactorsResponse, error)
func (Keeper) GetFeeCollector ¶
func (Keeper) GetObserverKeeper ¶
func (k Keeper) GetObserverKeeper() types.ObserverKeeper
func (Keeper) GetStakingKeeper ¶
func (k Keeper) GetStakingKeeper() types.StakingKeeper
func (Keeper) GetWithdrawableEmission ¶
func (Keeper) ListPoolAddresses ¶
func (k Keeper) ListPoolAddresses( _ context.Context, req *types.QueryListPoolAddressesRequest, ) (*types.QueryListPoolAddressesResponse, error)
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RemoveWithdrawableEmission ¶
func (k Keeper) RemoveWithdrawableEmission(ctx sdk.Context, address string, amount sdkmath.Int) error
RemoveWithdrawableEmission removes the given amount from the withdrawable emission of a given address. If the amount is greater than the available withdrawable emissionsf or that address it will remove the entire amount from the withdrawable emissions. If the amount is negative or zero, it will return an error.
func (Keeper) SetWithdrawableEmission ¶
func (k Keeper) SetWithdrawableEmission(ctx sdk.Context, we types.WithdrawableEmissions)
func (Keeper) ShowAvailableEmissions ¶
func (k Keeper) ShowAvailableEmissions( goCtx context.Context, req *types.QueryShowAvailableEmissionsRequest, ) (*types.QueryShowAvailableEmissionsResponse, error)
func (Keeper) SlashObserverEmission ¶
SlashObserverEmission slashes the rewards of a given address, if the address has no rewards left, it will set the rewards to 0. If the address does not have a withdrawable emission, it will create a new withdrawable emission with zero amount.
This function is a basic implementation of slashing; it will be improved in the future .
Improvements will include: - Add a jailing mechanism - Slash observer below 0, or remove from an observer list if their rewards are below 0
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.
func NewMigrator ¶
NewMigrator returns a new Migrator.