keeper

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 13 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 {
	GetParams(ctx sdk.Context) (params epochstoragetypes.Params)
}

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) GCBlocks added in v0.20.4

func (k Keeper) GCBlocks(ctx sdk.Context) uint64

GCBlocks returns the number of blocks a downtime should live.

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, height uint64) (time.Duration, bool)

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) HadDowntimeBetween added in v0.20.4

func (k Keeper) HadDowntimeBetween(ctx sdk.Context, startHeight, endHeight uint64) (bool, time.Duration)

HadDowntimeBetween will return true if we had downtimes between the provided heights. The query is inclusive on both ends. The duration returned is the total downtime duration.

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) IterateGarbageCollections added in v0.20.4

func (k Keeper) IterateGarbageCollections(ctx sdk.Context, onResult func(height, gcBlock uint64) (stop bool))

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, height uint64, duration time.Duration)

func (Keeper) SetDowntimeGarbageCollection added in v0.20.4

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

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