keeper

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

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.Codec, storeKey storetypes.StoreKey) *Keeper

func (Keeper) AddEpoch

func (k Keeper) AddEpoch(ctx sdk.Context, epoch types.Epoch) error

SetEpoch set a specific epoch in the store

func (Keeper) AfterEpochEnd

func (k Keeper) AfterEpochEnd(ctx sdk.Context, identifier string, epochNumber int64)

func (Keeper) AllEpoch

func (k Keeper) AllEpoch(ctx sdk.Context) []types.Epoch

AllEpochs returns all epoch

func (Keeper) BeforeEpochStart

func (k Keeper) BeforeEpochStart(ctx sdk.Context, identifier string, epochNumber int64)

func (Keeper) BeginBlocker

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

func (Keeper) DeleteEpoch

func (k Keeper) DeleteEpoch(ctx sdk.Context, id string)

DeleteEpoch removes a epoch from the store

func (Keeper) GetEpoch

func (k Keeper) GetEpoch(ctx sdk.Context, id string) types.Epoch

GetEpoch returns a epoch from its id

func (Keeper) IterateEpochs

func (k Keeper) IterateEpochs(ctx sdk.Context, fn func(index int64, epoch types.Epoch) (stop bool))

func (Keeper) Logger

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

func (Keeper) SetEpoch

func (k Keeper) SetEpoch(ctx sdk.Context, epoch types.Epoch)

SetEpoch set a specific epoch in the store

func (*Keeper) SetHooks

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

func (Keeper) TotalBlockAfterEpochStart

func (k Keeper) TotalBlockAfterEpochStart(ctx sdk.Context, identifier string) (int64, error)

TotalBlockAfterEpochStart 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.

Jump to

Keyboard shortcuts

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