keeper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 16 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 Hooks

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

Hooks wrapper struct

func (Hooks) AfterDelegationModified

func (h Hooks) AfterDelegationModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

func (Hooks) AfterUnbondingInitiated

func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error

func (Hooks) AfterValidatorBeginUnbonding

func (h Hooks) AfterValidatorBeginUnbonding(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

func (Hooks) AfterValidatorBonded

func (h Hooks) AfterValidatorBonded(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

AfterValidatorBonded updates the signing info start height or create a new signing info

func (Hooks) AfterValidatorCreated

func (h Hooks) AfterValidatorCreated(ctx context.Context, valAddr sdk.ValAddress) error

AfterValidatorCreated checks if the validator's operator address is whitelisted

func (Hooks) AfterValidatorRemoved

func (h Hooks) AfterValidatorRemoved(_ context.Context, _ sdk.ConsAddress, _ sdk.ValAddress) error

AfterValidatorRemoved deletes the address-pubkey relation when a validator is removed,

func (Hooks) BeforeDelegationCreated

func (h Hooks) BeforeDelegationCreated(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

func (Hooks) BeforeDelegationRemoved

func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

func (Hooks) BeforeDelegationSharesModified

func (h Hooks) BeforeDelegationSharesModified(_ context.Context, _ sdk.AccAddress, _ sdk.ValAddress) error

func (Hooks) BeforeValidatorModified

func (h Hooks) BeforeValidatorModified(_ context.Context, _ sdk.ValAddress) error

func (Hooks) BeforeValidatorSlashed

func (h Hooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ math.LegacyDec) error

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeService store.KVStoreService,
	logger log.Logger,
	authority string,

	stakingKeeper types.StakingKeeper,
) Keeper

func (Keeper) AppendStaker

func (k Keeper) AppendStaker(ctx context.Context, stakerInfo types.StakerInfo)

SetCommitteeAddress set the committee address to KVStore

func (*Keeper) BeginBlocker

func (k *Keeper) BeginBlocker(ctx context.Context)

BeginBlocker will persist the current header and validator set as a historical entry and prune the oldest entry based on the HistoricalEntries parameter

func (Keeper) DeleteStaker

func (k Keeper) DeleteStaker(ctx context.Context, stakerAddress string)

GetCommitteeAddress gets the committee address from KVStore

func (*Keeper) EndBlocker

func (k *Keeper) EndBlocker(ctx context.Context) error

EndBlocker Called every block, update validator set

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx context.Context) *types.GenesisState

ExportGenesis returns the module's exported genesis

func (Keeper) GetAllStakerInfo

func (k Keeper) GetAllStakerInfo(ctx context.Context, pagination *query.PageRequest) ([]types.StakerInfo, *query.PageResponse, error)

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetCommitteeAddress

func (k Keeper) GetCommitteeAddress(ctx context.Context) string

GetCommitteeAddress gets the committee address from KVStore

func (Keeper) GetParams

func (k Keeper) GetParams(ctx context.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) GetRegisteredVKList

func (k Keeper) GetRegisteredVKList(ctx context.Context, pagination *query.PageRequest) ([][]byte, *query.PageResponse, error)

GetRegisteredVKList retrieves the list of registered VKs with pagination

func (Keeper) GetStaker

func (k Keeper) GetStaker(ctx context.Context, stakerAddress string) (types.StakerInfo, bool)

func (Keeper) GetStakerCount

func (k Keeper) GetStakerCount(ctx context.Context) uint64

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx context.Context, gs types.GenesisState) error

InitGenesis initializes the module's state from a provided genesis state.

func (Keeper) IsVKRegistered

func (k Keeper) IsVKRegistered(ctx context.Context, vk []byte) bool

IsVKRegistered checks if a VK is registered

func (Keeper) Logger

func (k Keeper) Logger() log.Logger

Logger returns a module-specific logger.

func (Keeper) Params

func (Keeper) RegisterVK

func (k Keeper) RegisterVK(ctx context.Context, vk []byte) error

RegisterVK registers a new VK

func (Keeper) RemoveVK

func (k Keeper) RemoveVK(ctx context.Context, vk []byte) error

RemoveVK removes a registered VK

func (Keeper) SetCommitteeAddress

func (k Keeper) SetCommitteeAddress(ctx context.Context, committeeAddress string)

SetCommitteeAddress set the committee address to KVStore

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetStakerCount

func (k Keeper) SetStakerCount(ctx context.Context, count uint64)

Jump to

Keyboard shortcuts

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