types

package
v0.12.3-testnet1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
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

View Source
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
)
View Source
const (
	ProposalAppUpgrade = "AppUpgrade"
)

const

Variables

View Source
var (
	EventTypeUpgradeAppVersion = "current_app_version"
	EventTypeUpgradeFailure    = "upgrade_failure"
	AttributeKeyAppVersion     = "app_version"
)

Upgrade module event types

View Source
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

func GetFailedVersionKey(versionID uint64, proposalID uint64) []byte

GetFailedVersionKey gets failed version store key

func GetProposalIDKey

func GetProposalIDKey(proposalID uint64) []byte

GetProposalIDKey gets proposal ID store key

func GetSignalKey

func GetSignalKey(versionID uint64, switchVoterAddr string) []byte

GetSignalKey gets signal store key

func GetSignalPrefixKey

func GetSignalPrefixKey(versionID uint64) []byte

GetSignalPrefixKey gets signal prefix store key

func GetSuccessVersionKey

func GetSuccessVersionKey(versionID uint64) []byte

GetSuccessVersionKey gets successful version store key

func NewError

func NewError(codespace sdk.CodespaceType, code sdk.CodeType, msg string) sdk.Error

NewError returns a new sdk.Error with a specific msg

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable gets KeyTable for upgrade module params

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

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

Jump to

Keyboard shortcuts

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