Documentation ¶
Index ¶
- func NewQuerier(k Keeper) sdk.Querier
- type Keeper
- func (k Keeper) ApplyUpgrade(ctx sdk.Context, plan types.Plan)
- func (k Keeper) ClearUpgradePlan(ctx sdk.Context)
- func (k Keeper) GetDoneHeight(ctx sdk.Context, name string) int64
- func (k Keeper) GetUpgradePlan(ctx sdk.Context) (plan types.Plan, havePlan bool)
- func (k Keeper) HasHandler(name string) bool
- func (k Keeper) IsSkipHeight(height int64) bool
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ScheduleUpgrade(ctx sdk.Context, plan types.Plan) error
- func (k Keeper) SetUpgradeHandler(name string, upgradeHandler types.UpgradeHandler)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
NewQuerier creates a querier for upgrade cli and REST endpoints
Types ¶
type Keeper ¶
func NewKeeper ¶
func NewKeeper(skipUpgradeHeights map[int64]bool, storeKey sdk.StoreKey, cdc *codec.Codec, gravityKeeper gravity.Keeper) Keeper
NewKeeper constructs an upgrade Keeper
func (Keeper) ApplyUpgrade ¶
ApplyUpgrade will execute the handler associated with the Plan and mark the plan as done.
func (Keeper) ClearUpgradePlan ¶
ClearUpgradePlan clears any schedule upgrade
func (Keeper) GetDoneHeight ¶
GetDoneHeight returns the height at which the given upgrade was executed
func (Keeper) GetUpgradePlan ¶
GetUpgradePlan returns the currently scheduled Plan if any, setting havePlan to true if there is a scheduled upgrade or false if there is none
func (Keeper) HasHandler ¶
HasHandler returns true iff there is a handler registered for this name
func (Keeper) IsSkipHeight ¶
IsSkipHeight checks if the given height is part of skipUpgradeHeights
func (Keeper) ScheduleUpgrade ¶
ScheduleUpgrade schedules an upgrade based on the specified plan. If there is another Plan already scheduled, it will overwrite it (implicitly cancelling the current plan)
func (Keeper) SetUpgradeHandler ¶
func (k Keeper) SetUpgradeHandler(name string, upgradeHandler types.UpgradeHandler)
SetUpgradeHandler sets an UpgradeHandler for the upgrade specified by name. This handler will be called when the upgrade with this name is applied. In order for an upgrade with the given name to proceed, a handler for this upgrade must be set even if it is a no-op function.