Documentation ¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AllDowntimeInfo(c context.Context, req *types.QueryAllDowntimeInfoRequest) (*types.QueryAllDowntimeInfoResponse, error)
- func (k Keeper) DowntimeParams(c context.Context, req *types.QueryDowntimeParamsRequest) (*types.QueryDowntimeParamsResponse, error)
- func (k Keeper) GetAllDowntimeInfo(ctx sdk.Context) *types.AllDowntimeInfo
- func (k Keeper) GetDowntimeInfoFor(ctx sdk.Context, duration time.Duration) types.AllDowntimeInfo_DowntimeInfo
- func (k Keeper) GetDowntimeParams(ctx sdk.Context) (params types.DowntimeParams)
- func (k Keeper) GetPreviousBlockInfo(ctx sdk.Context) types.BlockInfo
- func (k Keeper) HasAuthority(authority string) bool
- func (k Keeper) InitializeForGenesis(ctx sdk.Context)
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) PreviousBlockInfo(c context.Context, req *types.QueryPreviousBlockInfoRequest) (*types.QueryPreviousBlockInfoResponse, error)
- func (k Keeper) SetAllDowntimeInfo(ctx sdk.Context, info *types.AllDowntimeInfo)
- func (k Keeper) SetDowntimeParams(ctx sdk.Context, params types.DowntimeParams) error
- func (k Keeper) SetPreviousBlockInfo(ctx sdk.Context, info *types.BlockInfo)
- func (k Keeper) UpdateAllDowntimeInfo(ctx sdk.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
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) AllDowntimeInfo ¶
func (k Keeper) AllDowntimeInfo( c context.Context, req *types.QueryAllDowntimeInfoRequest, ) ( *types.QueryAllDowntimeInfoResponse, error, )
func (Keeper) DowntimeParams ¶
func (k Keeper) DowntimeParams( c context.Context, req *types.QueryDowntimeParamsRequest, ) ( *types.QueryDowntimeParamsResponse, error, )
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 (Keeper) HasAuthority ¶
func (Keeper) InitializeForGenesis ¶
func (Keeper) PreviousBlockInfo ¶
func (k Keeper) PreviousBlockInfo( c context.Context, req *types.QueryPreviousBlockInfoRequest, ) ( *types.QueryPreviousBlockInfoResponse, error, )
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 ¶
SetParams updates the Params in state. Returns an error iff validation fails.
func (Keeper) SetPreviousBlockInfo ¶
func (Keeper) UpdateAllDowntimeInfo ¶
UpdateAllDowntimeInfo updates AllDowntimeInfo by considering the downtime between the current block and the previous block and updating the DowntimeInfo for each observed duration.