keeper

package
v1.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	ps paramtypes.Subspace,
) *Keeper

func (Keeper) DeleteHistoricalInfo

func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)

DeleteHistoricalInfo deletes the historical info at a given height

func (Keeper) DeleteSequencer

func (k Keeper) DeleteSequencer(ctx sdk.Context, sequencer stakingtypes.Validator)

delete the main record holding sequencer details

func (Keeper) GetAllHistoricalInfo

func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []stakingtypes.HistoricalInfo

GetAllHistoricalInfo returns all stored HistoricalInfo objects.

func (Keeper) GetAllSequencers

func (k Keeper) GetAllSequencers(ctx sdk.Context) (sequencers []stakingtypes.Validator)

get the set of all sequencers with no limits, used during genesis dump

func (Keeper) GetHistoricalInfo

func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)

GetHistoricalInfo gets the historical info at a given height

func (Keeper) GetParams

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

GetParams returns the total set of sequencers parameters.

func (Keeper) GetSequencer

func (k Keeper) GetSequencer(ctx sdk.Context, addr sdk.ValAddress) (sequencer stakingtypes.Validator, found bool)
--------------------------------- GETTERS --------------------------------

get a single sequencer

func (Keeper) GetSequencerByConsAddr

func (k Keeper) GetSequencerByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (sequencer stakingtypes.Validator, found bool)

get a single sequencer by consensus address

func (Keeper) GetValidatorByConsAddr

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

get a single validator by consensus address

func (Keeper) HistoricalEntries

func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32)

HistoricalEntries = number of historical info entries to persist in store

func (Keeper) IterateHistoricalInfo

func (k Keeper) IterateHistoricalInfo(ctx sdk.Context, cb func(stakingtypes.HistoricalInfo) bool)

IterateHistoricalInfo provides an interator over all stored HistoricalInfo

objects. For each HistoricalInfo object, cb will be called. If the cb returns

true, the iterator will close and stop.

func (Keeper) Logger

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

func (Keeper) SetDymintSequencers

func (k Keeper) SetDymintSequencers(ctx sdk.Context, sequencers []abci.ValidatorUpdate)

set dymint sequencers from InitChain

func (Keeper) SetHistoricalInfo

func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *stakingtypes.HistoricalInfo)

SetHistoricalInfo sets the historical info at a given height

func (Keeper) SetParams

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

SetParams sets the sequencers parameters to the param space.

func (Keeper) SetSequencer

func (k Keeper) SetSequencer(ctx sdk.Context, sequencer stakingtypes.Validator)
--------------------------------- SETTERS --------------------------------

set the main record holding sequencer details

func (Keeper) SetSequencerByConsAddr

func (k Keeper) SetSequencerByConsAddr(ctx sdk.Context, sequencer stakingtypes.Validator) error

func (Keeper) TrackHistoricalInfo

func (k Keeper) TrackHistoricalInfo(ctx sdk.Context)

TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height

func (Keeper) UnbondingTime

func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration)

UnbondingTime

type Querier

type Querier struct {
	Keeper
}

func (Querier) Params

func (Querier) Sequencer

Sequencer queries sequencer info for given sequencer address.

func (Querier) Sequencers

Sequencers queries all sequencers that match the given status.

type StakingKeeper

type StakingKeeper interface {
	GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
	GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, found bool)
	UnbondingTime(ctx sdk.Context) time.Duration
}

StakingKeeper returns the historical headers kept in store.

Jump to

Keyboard shortcuts

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