keeper

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 sdk.StoreKey,

	dclauthKeeper types.DclauthKeeper,
) *Keeper

func (Keeper) ApplyAndReturnValidatorSetUpdates

func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []abci.ValidatorUpdate, err error)

Apply and return accumulated updates to the bonded validator set. It gets called once after genesis and at every EndBlock.

Only validators that were added or were removed from the validator set are returned to Tendermint.

func (Keeper) CountLastValidators

func (k Keeper) CountLastValidators(ctx sdk.Context) (count int)

count total number of active validators.

func (Keeper) GetAllLastValidatorPower

func (k Keeper) GetAllLastValidatorPower(ctx sdk.Context) (list []types.LastValidatorPower)

GetAllLastValidatorPower returns all lastValidatorPower.

func (Keeper) GetAllLastValidators

func (k Keeper) GetAllLastValidators(ctx sdk.Context) (validators []types.Validator)

get all active validator set.

func (Keeper) GetAllValidator

func (k Keeper) GetAllValidator(ctx sdk.Context) (list []types.Validator)

GetAllValidator returns all validator.

func (Keeper) GetLastValidatorPower

func (k Keeper) GetLastValidatorPower(
	ctx sdk.Context,
	owner sdk.ValAddress,

) (val types.LastValidatorPower, found bool)

GetLastValidatorPower returns a lastValidatorPower from its index.

func (Keeper) GetValidator

func (k Keeper) GetValidator(
	ctx sdk.Context,
	owner sdk.ValAddress,

) (val types.Validator, found bool)

GetValidator returns a validator from its index.

func (Keeper) GetValidatorByConsAddr

func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator types.Validator, found bool)

get a single validator by consensus address.

func (Keeper) HandleDoubleSign

func (k Keeper) HandleDoubleSign(ctx sdk.Context, evidence *evidencetypes.Equivocation)

handle a validator signing two blocks at the same height Zeros validator power and jail it. So validator will be removed from validator set at the end of the block.

func (Keeper) IsLastValidatorPowerPresent

func (k Keeper) IsLastValidatorPowerPresent(ctx sdk.Context, owner sdk.ValAddress) bool

Check if the validator power record associated with validator address is present in the store or not.

func (Keeper) IsValidatorPresent

func (k Keeper) IsValidatorPresent(ctx sdk.Context, owner sdk.ValAddress) bool

Check if the Validator record associated with a validator address is present in the store or not.

func (Keeper) IterateLastValidators

func (k Keeper) IterateLastValidators(ctx sdk.Context, process func(validator types.Validator) (stop bool))

iterate through the active validator set and perform the provided function.

func (Keeper) IterateValidators

func (k Keeper) IterateValidators(ctx sdk.Context, process func(validator types.Validator) (stop bool))

iterate over validators and apply function.

func (Keeper) Jail

func (k Keeper) Jail(ctx sdk.Context, validator types.Validator, reason string)

jail a validator.

func (Keeper) Logger

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

func (Keeper) RemoveLastValidatorPower

func (k Keeper) RemoveLastValidatorPower(
	ctx sdk.Context,
	owner sdk.ValAddress,

)

RemoveLastValidatorPower removes a lastValidatorPower from the store.

func (Keeper) RemoveValidator

func (k Keeper) RemoveValidator(
	ctx sdk.Context,
	owner sdk.ValAddress,

)

RemoveValidator removes a validator from the store.

func (Keeper) SetLastValidatorPower

func (k Keeper) SetLastValidatorPower(ctx sdk.Context, lastValidatorPower types.LastValidatorPower)

SetLastValidatorPower set a specific lastValidatorPower in the store from its index.

func (Keeper) SetValidator

func (k Keeper) SetValidator(ctx sdk.Context, validator types.Validator)

SetValidator set a specific validator in the store from its index.

func (Keeper) SetValidatorByConsAddr

func (k Keeper) SetValidatorByConsAddr(ctx sdk.Context, validator types.Validator) error

validator index.

func (Keeper) Unjail

func (k Keeper) Unjail(ctx sdk.Context, validator types.Validator)

unjail a validator.

Jump to

Keyboard shortcuts

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