keeper

package
v0.30.3 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryServer

func NewQueryServer(k Keeper) v1.QueryServer

Types

type EpochStorageKeeper

type EpochStorageKeeper interface {
	IsEpochStart(ctx sdk.Context) bool
	GetEpochStart(ctx sdk.Context) (epochStartBlock uint64)
	GetDeletedEpochs(ctx sdk.Context) []uint64
}

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func (Keeper) BeginBlock

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

func (Keeper) DeleteDowntime

func (k Keeper) DeleteDowntime(ctx sdk.Context, height uint64)

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) (*v1.GenesisState, error)

func (Keeper) GarbageCollectDowntimes

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

GarbageCollectDowntimes will garbage collect downtimes.

func (Keeper) GetDowntime

func (k Keeper) GetDowntime(ctx sdk.Context, epochStartBlock uint64) (time.Duration, bool)

func (Keeper) GetDowntimeFactor

func (k Keeper) GetDowntimeFactor(ctx sdk.Context, epoch uint64) uint64

func (Keeper) GetLastBlockTime

func (k Keeper) GetLastBlockTime(ctx sdk.Context) (time.Time, bool)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params v1.Params)

func (Keeper) ImportGenesis

func (k Keeper) ImportGenesis(ctx sdk.Context, gs *v1.GenesisState) error

func (Keeper) IterateDowntimes

func (k Keeper) IterateDowntimes(ctx sdk.Context, startHeight, endHeight uint64, onResult func(height uint64, duration time.Duration) (stop bool))

IterateDowntimes will iterate over all downtimes between the provided heights, it is inclusive on both ends. Will stop iteration when the callback returns true.

func (Keeper) RecordDowntime

func (k Keeper) RecordDowntime(ctx sdk.Context, duration time.Duration)

RecordDowntime will record a downtime for the current block

func (Keeper) SetDowntime

func (k Keeper) SetDowntime(ctx sdk.Context, epochStartBlock uint64, duration time.Duration)

func (Keeper) SetLastBlockTime

func (k Keeper) SetLastBlockTime(ctx sdk.Context, t time.Time)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params v1.Params)

Jump to

Keyboard shortcuts

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