keeper

package
v1.6.0-rc02 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0, Apache-2.0 Imports: 16 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
}

Keeper of this module maintains collections of epochs and hooks.

func NewKeeper

func NewKeeper(cdc codec.Codec, storeKey storetypes.StoreKey) *Keeper

NewKeeper returns a new instance of epochs Keeper

func (Keeper) AddEpochInfo

func (k Keeper) AddEpochInfo(ctx sdk.Context, epoch types.EpochInfo) error

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 (k Keeper) AfterEpochEnd(ctx sdk.Context, epochInfo types.EpochInfo)

AfterEpochEnd executes the indicated hook after epochs ends

func (Keeper) AllEpochInfos

func (k Keeper) AllEpochInfos(ctx sdk.Context) []types.EpochInfo

AllEpochInfos returns every epochInfo in the store

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochInfo types.EpochInfo)

BeforeEpochStart executes the indicated hook before the epochs

func (Keeper) BeginBlocker

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

BeginBlocker of epochs module

func (Keeper) CurrentEpoch

CurrentEpoch provides current epoch of specified identifier

func (Keeper) DeleteEpochInfo

func (k Keeper) DeleteEpochInfo(ctx sdk.Context, identifier string)

DeleteEpochInfo delete epoch info

func (Keeper) EpochInfo

CurrentEpoch provides current epoch of specified identifier

func (Keeper) EpochInfos

EpochInfos provide running epochInfos

func (Keeper) ExportGenesis

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

ExportGenesis returns the capability module's exported genesis.

func (Keeper) GetEpochInfo

func (k Keeper) GetEpochInfo(ctx sdk.Context, identifier string) (types.EpochInfo, bool)

GetEpochInfo returns epoch info by identifier

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState)

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

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) Logger

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

Logger returns a module-specific logger.

func (Keeper) SetEpochInfo

func (k Keeper) SetEpochInfo(ctx sdk.Context, epoch types.EpochInfo)

SetEpochInfo set epoch info

func (*Keeper) SetHooks

func (k *Keeper) SetHooks(eh types.EpochHooks) *Keeper

SetHooks set the epoch hooks

type Querier

type Querier struct {
	Keeper
}

Querier defines a wrapper around the x/epochs keeper providing gRPC method handlers.

func NewQuerier

func NewQuerier(k Keeper) Querier

NewQuerier initializes new querier.

Jump to

Keyboard shortcuts

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