Documentation ¶
Index ¶
- type Keeper
- func (k Keeper) AddEpochInfo(ctx sdk.Context, epoch types.EpochInfo) error
- func (k Keeper) AfterEpochEnd(ctx sdk.Context, identifier string, epochNumber int64)
- func (k Keeper) AllEpochInfos(ctx sdk.Context) []types.EpochInfo
- func (k Keeper) BeforeEpochStart(ctx sdk.Context, identifier string, epochNumber int64)
- func (k Keeper) BeginBlocker(ctx sdk.Context)
- func (k Keeper) DeleteEpochInfo(ctx sdk.Context, identifier string)
- func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k Keeper) GetEpochInfo(ctx sdk.Context, identifier string) types.EpochInfo
- func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
- func (k Keeper) IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool))
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) NumBlocksSinceEpochStart(ctx sdk.Context, identifier string) (int64, error)
- func (k *Keeper) SetHooks(eh types.EpochHooks) *Keeper
- type MultiEpochHooks
- type Querier
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 (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 ¶
func (Keeper) BeforeEpochStart ¶
func (Keeper) BeginBlocker ¶
BeginBlocker of epochs module.
func (Keeper) DeleteEpochInfo ¶
DeleteEpochInfo delete epoch info.
func (Keeper) ExportGenesis ¶
func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis returns the capability module's exported genesis.
func (Keeper) GetEpochInfo ¶
GetEpochInfo returns epoch info by identifier.
func (Keeper) InitGenesis ¶
func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)
func (Keeper) IterateEpochInfo ¶
func (k Keeper) IterateEpochInfo(ctx sdk.Context, fn func(index int64, epochInfo types.EpochInfo) (stop bool))
IterateEpochInfo iterate through epochs.
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.
type MultiEpochHooks ¶
type MultiEpochHooks []types.EpochHooks
combine multiple epoch hooks, all hook functions are run in array sequence
func NewMultiEpochHooks ¶
func NewMultiEpochHooks(hooks ...types.EpochHooks) MultiEpochHooks
func (MultiEpochHooks) AfterEpochEnd ¶
func (mh MultiEpochHooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)
AfterEpochEnd is called when epoch is going to be ended, epochNumber is the number of epoch that is ending
func (MultiEpochHooks) BeforeEpochStart ¶
func (mh MultiEpochHooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
BeforeEpochStart is called when epoch is going to be started, epochNumber is the number of epoch that is starting
type Querier ¶
type Querier struct {
Keeper
}
Querier defines a wrapper around the x/epochs keeper providing gRPC method handlers.
func NewQuerier ¶
func (Querier) CurrentEpoch ¶
func (q Querier) CurrentEpoch(c context.Context, req *types.QueryCurrentEpochRequest) (*types.QueryCurrentEpochResponse, error)
CurrentEpoch provides current epoch of specified identifier.
func (Querier) EpochInfos ¶
func (q Querier) EpochInfos(c context.Context, _ *types.QueryEpochsInfoRequest) (*types.QueryEpochsInfoResponse, error)
EpochInfos provide running epochInfos.