Documentation
¶
Index ¶
- type Keeper
- func (k *Keeper) AddEpochInfo(ctx sdk.Context, epoch types.EpochInfo) error
- func (k *Keeper) AfterEpochEnd(ctx context.Context, identifier string, epochNumber int64) error
- func (k *Keeper) AllEpochInfos(ctx sdk.Context) ([]types.EpochInfo, error)
- func (k *Keeper) BeforeEpochStart(ctx context.Context, identifier string, epochNumber int64) error
- func (k *Keeper) BeginBlocker(ctx sdk.Context) error
- func (k *Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)
- func (k *Keeper) GetEpochInfo(ctx sdk.Context, identifier string) (types.EpochInfo, error)
- func (k *Keeper) Hooks() types.EpochHooks
- func (k *Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) error
- func (k *Keeper) NumBlocksSinceEpochStart(ctx sdk.Context, identifier string) (int64, error)
- func (k *Keeper) SetHooks(eh types.EpochHooks)
- type Querier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Keeper ¶
type Keeper struct { Schema collections.Schema EpochInfo collections.Map[string, types.EpochInfo] // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper(storeService store.KVStoreService, cdc codec.BinaryCodec) Keeper
NewKeeper returns a new keeper by codec and storeKey inputs.
func (*Keeper) AddEpochInfo ¶
AddEpochInfo adds a new epoch info. Will return an error if the epoch fails validation, or re-uses an existing identifier. This method also sets the start time if left unset, and sets the epoch start height.
func (*Keeper) AfterEpochEnd ¶
AfterEpochEnd gets called at the end of the epoch, end of epoch is the timestamp of first block produced after epoch duration.
func (*Keeper) AllEpochInfos ¶
AllEpochInfos iterate through epochs to return all epochs info.
func (*Keeper) BeforeEpochStart ¶
BeforeEpochStart new epoch is next block of epoch end block
func (*Keeper) BeginBlocker ¶
BeginBlocker of epochs module.
func (*Keeper) ExportGenesis ¶
ExportGenesis returns the capability module's exported genesis.
func (*Keeper) GetEpochInfo ¶
GetEpochInfo returns epoch info by identifier.
func (*Keeper) Hooks ¶
func (k *Keeper) Hooks() types.EpochHooks
Hooks gets the hooks for governance Keeper
func (*Keeper) InitGenesis ¶
InitGenesis sets epoch info from genesis
func (*Keeper) NumBlocksSinceEpochStart ¶
NumBlocksSinceEpochStart returns the number of blocks since the epoch started. if the epoch started on block N, then calling this during block N (after BeforeEpochStart) would return 0. Calling it any point in block N+1 (assuming the epoch doesn't increment) would return 1.
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(eh types.EpochHooks)
SetHooks sets the hooks on the x/epochs keeper.
type Querier ¶
type Querier struct {
Keeper
}
Querier defines a wrapper around the x/epochs keeper providing gRPC method handlers.
func (Querier) CurrentEpoch ¶
func (q Querier) CurrentEpoch(ctx context.Context, req *types.QueryCurrentEpochRequest) (*types.QueryCurrentEpochResponse, error)
CurrentEpoch provides current epoch of specified identifier.
func (Querier) EpochInfos ¶
func (q Querier) EpochInfos(ctx context.Context, _ *types.QueryEpochInfosRequest) (*types.QueryEpochInfosResponse, error)
EpochInfos provide running epochInfos.