keeper

package
v0.0.0-...-54ba5db Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmitObserverEmissions

func EmitObserverEmissions(ctx sdk.Context, em []*types.ObserverEmission)

func EmitValidatorEmissions

func EmitValidatorEmissions(
	ctx sdk.Context,
	bondFactor, reservesFactor, durationsFactor, validatorRewards, observerRewards, tssRewards string,
)

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.Codec,
	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) GetCodec

func (k Keeper) GetCodec() codec.Codec

func (Keeper) GetFeeCollector

func (k Keeper) GetFeeCollector() string

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) sdkmath.LegacyDec

func (Keeper) GetStakingKeeper

func (k Keeper) GetStakingKeeper() types.StakingKeeper

func (Keeper) GetStoreKey

func (k Keeper) GetStoreKey() storetypes.StoreKey

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

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

Migrate4to5 migrates the store from consensus version 4 to 5

func (Migrator) Migrate5to6

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

Migrate5to6 migrates the store from consensus version 5 to 6

func (Migrator) Migrate6to7

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

Migrate6to7 migrates the store from consensus version 6 to 7

Jump to

Keyboard shortcuts

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