keeper

package
v0.0.0-...-f498596 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a querier for upgrade cli and REST endpoints

Types

type Keeper

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

func NewKeeper

func NewKeeper(skipUpgradeHeights map[int64]bool, storeKey sdk.StoreKey, cdc *codec.Codec) Keeper

NewKeeper constructs an upgrade Keeper

func (Keeper) ApplyUpgrade

func (k Keeper) ApplyUpgrade(ctx sdk.Context, plan types.Plan)

ApplyUpgrade will execute the handler associated with the Plan and mark the plan as done.

func (Keeper) ClearIBCState

func (k Keeper) ClearIBCState(ctx sdk.Context, lastHeight int64)

ClearIBCState clears any planned IBC state

func (Keeper) ClearUpgradePlan

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

ClearUpgradePlan clears any schedule upgrade

func (Keeper) GetDoneHeight

func (k Keeper) GetDoneHeight(ctx sdk.Context, name string) int64

GetDoneHeight returns the height at which the given upgrade was executed

func (Keeper) GetUpgradePlan

func (k Keeper) GetUpgradePlan(ctx sdk.Context) (plan types.Plan, havePlan bool)

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) GetUpgradedClient

func (k Keeper) GetUpgradedClient(ctx sdk.Context, height int64) ([]byte, bool)

GetUpgradedClient gets the expected upgraded client for the next version of this chain

func (Keeper) GetUpgradedConsensusState

func (k Keeper) GetUpgradedConsensusState(ctx sdk.Context, lastHeight int64) ([]byte, bool)

GetUpgradedConsensusState set the expected upgraded consensus state for the next version of this chain

func (Keeper) HasHandler

func (k Keeper) HasHandler(name string) bool

HasHandler returns true iff there is a handler registered for this name

func (Keeper) IsSkipHeight

func (k Keeper) IsSkipHeight(height int64) bool

IsSkipHeight checks if the given height is part of skipUpgradeHeights

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) ScheduleUpgrade

func (k Keeper) ScheduleUpgrade(ctx sdk.Context, plan types.Plan) error

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.

func (Keeper) SetUpgradedClient

func (k Keeper) SetUpgradedClient(ctx sdk.Context, planHeight int64, bz []byte) error

SetUpgradedClient sets the expected upgraded client for the next version of this chain at the last height the current chain will commit.

func (Keeper) SetUpgradedConsensusState

func (k Keeper) SetUpgradedConsensusState(ctx sdk.Context, planHeight int64, bz []byte) error

SetUpgradedConsensusState set the expected upgraded consensus state for the next version of this chain using the last height committed on this chain.

Jump to

Keyboard shortcuts

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