keeper

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 8 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 {
	Epochs collections.Map[string, types.EpochInfo]
	// contains filtered or unexported fields
}

func NewKeeper

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

func (Keeper) AddEpochInfo added in v0.15.0

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, identifier string, epochNumber uint64)

AfterEpochEnd epoch hook

func (Keeper) AllEpochInfos

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

AllEpochInfos iterate through epochs to return all epochs info.

func (Keeper) BeforeEpochStart

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

BeforeEpochStart epoch hook

func (Keeper) DeleteEpochInfo

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

DeleteEpochInfo delete epoch info.

func (Keeper) EpochExists added in v0.15.0

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

EpochExists checks if the epoch exists

func (Keeper) GetEpochInfo

func (k Keeper) GetEpochInfo(ctx sdk.Context, identifier string) (epoch types.EpochInfo, err error)

GetEpochInfo returns epoch info by identifier.

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

func (Querier) CurrentEpoch

CurrentEpoch provides current epoch of specified identifier.

func (Querier) EpochInfos

EpochInfos provide running epochInfos.

Jump to

Keyboard shortcuts

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