Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) DeleteHistoricalInfo(ctx sdk.Context, height int64)
- func (k Keeper) DeleteSequencer(ctx sdk.Context, sequencer stakingtypes.Validator)
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetAllHistoricalInfo(ctx sdk.Context) []stakingtypes.HistoricalInfo
- func (k Keeper) GetAllSequencers(ctx sdk.Context) (sequencers []stakingtypes.Validator)
- func (k Keeper) GetHistoricalInfo(ctx sdk.Context, height int64) (stakingtypes.HistoricalInfo, bool)
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetSequencer(ctx sdk.Context, addr sdk.ValAddress) (sequencer stakingtypes.Validator, found bool)
- func (k Keeper) GetSequencerByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (sequencer stakingtypes.Validator, found bool)
- func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, found bool)
- func (k Keeper) HistoricalEntries(ctx sdk.Context) (res uint32)
- func (k *Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) []abci.ValidatorUpdate
- func (k Keeper) IterateHistoricalInfo(ctx sdk.Context, cb func(stakingtypes.HistoricalInfo) bool)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) SetDymintSequencers(ctx sdk.Context, sequencers []abci.ValidatorUpdate)
- func (k Keeper) SetHistoricalInfo(ctx sdk.Context, height int64, hi *stakingtypes.HistoricalInfo)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetSequencer(ctx sdk.Context, sequencer stakingtypes.Validator)
- func (k Keeper) SetSequencerByConsAddr(ctx sdk.Context, sequencer stakingtypes.Validator) error
- func (k Keeper) TrackHistoricalInfo(ctx sdk.Context)
- func (k Keeper) UnbondingTime(ctx sdk.Context) (res time.Duration)
- type Querier
- func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error)
- func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Querier) Sequencer(c context.Context, req *types.QuerySequencerRequest) (*types.QuerySequencerResponse, error)
- func (k Querier) Sequencers(c context.Context, req *types.QuerySequencersRequest) (*types.QuerySequencersResponse, error)
- type StakingKeeper
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 ¶
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) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the sequencers module's exported genesis.
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) 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 ¶
HistoricalEntries = number of historical info entries to persist in store
func (*Keeper) InitGenesis ¶
func (k *Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) []abci.ValidatorUpdate
InitGenesis initializes the sequencers module's state from a provided genesis state. We return the for ValidatorUpdate only the sequencers set by dymint
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) SetDymintSequencers ¶
func (k Keeper) SetDymintSequencers(ctx sdk.Context, sequencers []abci.ValidatorUpdate)
SetDymintSequencers sets the sequencers set by dymint on InitChain. As currently we're using the abci InitChain, there are 2 obstacles we need to face, unlike when creating a validator: 1. InitChain expected the validatorUpdate it gets in return to be the same as it sends 2. We need someway to set the operator address, which is the address that will be used for rewards for the sequencer. To overcome those obstacles, we do the following:
- Upon InitChain, call SetDymintSequencers and create a dummy sequencer object with the consensus pubkey and power we get from the validatorUpdate.
- Afterwards, upon initGenesis, we build a validator-like object where the operator address is the one we set in the genesis file and the consensus pubkey and power are the ones we set in the dummy sequencer object.
At the end we delete the dummy sequencer object.
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) SetSequencer ¶
func (k Keeper) SetSequencer(ctx sdk.Context, sequencer stakingtypes.Validator)
--------------------------------- SETTERS --------------------------------
set the main record holding sequencer details
func (Keeper) SetSequencerByConsAddr ¶
func (Keeper) TrackHistoricalInfo ¶
TrackHistoricalInfo saves the latest historical-info and deletes the oldest heights that are below pruning height
type Querier ¶
type Querier struct {
Keeper
}
func (Querier) HistoricalInfo ¶
func (k Querier) HistoricalInfo(c context.Context, req *types.QueryHistoricalInfoRequest) (*types.QueryHistoricalInfoResponse, error)
func (Querier) Params ¶
func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Querier) Sequencer ¶
func (k Querier) Sequencer(c context.Context, req *types.QuerySequencerRequest) (*types.QuerySequencerResponse, error)
Sequencer queries sequencer info for given sequencer address.
func (Querier) Sequencers ¶
func (k Querier) Sequencers(c context.Context, req *types.QuerySequencersRequest) (*types.QuerySequencersResponse, error)
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.