Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type Keeper
- func (k Keeper) GetAllParamsHistory(ctx context.Context) []types.ParamsUpdate
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetParams(ctx context.Context) (params types.Params)
- func (k Keeper) GetParamsAtHeight(ctx context.Context, queryHeight int64) types.Params
- func (k Keeper) GetProofWindowCloseHeight(ctx context.Context, queryHeight int64) int64
- func (k Keeper) GetSessionEndHeight(ctx context.Context, queryHeight int64) int64
- func (k Keeper) GetSessionNumber(ctx context.Context, queryHeight int64) int64
- func (k Keeper) GetSessionStartHeight(ctx context.Context, queryHeight int64) int64
- func (k Keeper) Logger() log.Logger
- func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k Keeper) SetParamsAtHeight(ctx context.Context, effectiveHeight int64, params types.Params) error
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, storeService store.KVStoreService, logger log.Logger, authority string, ) Keeper
func (Keeper) GetAllParamsHistory ¶ added in v0.1.31
func (k Keeper) GetAllParamsHistory(ctx context.Context) []types.ParamsUpdate
GetAllParamsHistory returns all historical session params updates. This is primarily used for genesis export and debugging.
func (Keeper) GetAuthority ¶
GetAuthority returns the module's authority.
func (Keeper) GetParamsAtHeight ¶ added in v0.1.31
GetParamsAtHeight returns the session params that were effective at the given height. It finds the most recent params entry where effective_height <= queryHeight. If no historical params exist, it returns the current params (backwards compatible).
func (Keeper) GetProofWindowCloseHeight ¶
GetProofWindowCloseHeight returns the block height at which the proof window of the session that includes queryHeight closes, given the passed sharedParams.
func (Keeper) GetSessionEndHeight ¶
GetSessionEndHeight returns the block height at which the session containing queryHeight ends, given the current shared onchain parameters. Returns 0 if the block height is not a consensus produced block. Example: If NumBlocksPerSession == 4, sessions end at blocks 4, 8, 11, etc.
func (Keeper) GetSessionNumber ¶
GetSessionNumber returns the session number for the session containing queryHeight, given the current shared onchain parameters. Returns session number 0 if the block height is not a consensus produced block. Returns session number 1 for block 1 to block NumBlocksPerSession - 1 (inclusive). i.e. If NubBlocksPerSession == 4, session == 1 for [1, 4], session == 2 for [5, 8], etc.
func (Keeper) GetSessionStartHeight ¶
GetSessionStartHeight returns the block height at which the session containing queryHeight starts, given the current shared onchain parameters. Returns 0 if the block height is not a consensus produced block. Example: If NumBlocksPerSession == 4, sessions start at blocks 1, 5, 9, etc.
func (Keeper) Params ¶
func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) SetParamsAtHeight ¶ added in v0.1.31
func (k Keeper) SetParamsAtHeight(ctx context.Context, effectiveHeight int64, params types.Params) error
SetParamsAtHeight stores a snapshot of session params with their effective height. This enables historical lookups of params that were active at a given block height.