Documentation ¶
Index ¶
- Constants
- Variables
- func ErrInvalidSwitchHeight(codespace sdk.CodespaceType, blockHeight uint64, switchHeight uint64) sdk.Error
- func ErrInvalidVersion(codespace sdk.CodespaceType, version uint64) sdk.Error
- func ErrSwitchPeriodInProcess(codespace sdk.CodespaceType) sdk.Error
- func GetFailedVersionKey(versionID uint64, proposalID uint64) []byte
- func GetProposalIDKey(proposalID uint64) []byte
- func GetSignalKey(versionID uint64, switchVoterAddr string) []byte
- func GetSignalPrefixKey(versionID uint64) []byte
- func GetSuccessVersionKey(versionID uint64) []byte
- func NewError(codespace sdk.CodespaceType, code sdk.CodeType, msg string) sdk.Error
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- type AppUpgradeProposal
- func (apu AppUpgradeProposal) GetDescription() string
- func (apu AppUpgradeProposal) GetTitle() string
- func (apu AppUpgradeProposal) ProposalRoute() string
- func (apu AppUpgradeProposal) ProposalType() string
- func (apu AppUpgradeProposal) String() string
- func (apu AppUpgradeProposal) ValidateBasic() sdk.Error
- type GenesisState
- type QueryVersion
- type UpgradeParams
- type VersionInfo
Constants ¶
const ( DefaultCodespace sdk.CodespaceType = "upgrade" CodeUnknownRequest = sdk.CodeUnknownRequest CodeInvalidMsgType sdk.CodeType = 100 CodeUnSupportedMsgType sdk.CodeType = 101 CodeNotCurrentProposal sdk.CodeType = 102 CodeNotValidator sdk.CodeType = 103 CodeDoubleSwitch sdk.CodeType = 104 CodeNoUpgradeConfig sdk.CodeType = 105 CodeInvalidUpgradeParams sdk.CodeType = 107 CodeInvalidSoftWareDescri sdk.CodeType = 108 CodeInvalidVersion sdk.CodeType = 109 CodeSwitchPeriodInProcess sdk.CodeType = 110 )
const
const ( // ModuleName is the name of the upgrade module ModuleName = "upgrade" // StoreKey is the string store representation StoreKey = ModuleName // RouterKey is the msg router key for the upgrade module RouterKey = ModuleName // QuerierRoute is the querier route for the upgrade module QuerierRoute = ModuleName // DefaultParamspace is the default paramspace for the upgrade module DefaultParamspace = ModuleName )
const (
ProposalAppUpgrade = "AppUpgrade"
)
const
Variables ¶
var ( EventTypeUpgradeAppVersion = "current_app_version" EventTypeUpgradeFailure = "upgrade_failure" AttributeKeyAppVersion = "app_version" )
Upgrade module event types
var ModuleCdc *codec.Codec
ModuleCdc is a generic sealed codec to be used throughout this module
Functions ¶
func ErrInvalidSwitchHeight ¶
func ErrInvalidSwitchHeight(codespace sdk.CodespaceType, blockHeight uint64, switchHeight uint64) sdk.Error
ErrInvalidSwitchHeight returns an error when the switch height for upgrade is invalid
func ErrInvalidVersion ¶
func ErrInvalidVersion(codespace sdk.CodespaceType, version uint64) sdk.Error
ErrInvalidVersion returns an error when the version is invalid
func ErrSwitchPeriodInProcess ¶
func ErrSwitchPeriodInProcess(codespace sdk.CodespaceType) sdk.Error
ErrSwitchPeriodInProcess returns an error when the UpgradeConfig has existed
func GetFailedVersionKey ¶
GetFailedVersionKey gets failed version store key
func GetProposalIDKey ¶
GetProposalIDKey gets proposal ID store key
func GetSignalKey ¶
GetSignalKey gets signal store key
func GetSignalPrefixKey ¶
GetSignalPrefixKey gets signal prefix store key
func GetSuccessVersionKey ¶
GetSuccessVersionKey gets successful version store key
func ParamKeyTable ¶
ParamKeyTable gets KeyTable for upgrade module params
func RegisterCodec ¶
RegisterCodec registers concrete types on code
Types ¶
type AppUpgradeProposal ¶
type AppUpgradeProposal struct { Title string `json:"title" yaml:"titile"` Description string `json:"description" yaml:"description"` ProtocolDefinition proto.ProtocolDefinition `json:"protocol_definition" yaml:"protocol_definition"` }
AppUpgradeProposal implements content interface
func NewAppUpgradeProposal ¶
func NewAppUpgradeProposal(title, desc string, definition proto.ProtocolDefinition) *AppUpgradeProposal
NewAppUpgradeProposal returns the pointer of a new AppUpgradeProposal
func (AppUpgradeProposal) GetDescription ¶
func (apu AppUpgradeProposal) GetDescription() string
GetDescription returns the description of a dex list proposal.
func (AppUpgradeProposal) GetTitle ¶
func (apu AppUpgradeProposal) GetTitle() string
GetTitle returns the title of a dex list proposal.
func (AppUpgradeProposal) ProposalRoute ¶
func (apu AppUpgradeProposal) ProposalRoute() string
ProposalRoute returns the routing key of a dex list proposal.
func (AppUpgradeProposal) ProposalType ¶
func (apu AppUpgradeProposal) ProposalType() string
ProposalType returns the type of a dex list proposal.
func (AppUpgradeProposal) String ¶
func (apu AppUpgradeProposal) String() string
String returns a human readable string representation of AppUpgradeProposal
func (AppUpgradeProposal) ValidateBasic ¶
func (apu AppUpgradeProposal) ValidateBasic() sdk.Error
ValidateBasic validates the parameter change proposal
type GenesisState ¶
type GenesisState struct { GenesisVersion VersionInfo `json:"genesis_version"` Params UpgradeParams `json:"params"` }
GenesisState contains all upgrade state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns default raw genesis raw message
type QueryVersion ¶
type QueryVersion struct {
Ver uint64 `json:"version"`
}
QueryVersion is designed for version query
func NewQueryVersion ¶
func NewQueryVersion(ver uint64) QueryVersion
NewQueryVersion creates a new instance of QueryVersion
func (QueryVersion) String ¶
func (qv QueryVersion) String() string
String returns a human readable string representation of QueryVersion
type UpgradeParams ¶
type UpgradeParams struct { // Maximum period for okb holders to deposit on a AppUpgrade proposal. Initial value: 2 days AppUpgradeMaxDepositPeriod time.Duration `json:"app_upgrade_max_deposit_period"` // Minimum deposit for a critical AppUpgrade proposal to enter voting period AppUpgradeMinDeposit sdk.DecCoins `json:"app_upgrade_min_deposit"` // Length of the critical voting period for AppUpgrade proposal AppUpgradeVotingPeriod time.Duration `json:"app_upgrade_voting_period"` }
UpgradeParams is the struct of upgrade module params
func DefaultParams ¶
func DefaultParams() UpgradeParams
DefaultParams returns default module parameters
func (*UpgradeParams) ParamSetPairs ¶
func (p *UpgradeParams) ParamSetPairs() params.ParamSetPairs
ParamSetPairs sets upgrade module params
func (UpgradeParams) String ¶
func (p UpgradeParams) String() string
String returns a human readable string representation of UpgradeParams
type VersionInfo ¶
type VersionInfo struct { UpgradeInfo proto.AppUpgradeConfig `json:"upgrade_info"` Success bool `json:"success"` }
VersionInfo is the struct of version info
func NewVersionInfo ¶
func NewVersionInfo(upgradeConfig proto.AppUpgradeConfig, success bool) VersionInfo
NewVersionInfo creates a new instance of NewVersionInfo