upgrade

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName                        = types.ModuleName
	RouterKey                         = types.RouterKey
	StoreKey                          = types.StoreKey
	QuerierKey                        = types.QuerierKey
	PlanByte                          = types.PlanByte
	DoneByte                          = types.DoneByte
	ProposalTypeSoftwareUpgrade       = types.ProposalTypeSoftwareUpgrade
	ProposalTypeCancelSoftwareUpgrade = types.ProposalTypeCancelSoftwareUpgrade
	QueryCurrent                      = types.QueryCurrent
	QueryApplied                      = types.QueryApplied
)

Variables

View Source
var (
	// functions aliases
	RegisterCodec                    = types.RegisterCodec
	PlanKey                          = types.PlanKey
	NewSoftwareUpgradeProposal       = types.NewSoftwareUpgradeProposal
	NewCancelSoftwareUpgradeProposal = types.NewCancelSoftwareUpgradeProposal
	NewQueryAppliedParams            = types.NewQueryAppliedParams
	NewKeeper                        = keeper.NewKeeper
	NewQuerier                       = keeper.NewQuerier
)

Functions

func BeginBlocker

func BeginBlocker(k keeper.Keeper, ctx sdk.Context, _ abci.RequestBeginBlock)

BeginBlock will check if there is a scheduled plan and if it is ready to be executed. If the current height is in the provided set of heights to skip, it will skip and clear the upgrade plan. If it is ready, it will execute it if the handler is installed, and panic/abort otherwise. If the plan is not ready, it will ensure the handler is not registered too early (and abort otherwise).

The purpose is to ensure the binary is switched EXACTLY at the desired block, and to allow a migration to be executed if needed upon this switch (migration defined in the new binary) skipUpgradeHeightArray is a set of block heights for which the upgrade must be skipped

func NewSoftwareUpgradeProposalHandler

func NewSoftwareUpgradeProposalHandler(k keeper.Keeper) govtypes.Handler

NewSoftwareUpgradeProposalHandler creates a governance handler to manage new proposal types. It enables SoftwareUpgradeProposal to propose an Upgrade, and CancelSoftwareUpgradeProposal to abort a previously voted upgrade.

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements the sdk.AppModule interface

func NewAppModule

func NewAppModule(keeper keeper.Keeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)

BeginBlock calls the upgrade module hooks

CONTRACT: this is registered in BeginBlocker *before* all other modules' BeginBlock functions

func (AppModule) EndBlock

EndBlock does nothing

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(_ sdk.Context) json.RawMessage

ExportGenesis is always empty, as InitGenesis does nothing either

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, _ json.RawMessage) []abci.ValidatorUpdate

InitGenesis is ignored, no sense in serializing future upgrades

func (AppModule) NewHandler

func (AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler registers a query handler to respond to the module-specific queries

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute returns the route we respond to for abci queries

func (AppModule) RegisterInvariants

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants does nothing, there are no invariants to enforce

func (AppModule) Route

func (AppModule) Route() string

Route is empty, as we do not handle Messages (just proposals)

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic implements the sdk.AppModuleBasic interface

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

DefaultGenesis is an empty object

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

GetQueryCmd returns the cli query commands for this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

GetTxCmd returns the transaction commands for this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the ModuleName

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the upgrade types on the amino codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, r *mux.Router)

RegisterRESTRoutes registers all REST query handlers

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(_ json.RawMessage) error

ValidateGenesis is always successful, as we ignore the value

type CancelSoftwareUpgradeProposal

type CancelSoftwareUpgradeProposal = types.CancelSoftwareUpgradeProposal

type Keeper

type Keeper = keeper.Keeper

type Plan

type Plan = types.Plan

type QueryAppliedParams

type QueryAppliedParams = types.QueryAppliedParams

type SoftwareUpgradeProposal

type SoftwareUpgradeProposal = types.SoftwareUpgradeProposal

type UpgradeHandler

type UpgradeHandler = types.UpgradeHandler // nolint

type UpgradeInfo

type UpgradeInfo = types.UpgradeInfo

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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