Documentation ¶
Index ¶
- Constants
- func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier
- type Keeper
- func (k Keeper) AppliedPlan(c context.Context, req *types.QueryAppliedPlanRequest) (*types.QueryAppliedPlanResponse, error)
- func (k Keeper) ApplyUpgrade(ctx sdk.Context, plan types.Plan)
- func (k Keeper) ClearIBCState(ctx sdk.Context, lastHeight int64)
- func (k Keeper) ClearUpgradePlan(ctx sdk.Context)
- func (k Keeper) CurrentPlan(c context.Context, req *types.QueryCurrentPlanRequest) (*types.QueryCurrentPlanResponse, error)
- func (k Keeper) DumpUpgradeInfoToDisk(height int64, name string) error
- func (k Keeper) GetDoneHeight(ctx sdk.Context, name string) int64
- func (k Keeper) GetUpgradeInfoPath() (string, error)
- func (k Keeper) GetUpgradePlan(ctx sdk.Context) (plan types.Plan, havePlan bool)
- func (k Keeper) GetUpgradedClient(ctx sdk.Context, height int64) (ibcexported.ClientState, error)
- func (k Keeper) GetUpgradedConsensusState(ctx sdk.Context, lastHeight int64) (ibcexported.ConsensusState, error)
- 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) ReadUpgradeInfoFromDisk() (store.UpgradeInfo, error)
- func (k Keeper) ScheduleUpgrade(ctx sdk.Context, plan types.Plan) error
- func (k Keeper) SetUpgradeHandler(name string, upgradeHandler types.UpgradeHandler)
- func (k Keeper) SetUpgradedClient(ctx sdk.Context, planHeight int64, cs ibcexported.ClientState) error
- func (k Keeper) SetUpgradedConsensusState(ctx sdk.Context, planHeight int64, cs ibcexported.ConsensusState) error
- func (k Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error)
Constants ¶
const UpgradeInfoFileName string = "upgrade-info.json"
UpgradeInfoFileName file to store upgrade information
Variables ¶
This section is empty.
Functions ¶
func NewQuerier ¶
func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) 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.BinaryMarshaler, homePath string) Keeper
NewKeeper constructs an upgrade Keeper
func (Keeper) AppliedPlan ¶ added in v0.40.0
func (k Keeper) AppliedPlan(c context.Context, req *types.QueryAppliedPlanRequest) (*types.QueryAppliedPlanResponse, error)
AppliedPlan implements the Query/AppliedPlan gRPC method
func (Keeper) ApplyUpgrade ¶
ApplyUpgrade will execute the handler associated with the Plan and mark the plan as done.
func (Keeper) ClearIBCState ¶ added in v0.40.0
ClearIBCState clears any planned IBC state
func (Keeper) ClearUpgradePlan ¶
ClearUpgradePlan clears any schedule upgrade
func (Keeper) CurrentPlan ¶ added in v0.40.0
func (k Keeper) CurrentPlan(c context.Context, req *types.QueryCurrentPlanRequest) (*types.QueryCurrentPlanResponse, error)
CurrentPlan implements the Query/CurrentPlan gRPC method
func (Keeper) DumpUpgradeInfoToDisk ¶
DumpUpgradeInfoToDisk writes upgrade information to UpgradeInfoFileName.
func (Keeper) GetDoneHeight ¶
GetDoneHeight returns the height at which the given upgrade was executed
func (Keeper) GetUpgradeInfoPath ¶
GetUpgradeInfoPath returns the upgrade info file path
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) GetUpgradedClient ¶ added in v0.40.0
func (k Keeper) GetUpgradedClient(ctx sdk.Context, height int64) (ibcexported.ClientState, error)
GetUpgradedClient gets the expected upgraded client for the next version of this chain
func (Keeper) GetUpgradedConsensusState ¶ added in v0.40.0
func (k Keeper) GetUpgradedConsensusState(ctx sdk.Context, lastHeight int64) (ibcexported.ConsensusState, error)
GetUpgradedConsensusState set the expected upgraded consensus state for the next version of this chain
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) ReadUpgradeInfoFromDisk ¶
func (k Keeper) ReadUpgradeInfoFromDisk() (store.UpgradeInfo, error)
ReadUpgradeInfoFromDisk returns the name and height of the upgrade which is written to disk by the old binary when panicking. An error is returned if the upgrade path directory cannot be created or if the file exists and cannot be read or if the upgrade info fails to unmarshal.
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) ScheduleUpgrade will also write the upgraded client to the upgraded client path if an upgraded client is specified in the 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 ¶ added in v0.40.0
func (k Keeper) SetUpgradedClient(ctx sdk.Context, planHeight int64, cs ibcexported.ClientState) 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 ¶ added in v0.40.0
func (k Keeper) SetUpgradedConsensusState(ctx sdk.Context, planHeight int64, cs ibcexported.ConsensusState) error
SetUpgradedConsensusState set the expected upgraded consensus state for the next version of this chain using the last height committed on this chain.
func (Keeper) UpgradedConsensusState ¶ added in v0.40.0
func (k Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error)
UpgradedConsensusState implements the Query/UpgradedConsensusState gRPC method