Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(k *Keeper) types.MsgServer
- type Keeper
- func (k Keeper) AppliedPlan(c context.Context, req *types.QueryAppliedPlanRequest) (*types.QueryAppliedPlanResponse, error)
- func (k Keeper) ApplyUpgrade(ctx context.Context, plan types.Plan) error
- func (k Keeper) Authority(c context.Context, req *types.QueryAuthorityRequest) (*types.QueryAuthorityResponse, error)
- func (k Keeper) ClearIBCState(ctx context.Context, lastHeight int64) error
- func (k Keeper) ClearUpgradePlan(ctx context.Context) error
- func (k Keeper) CurrentPlan(c context.Context, req *types.QueryCurrentPlanRequest) (*types.QueryCurrentPlanResponse, error)
- func (k Keeper) DowngradeVerified() bool
- func (k Keeper) DumpUpgradeInfoToDisk(height int64, p types.Plan) error
- func (k Keeper) GetDoneHeight(ctx context.Context, name string) (int64, error)
- func (k *Keeper) GetInitVersionMap() module.VersionMap
- func (k Keeper) GetLastCompletedUpgrade(ctx context.Context) (string, int64, error)
- func (k Keeper) GetModuleVersionMap(ctx context.Context) (module.VersionMap, error)
- func (k Keeper) GetModuleVersions(ctx context.Context) ([]*types.ModuleVersion, error)
- func (k Keeper) GetUpgradeInfoPath() (string, error)
- func (k Keeper) GetUpgradePlan(ctx context.Context) (plan types.Plan, err error)
- func (k Keeper) GetUpgradedClient(ctx context.Context, height int64) ([]byte, error)
- func (k Keeper) GetUpgradedConsensusState(ctx context.Context, lastHeight int64) ([]byte, error)
- func (k *Keeper) GetVersionSetter() xp.ProtocolVersionSetter
- func (k Keeper) HasHandler(name string) bool
- func (k Keeper) IsSkipHeight(height int64) bool
- func (k Keeper) Logger(ctx context.Context) log.Logger
- func (k Keeper) ModuleVersions(c context.Context, req *types.QueryModuleVersionsRequest) (*types.QueryModuleVersionsResponse, error)
- func (k Keeper) ReadUpgradeInfoFromDisk() (types.Plan, error)
- func (k Keeper) ScheduleUpgrade(ctx context.Context, plan types.Plan) error
- func (k *Keeper) SetDowngradeVerified(v bool)
- func (k *Keeper) SetInitVersionMap(vm module.VersionMap)
- func (k Keeper) SetModuleVersionMap(ctx context.Context, vm module.VersionMap) error
- func (k Keeper) SetUpgradeHandler(name string, upgradeHandler types.UpgradeHandler)
- func (k Keeper) SetUpgradedClient(ctx context.Context, planHeight int64, bz []byte) error
- func (k Keeper) SetUpgradedConsensusState(ctx context.Context, planHeight int64, bz []byte) error
- func (k *Keeper) SetVersionSetter(vs xp.ProtocolVersionSetter)
- func (k Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error)
- type Migrator
Constants ¶
const UpgradeInfoFileName string = "upgrade-info.json"
Deprecated: UpgradeInfoFileName file to store upgrade information use x/upgrade/types.UpgradeInfoFilename instead.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper(skipUpgradeHeights map[int64]bool, storeService corestore.KVStoreService, cdc codec.BinaryCodec, homePath string, vs xp.ProtocolVersionSetter, authority string) *Keeper
NewKeeper constructs an upgrade Keeper which requires the following arguments: skipUpgradeHeights - map of heights to skip an upgrade storeKey - a store key with which to access upgrade's store cdc - the app-wide binary codec homePath - root directory of the application's config vs - the interface implemented by baseapp which allows setting baseapp's protocol version field
func (Keeper) AppliedPlan ¶
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) Authority ¶
func (k Keeper) Authority(c context.Context, req *types.QueryAuthorityRequest) (*types.QueryAuthorityResponse, error)
Authority implements the Query/Authority gRPC method, returning the account capable of performing upgrades
func (Keeper) ClearIBCState ¶
ClearIBCState clears any planned IBC state
func (Keeper) ClearUpgradePlan ¶
ClearUpgradePlan clears any schedule upgrade and associated IBC states.
func (Keeper) CurrentPlan ¶
func (k Keeper) CurrentPlan(c context.Context, req *types.QueryCurrentPlanRequest) (*types.QueryCurrentPlanResponse, error)
CurrentPlan implements the Query/CurrentPlan gRPC method
func (Keeper) DowngradeVerified ¶
DowngradeVerified returns downgradeVerified.
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) GetInitVersionMap ¶
func (k *Keeper) GetInitVersionMap() module.VersionMap
GetInitVersionMap gets the initial version map This is only used in upgrade InitGenesis and should not be used in any other context.
func (Keeper) GetLastCompletedUpgrade ¶
GetLastCompletedUpgrade returns the last applied upgrade name and height.
func (Keeper) GetModuleVersionMap ¶
GetModuleVersionMap returns a map of key module name and value module consensus version as defined in ADR-041.
func (Keeper) GetModuleVersions ¶
GetModuleVersions gets a slice of module consensus versions
func (Keeper) GetUpgradeInfoPath ¶
GetUpgradeInfoPath returns the upgrade info file path
func (Keeper) GetUpgradePlan ¶
GetUpgradePlan returns the currently scheduled Plan if any. If not found it returns ErrNoUpgradePlanFound, but other errors may be returned if there is an error reading from the store.
func (Keeper) GetUpgradedClient ¶
GetUpgradedClient gets the expected upgraded client for the next version of this chain. If not found it returns ErrNoUpgradedClientFound, but other errors may be returned if there is an error reading from the store.
func (Keeper) GetUpgradedConsensusState ¶
GetUpgradedConsensusState gets the expected upgraded consensus state for the next version of this chain. If not found it returns ErrNoUpgradedConsensusStateFound, but other errors may be returned if there is an error reading from the store.
func (*Keeper) GetVersionSetter ¶
func (k *Keeper) GetVersionSetter() xp.ProtocolVersionSetter
GetVersionSetter gets the protocol version field of baseapp
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) Logger ¶
Logger returns a module-specific logger.
func (Keeper) ModuleVersions ¶
func (k Keeper) ModuleVersions(c context.Context, req *types.QueryModuleVersionsRequest) (*types.QueryModuleVersionsResponse, error)
ModuleVersions implements the Query/QueryModuleVersions gRPC method
func (Keeper) ReadUpgradeInfoFromDisk ¶
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 cancel and overwrite it. ScheduleUpgrade will also write the upgraded IBC ClientState to the upgraded client path if it is specified in the plan.
func (*Keeper) SetDowngradeVerified ¶
SetDowngradeVerified updates downgradeVerified.
func (*Keeper) SetInitVersionMap ¶
func (k *Keeper) SetInitVersionMap(vm module.VersionMap)
SetInitVersionMap sets the initial version map. This is only used in app wiring and should not be used in any other context.
func (Keeper) SetModuleVersionMap ¶
SetModuleVersionMap saves a given version map to state
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 ¶
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 ¶
SetUpgradedConsensusState sets the expected upgraded consensus state for the next version of this chain using the last height committed on this chain.
func (*Keeper) SetVersionSetter ¶
func (k *Keeper) SetVersionSetter(vs xp.ProtocolVersionSetter)
SetVersionSetter sets the interface implemented by baseapp which allows setting baseapp's protocol version field
func (Keeper) UpgradedConsensusState ¶
func (k Keeper) UpgradedConsensusState(c context.Context, req *types.QueryUpgradedConsensusStateRequest) (*types.QueryUpgradedConsensusStateResponse, error)
UpgradedConsensusState implements the Query/UpgradedConsensusState gRPC method
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator is a struct for handling in-place store migrations.