keeper

package
v0.0.0-...-2da98db Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateFixedValidatorRewards

func CalculateFixedValidatorRewards(avgBlockTimeString string) (sdk.Dec, error)

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func (k Keeper) AddObserverEmission(ctx sdk.Context, address string, amount sdkmath.Int)

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 (k Keeper) GetAuthority() string

func (Keeper) GetBankKeeper

func (k Keeper) GetBankKeeper() types.BankKeeper

func (Keeper) GetBlockRewardComponents

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

func (Keeper) GetFeeCollector

func (k Keeper) GetFeeCollector() string

func (Keeper) GetFixedBlockRewards

func (k Keeper) GetFixedBlockRewards() (sdk.Dec, error)

func (Keeper) GetObserverKeeper

func (k Keeper) GetObserverKeeper() types.ObserverKeeper

func (Keeper) GetParams

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

GetParams get all parameters

func (Keeper) GetReservesFactor

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

func (Keeper) GetStakingKeeper

func (k Keeper) GetStakingKeeper() types.StakingKeeper

func (Keeper) GetWithdrawableEmission

func (k Keeper) GetWithdrawableEmission(ctx sdk.Context, address string) (val types.WithdrawableEmissions, found bool)

func (Keeper) Logger

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

func (Keeper) Params

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) SetParams

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

SetParams set the params

func (Keeper) SetWithdrawableEmission

func (k Keeper) SetWithdrawableEmission(ctx sdk.Context, we types.WithdrawableEmissions)

func (Keeper) SlashObserverEmission

func (k Keeper) SlashObserverEmission(ctx sdk.Context, address string, slashAmount sdkmath.Int)

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

https://github.com/zeta-chain/node/issues/945

type Migrator

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

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

func NewMigrator

func NewMigrator(k Keeper, ss exported.Subspace) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate2to3

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

Migrate2to3 migrates the store from consensus version 2 to 3

Jump to

Keyboard shortcuts

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