Documentation ¶
Index ¶
- Constants
- Variables
- 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 UpgradeStoreLoader(upgradeHeight int64, storeUpgrades *store.StoreUpgrades) baseapp.StoreLoader
- type CancelSoftwareUpgradeProposal
- func (*CancelSoftwareUpgradeProposal) Descriptor() ([]byte, []int)
- func (this *CancelSoftwareUpgradeProposal) Equal(that interface{}) bool
- func (sup *CancelSoftwareUpgradeProposal) GetDescription() string
- func (sup *CancelSoftwareUpgradeProposal) GetTitle() string
- func (m *CancelSoftwareUpgradeProposal) Marshal() (dAtA []byte, err error)
- func (m *CancelSoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error)
- func (m *CancelSoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (sup *CancelSoftwareUpgradeProposal) ProposalRoute() string
- func (sup *CancelSoftwareUpgradeProposal) ProposalType() string
- func (*CancelSoftwareUpgradeProposal) ProtoMessage()
- func (m *CancelSoftwareUpgradeProposal) Reset()
- func (m *CancelSoftwareUpgradeProposal) Size() (n int)
- func (sup CancelSoftwareUpgradeProposal) String() string
- func (m *CancelSoftwareUpgradeProposal) Unmarshal(dAtA []byte) error
- func (sup *CancelSoftwareUpgradeProposal) ValidateBasic() error
- func (m *CancelSoftwareUpgradeProposal) XXX_DiscardUnknown()
- func (m *CancelSoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CancelSoftwareUpgradeProposal) XXX_Merge(src proto.Message)
- func (m *CancelSoftwareUpgradeProposal) XXX_Size() int
- func (m *CancelSoftwareUpgradeProposal) XXX_Unmarshal(b []byte) error
- type Plan
- func (*Plan) Descriptor() ([]byte, []int)
- func (p Plan) DueAt() string
- func (this *Plan) Equal(that interface{}) bool
- func (m *Plan) Marshal() (dAtA []byte, err error)
- func (m *Plan) MarshalTo(dAtA []byte) (int, error)
- func (m *Plan) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Plan) ProtoMessage()
- func (m *Plan) Reset()
- func (p Plan) ShouldExecute(ctx sdk.Context) bool
- func (m *Plan) Size() (n int)
- func (p Plan) String() string
- func (m *Plan) Unmarshal(dAtA []byte) error
- func (p Plan) ValidateBasic() error
- func (m *Plan) XXX_DiscardUnknown()
- func (m *Plan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Plan) XXX_Merge(src proto.Message)
- func (m *Plan) XXX_Size() int
- func (m *Plan) XXX_Unmarshal(b []byte) error
- type QueryAppliedParams
- type SoftwareUpgradeProposal
- func (*SoftwareUpgradeProposal) Descriptor() ([]byte, []int)
- func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool
- func (sup *SoftwareUpgradeProposal) GetDescription() string
- func (sup *SoftwareUpgradeProposal) GetTitle() string
- func (m *SoftwareUpgradeProposal) Marshal() (dAtA []byte, err error)
- func (m *SoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error)
- func (m *SoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (sup *SoftwareUpgradeProposal) ProposalRoute() string
- func (sup *SoftwareUpgradeProposal) ProposalType() string
- func (*SoftwareUpgradeProposal) ProtoMessage()
- func (m *SoftwareUpgradeProposal) Reset()
- func (m *SoftwareUpgradeProposal) Size() (n int)
- func (sup SoftwareUpgradeProposal) String() string
- func (m *SoftwareUpgradeProposal) Unmarshal(dAtA []byte) error
- func (sup *SoftwareUpgradeProposal) ValidateBasic() error
- func (m *SoftwareUpgradeProposal) XXX_DiscardUnknown()
- func (m *SoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SoftwareUpgradeProposal) XXX_Merge(src proto.Message)
- func (m *SoftwareUpgradeProposal) XXX_Size() int
- func (m *SoftwareUpgradeProposal) XXX_Unmarshal(b []byte) 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 )
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 ¶
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 UpgradeStoreLoader ¶
func UpgradeStoreLoader(upgradeHeight int64, storeUpgrades *store.StoreUpgrades) baseapp.StoreLoader
UpgradeStoreLoader is used to prepare baseapp with a fixed StoreLoader pattern. This is useful for custom upgrade loading logic.
Types ¶
type CancelSoftwareUpgradeProposal ¶
type CancelSoftwareUpgradeProposal struct { Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` }
CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software upgrade
func (*CancelSoftwareUpgradeProposal) Descriptor ¶
func (*CancelSoftwareUpgradeProposal) Descriptor() ([]byte, []int)
func (*CancelSoftwareUpgradeProposal) Equal ¶
func (this *CancelSoftwareUpgradeProposal) Equal(that interface{}) bool
func (*CancelSoftwareUpgradeProposal) GetDescription ¶
func (sup *CancelSoftwareUpgradeProposal) GetDescription() string
func (*CancelSoftwareUpgradeProposal) GetTitle ¶
func (sup *CancelSoftwareUpgradeProposal) GetTitle() string
func (*CancelSoftwareUpgradeProposal) Marshal ¶
func (m *CancelSoftwareUpgradeProposal) Marshal() (dAtA []byte, err error)
func (*CancelSoftwareUpgradeProposal) MarshalTo ¶
func (m *CancelSoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error)
func (*CancelSoftwareUpgradeProposal) MarshalToSizedBuffer ¶
func (m *CancelSoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CancelSoftwareUpgradeProposal) ProposalRoute ¶
func (sup *CancelSoftwareUpgradeProposal) ProposalRoute() string
func (*CancelSoftwareUpgradeProposal) ProposalType ¶
func (sup *CancelSoftwareUpgradeProposal) ProposalType() string
func (*CancelSoftwareUpgradeProposal) ProtoMessage ¶
func (*CancelSoftwareUpgradeProposal) ProtoMessage()
func (*CancelSoftwareUpgradeProposal) Reset ¶
func (m *CancelSoftwareUpgradeProposal) Reset()
func (*CancelSoftwareUpgradeProposal) Size ¶
func (m *CancelSoftwareUpgradeProposal) Size() (n int)
func (CancelSoftwareUpgradeProposal) String ¶
func (sup CancelSoftwareUpgradeProposal) String() string
func (*CancelSoftwareUpgradeProposal) Unmarshal ¶
func (m *CancelSoftwareUpgradeProposal) Unmarshal(dAtA []byte) error
func (*CancelSoftwareUpgradeProposal) ValidateBasic ¶
func (sup *CancelSoftwareUpgradeProposal) ValidateBasic() error
func (*CancelSoftwareUpgradeProposal) XXX_DiscardUnknown ¶
func (m *CancelSoftwareUpgradeProposal) XXX_DiscardUnknown()
func (*CancelSoftwareUpgradeProposal) XXX_Marshal ¶
func (m *CancelSoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CancelSoftwareUpgradeProposal) XXX_Merge ¶
func (m *CancelSoftwareUpgradeProposal) XXX_Merge(src proto.Message)
func (*CancelSoftwareUpgradeProposal) XXX_Size ¶
func (m *CancelSoftwareUpgradeProposal) XXX_Size() int
func (*CancelSoftwareUpgradeProposal) XXX_Unmarshal ¶
func (m *CancelSoftwareUpgradeProposal) XXX_Unmarshal(b []byte) 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 `protobuf:"bytes,1,opt,name=name,proto3" 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 `protobuf:"bytes,2,opt,name=time,proto3,stdtime" json:"time"` // The height at which the upgrade must be performed. // Only used if Time is not set. Height int64 `protobuf:"varint,3,opt,name=height,proto3" 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 `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` }
Plan specifies information about a planned upgrade and when it should occur
func (*Plan) Descriptor ¶
func (*Plan) ProtoMessage ¶
func (*Plan) ProtoMessage()
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
func (*Plan) XXX_DiscardUnknown ¶
func (m *Plan) XXX_DiscardUnknown()
func (*Plan) XXX_Unmarshal ¶
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 `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` Plan Plan `protobuf:"bytes,3,opt,name=plan,proto3" json:"plan"` }
SoftwareUpgradeProposal is a gov Content type for initiating a software upgrade
func (*SoftwareUpgradeProposal) Descriptor ¶
func (*SoftwareUpgradeProposal) Descriptor() ([]byte, []int)
func (*SoftwareUpgradeProposal) Equal ¶
func (this *SoftwareUpgradeProposal) Equal(that interface{}) bool
func (*SoftwareUpgradeProposal) GetDescription ¶
func (sup *SoftwareUpgradeProposal) GetDescription() string
func (*SoftwareUpgradeProposal) GetTitle ¶
func (sup *SoftwareUpgradeProposal) GetTitle() string
func (*SoftwareUpgradeProposal) Marshal ¶
func (m *SoftwareUpgradeProposal) Marshal() (dAtA []byte, err error)
func (*SoftwareUpgradeProposal) MarshalTo ¶
func (m *SoftwareUpgradeProposal) MarshalTo(dAtA []byte) (int, error)
func (*SoftwareUpgradeProposal) MarshalToSizedBuffer ¶
func (m *SoftwareUpgradeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*SoftwareUpgradeProposal) ProposalRoute ¶
func (sup *SoftwareUpgradeProposal) ProposalRoute() string
func (*SoftwareUpgradeProposal) ProposalType ¶
func (sup *SoftwareUpgradeProposal) ProposalType() string
func (*SoftwareUpgradeProposal) ProtoMessage ¶
func (*SoftwareUpgradeProposal) ProtoMessage()
func (*SoftwareUpgradeProposal) Reset ¶
func (m *SoftwareUpgradeProposal) Reset()
func (*SoftwareUpgradeProposal) Size ¶
func (m *SoftwareUpgradeProposal) Size() (n int)
func (SoftwareUpgradeProposal) String ¶
func (sup SoftwareUpgradeProposal) String() string
func (*SoftwareUpgradeProposal) Unmarshal ¶
func (m *SoftwareUpgradeProposal) Unmarshal(dAtA []byte) error
func (*SoftwareUpgradeProposal) ValidateBasic ¶
func (sup *SoftwareUpgradeProposal) ValidateBasic() error
func (*SoftwareUpgradeProposal) XXX_DiscardUnknown ¶
func (m *SoftwareUpgradeProposal) XXX_DiscardUnknown()
func (*SoftwareUpgradeProposal) XXX_Marshal ¶
func (m *SoftwareUpgradeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SoftwareUpgradeProposal) XXX_Merge ¶
func (m *SoftwareUpgradeProposal) XXX_Merge(src proto.Message)
func (*SoftwareUpgradeProposal) XXX_Size ¶
func (m *SoftwareUpgradeProposal) XXX_Size() int
func (*SoftwareUpgradeProposal) XXX_Unmarshal ¶
func (m *SoftwareUpgradeProposal) XXX_Unmarshal(b []byte) error
type UpgradeHandler ¶
UpgradeHandler specifies the type of function that is called when an upgrade is applied