keeper

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey storetypes.StoreKey,
	authorities []string,
) *Keeper

func (Keeper) GetAllDowntimeInfo

func (k Keeper) GetAllDowntimeInfo(ctx sdk.Context) *types.AllDowntimeInfo

func (Keeper) GetDowntimeInfoFor

func (k Keeper) GetDowntimeInfoFor(ctx sdk.Context, duration time.Duration) types.AllDowntimeInfo_DowntimeInfo

GetDowntimeInfoFor gets the DowntimeInfo for a specific duration. If the exact duration is not observed, it returns the DowntimeInfo for the largest duration that is smaller than the input duration. If the input duration is smaller than all observed durations, then return a DowntimeInfo with duration 0 and the current block's info.

func (Keeper) GetDowntimeParams

func (k Keeper) GetDowntimeParams(
	ctx sdk.Context,
) (
	params types.DowntimeParams,
)

GetParams returns the DowntimeParams in state.

func (Keeper) GetPreviousBlockInfo

func (k Keeper) GetPreviousBlockInfo(ctx sdk.Context) types.BlockInfo

func (Keeper) HasAuthority

func (k Keeper) HasAuthority(authority string) bool

func (Keeper) InitializeForGenesis

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

func (Keeper) Logger

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

func (Keeper) SetAllDowntimeInfo

func (k Keeper) SetAllDowntimeInfo(ctx sdk.Context, info *types.AllDowntimeInfo)

SetAllDowntimeInfo sets AllDowntimeInfo in state. Durations in AllDowntimeInfo must match the durations in DowntimeParams. If not, behavior of this module is undefined.

func (Keeper) SetDowntimeParams

func (k Keeper) SetDowntimeParams(
	ctx sdk.Context,
	params types.DowntimeParams,
) error

SetParams updates the Params in state. Returns an error iff validation fails.

func (Keeper) SetPreviousBlockInfo

func (k Keeper) SetPreviousBlockInfo(ctx sdk.Context, info *types.BlockInfo)

func (Keeper) UpdateAllDowntimeInfo

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

UpdateAllDowntimeInfo updates AllDowntimeInfo by considering the downtime between the current block and the previous block and updating the DowntimeInfo for each observed duration.

Jump to

Keyboard shortcuts

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