Documentation ¶
Index ¶
- Constants
- func NewCancelSoftwareUpgradeProposal(title, description string) gov.Content
- func NewSoftwareUpgradeProposal(title, description string, plan Plan) gov.Content
- func PlanKey() []byte
- func RegisterCodec(cdc *codec.Codec)
- func UpgradedClientKey(height int64) []byte
- func UpgradedConsStateKey(height int64) []byte
- type CancelSoftwareUpgradeProposal
- func (sup CancelSoftwareUpgradeProposal) GetDescription() string
- func (sup CancelSoftwareUpgradeProposal) GetTitle() string
- func (sup CancelSoftwareUpgradeProposal) ProposalRoute() string
- func (sup CancelSoftwareUpgradeProposal) ProposalType() string
- func (sup CancelSoftwareUpgradeProposal) String() string
- func (sup CancelSoftwareUpgradeProposal) ValidateBasic() error
- type Plan
- type QueryAppliedParams
- type SoftwareUpgradeProposal
- func (sup SoftwareUpgradeProposal) GetDescription() string
- func (sup SoftwareUpgradeProposal) GetTitle() string
- func (sup SoftwareUpgradeProposal) ProposalRoute() string
- func (sup SoftwareUpgradeProposal) ProposalType() string
- func (sup SoftwareUpgradeProposal) String() string
- func (sup SoftwareUpgradeProposal) ValidateBasic() error
- type UpgradeHandler
Constants ¶
const ( // ModuleName is the name of this module ModuleName = "upgrade" // RouterKey is used to route governance proposals RouterKey = ModuleName // StoreKey is the prefix under which we store this module's data StoreKey = ModuleName // QuerierKey is used to handle abci_query requests QuerierKey = ModuleName // KeyUpgradedIBCState is the key under which upgraded ibc state is stored in the upgrade store KeyUpgradedIBCState = "upgradedIBCState" // KeyUpgradedClient is the sub-key under which upgraded client state will be stored KeyUpgradedClient = "upgradedClient" // KeyUpgradedConsState is the sub-key under which upgraded consensus state will be stored KeyUpgradedConsState = "upgradedConsState" )
const ( // PlanByte specifies the Byte under which a pending upgrade plan is stored in the store PlanByte = 0x0 // DoneByte is a prefix for to look up completed upgrade plan by name DoneByte = 0x1 )
const ( ProposalTypeSoftwareUpgrade string = "SoftwareUpgrade" ProposalTypeCancelSoftwareUpgrade string = "CancelSoftwareUpgrade" )
const ( QueryCurrent = "current" QueryApplied = "applied" )
query endpoints supported by the upgrade Querier
Variables ¶
This section is empty.
Functions ¶
func PlanKey ¶
func PlanKey() []byte
PlanKey is the key under which the current plan is saved We store PlanByte as a const to keep it immutable (unlike a []byte)
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
func UpgradedClientKey ¶ added in v1.3.0
UpgradedClientKey is the key under which the upgraded client state is saved Connecting IBC chains can verify against the upgraded client in this path before upgrading their clients
func UpgradedConsStateKey ¶ added in v1.3.0
UpgradedConsStateKey is the key under which the upgraded consensus state is saved Connecting IBC chains can verify against the upgraded consensus state in this path before upgrading their clients.
Types ¶
type CancelSoftwareUpgradeProposal ¶
type CancelSoftwareUpgradeProposal struct { Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` }
Cancel Software Upgrade Proposals
func (CancelSoftwareUpgradeProposal) GetDescription ¶
func (sup CancelSoftwareUpgradeProposal) GetDescription() string
func (CancelSoftwareUpgradeProposal) GetTitle ¶
func (sup CancelSoftwareUpgradeProposal) GetTitle() string
nolint
func (CancelSoftwareUpgradeProposal) ProposalRoute ¶
func (sup CancelSoftwareUpgradeProposal) ProposalRoute() string
func (CancelSoftwareUpgradeProposal) ProposalType ¶
func (sup CancelSoftwareUpgradeProposal) ProposalType() string
func (CancelSoftwareUpgradeProposal) String ¶
func (sup CancelSoftwareUpgradeProposal) String() string
func (CancelSoftwareUpgradeProposal) ValidateBasic ¶
func (sup CancelSoftwareUpgradeProposal) ValidateBasic() error
type Plan ¶
type Plan struct { // Sets the name for the upgrade. This name will be used by the upgraded version of the software to apply any // special "on-upgrade" commands during the first BeginBlock method after the upgrade is applied. It is also used // to detect whether a software version can handle a given upgrade. If no upgrade handler with this name has been // set in the software, it will be assumed that the software is out-of-date when the upgrade Time or Height // is reached and the software will exit. Name string `json:"name,omitempty"` // The time after which the upgrade must be performed. // Leave set to its zero value to use a pre-defined Height instead. Time time.Time `json:"time,omitempty"` // The height at which the upgrade must be performed. // Only used if Time is not set. Height int64 `json:"height,omitempty"` // Any application specific upgrade info to be included on-chain // such as a git commit that validators could automatically upgrade to Info string `json:"info,omitempty"` }
Plan specifies information about a planned upgrade and when it should occur
func (Plan) ShouldExecute ¶
ShouldExecute returns true if the Plan is ready to execute given the current context
func (Plan) ValidateBasic ¶
ValidateBasic does basic validation of a Plan
type QueryAppliedParams ¶
type QueryAppliedParams struct {
Name string
}
QueryAppliedParams is passed as data with QueryApplied
func NewQueryAppliedParams ¶
func NewQueryAppliedParams(name string) QueryAppliedParams
NewQueryAppliedParams creates a new instance to query if a named plan was applied
type SoftwareUpgradeProposal ¶
type SoftwareUpgradeProposal struct { Title string `json:"title" yaml:"title"` Description string `json:"description" yaml:"description"` Plan Plan `json:"plan" yaml:"plan"` }
Software Upgrade Proposals
func (SoftwareUpgradeProposal) GetDescription ¶
func (sup SoftwareUpgradeProposal) GetDescription() string
func (SoftwareUpgradeProposal) GetTitle ¶
func (sup SoftwareUpgradeProposal) GetTitle() string
nolint
func (SoftwareUpgradeProposal) ProposalRoute ¶
func (sup SoftwareUpgradeProposal) ProposalRoute() string
func (SoftwareUpgradeProposal) ProposalType ¶
func (sup SoftwareUpgradeProposal) ProposalType() string
func (SoftwareUpgradeProposal) String ¶
func (sup SoftwareUpgradeProposal) String() string
func (SoftwareUpgradeProposal) ValidateBasic ¶
func (sup SoftwareUpgradeProposal) ValidateBasic() error
type UpgradeHandler ¶
UpgradeHandler specifies the type of function that is called when an upgrade is applied