cosmos-sdk: Index | Files

package keeper

import ""


Package Files

grpc_query.go keeper.go querier.go


const UpgradeInfoFileName string = "upgrade-info.json"

UpgradeInfoFileName file to store upgrade information

func NewQuerier Uses

func NewQuerier(k Keeper, legacyQuerierCdc codec.JSONMarshaler) sdk.Querier

NewQuerier creates a querier for upgrade cli and REST endpoints

type Keeper Uses

type Keeper struct {
    // contains filtered or unexported fields

func NewKeeper Uses

func NewKeeper(skipUpgradeHeights map[int64]bool, storeKey sdk.StoreKey, cdc codec.BinaryMarshaler, homePath string) Keeper

NewKeeper constructs an upgrade Keeper

func (Keeper) AppliedPlan Uses

func (k Keeper) AppliedPlan(c context.Context, req *types.QueryAppliedPlanRequest) (*types.QueryAppliedPlanResponse, error)

AppliedPlan implements the Query/AppliedPlan gRPC method

func (Keeper) ApplyUpgrade Uses

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) ClearUpgradePlan Uses

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

ClearUpgradePlan clears any schedule upgrade

func (Keeper) CurrentPlan Uses

func (k Keeper) CurrentPlan(c context.Context, req *types.QueryCurrentPlanRequest) (*types.QueryCurrentPlanResponse, error)

CurrentPlan implements the Query/CurrentPlan gRPC method

func (Keeper) DumpUpgradeInfoToDisk Uses

func (k Keeper) DumpUpgradeInfoToDisk(height int64, name string) error

DumpUpgradeInfoToDisk writes upgrade information to UpgradeInfoFileName.

func (Keeper) GetDoneHeight Uses

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

GetDoneHeight returns the height at which the given upgrade was executed

func (Keeper) GetUpgradeInfoPath Uses

func (k Keeper) GetUpgradeInfoPath() (string, error)

GetUpgradeInfoPath returns the upgrade info file path

func (Keeper) GetUpgradePlan Uses

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) HasHandler Uses

func (k Keeper) HasHandler(name string) bool

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

func (Keeper) IsSkipHeight Uses

func (k Keeper) IsSkipHeight(height int64) bool

IsSkipHeight checks if the given height is part of skipUpgradeHeights

func (Keeper) Logger Uses

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

Logger returns a module-specific logger.

func (Keeper) ReadUpgradeInfoFromDisk Uses

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 Uses

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 Uses

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.

Package keeper imports 17 packages (graph) and is imported by 2 packages. Updated 2020-07-26. Refresh now. Tools for package owners.