upgrade

package
v0.4.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = 1

	CodeInvalidMsgType     sdk.CodeType = 200
	CodeUnSupportedMsgType sdk.CodeType = 201
	CodeUnknownRequest     sdk.CodeType = sdk.CodeUnknownRequest
	CodeNotCurrentProposal sdk.CodeType = 203
	CodeNotValidator       sdk.CodeType = 204
	CodeDoubleSwitch       sdk.CodeType = 205
)
View Source
const (
	ParamStoreKeyCurrentProposalAcceptHeight = "upgrade/proposalAcceptHeight"
	ParamStoreKeyCurrentProposalId           = "upgrade/proposalId"
)

Variables

View Source
var (
	Inited           bool
	ModuleListBucket map[int64]ModuleLifeTimeList
)
View Source
var (
	DoingSwitchKey = []byte("d") // whether system is doing switch
)
View Source
var (
	KVStoreKeyListKey = []byte("k/")
)
View Source
var Threshold = sdk.NewRat(95, 100)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, keeper Keeper) (tags sdk.Tags)

do switch

func GetCurrentProposalAcceptHeightKey

func GetCurrentProposalAcceptHeightKey() string

func GetCurrentProposalIdKey

func GetCurrentProposalIdKey() string

func GetCurrentVersionKey

func GetCurrentVersionKey() []byte

func GetDoingSwitchKey

func GetDoingSwitchKey() []byte

func GetProposalIDKey

func GetProposalIDKey(proposalID int64) []byte

func GetStartHeightKey

func GetStartHeightKey(height int64) []byte

func GetSwitchKey

func GetSwitchKey(proposalID int64, switchVoterAddr sdk.AccAddress) []byte

func GetVersionIDKey

func GetVersionIDKey(versionID int64) []byte

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, router bam.Router)

InitGenesis - build the genesis version For first Version

func InitGenesis_commitID

func InitGenesis_commitID(ctx sdk.Context, k Keeper)

"main:acc:ibc:stake:slashing:fee:gov:upgrade"

func NewError

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

func NewHandler

func NewHandler(k Keeper) sdk.Handler

func RegisterModuleList

func RegisterModuleList(router bam.Router)

func RegisterWire

func RegisterWire(cdc *wire.Codec)

Register concrete types on wire codec

func ToHexString

func ToHexString(i int64) string

Types

type Keeper

type Keeper struct {
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *wire.Codec, key sdk.StoreKey, sk stake.Keeper, ps params.SetterProxy) Keeper

func (Keeper) AddNewVersion

func (k Keeper) AddNewVersion(ctx sdk.Context, version Version)

func (Keeper) DoSwitchBegin

func (k Keeper) DoSwitchBegin(ctx sdk.Context)

func (Keeper) DoSwitchEnd

func (k Keeper) DoSwitchEnd(ctx sdk.Context)

func (Keeper) GetCurrentProposalAcceptHeight

func (k Keeper) GetCurrentProposalAcceptHeight(ctx sdk.Context) int64

func (Keeper) GetCurrentProposalID

func (k Keeper) GetCurrentProposalID(ctx sdk.Context) int64

func (Keeper) GetCurrentVersion

func (k Keeper) GetCurrentVersion(ctx sdk.Context) *Version

func (Keeper) GetCurrentVersionByStore

func (k Keeper) GetCurrentVersionByStore(kvStore sdk.KVStore) *Version

func (Keeper) GetDoingSwitch

func (k Keeper) GetDoingSwitch(ctx sdk.Context) bool

func (Keeper) GetKVStoreKeylist

func (keeper Keeper) GetKVStoreKeylist(ctx sdk.Context) string

func (Keeper) GetMsgTypeInCurrentVersion

func (k Keeper) GetMsgTypeInCurrentVersion(ctx sdk.Context, msg sdk.Msg) (string, sdk.Error)

func (Keeper) GetSwitch

func (k Keeper) GetSwitch(ctx sdk.Context, propsalID int64, address sdk.AccAddress) (MsgSwitch, bool)

func (Keeper) GetVersionByHeight

func (k Keeper) GetVersionByHeight(ctx sdk.Context, blockHeight int64) *Version

func (Keeper) GetVersionByProposalId

func (k Keeper) GetVersionByProposalId(ctx sdk.Context, proposalId int64) *Version

func (Keeper) GetVersionByVersionId

func (k Keeper) GetVersionByVersionId(ctx sdk.Context, versionId int64) *Version

func (Keeper) GetVersionList

func (k Keeper) GetVersionList(ctx sdk.Context) VersionList

func (Keeper) OnlyRunAfterVersionId

func (k Keeper) OnlyRunAfterVersionId(ctx sdk.Context, versionId int64) bool

func (Keeper) SetCurrentProposalAcceptHeight

func (k Keeper) SetCurrentProposalAcceptHeight(ctx sdk.Context, height int64)

func (Keeper) SetCurrentProposalID

func (k Keeper) SetCurrentProposalID(ctx sdk.Context, proposalID int64)

func (Keeper) SetDoingSwitch

func (k Keeper) SetDoingSwitch(ctx sdk.Context, doing bool)

func (Keeper) SetKVStoreKeylist

func (keeper Keeper) SetKVStoreKeylist(ctx sdk.Context)

run when do switch

func (Keeper) SetSwitch

func (k Keeper) SetSwitch(ctx sdk.Context, propsalID int64, address sdk.AccAddress, cmsg MsgSwitch)

type ModuleLifeTime

type ModuleLifeTime struct {
	Start   int64
	End     int64
	Handler string
	Store   []string
}

func GetModuleFromBucket

func GetModuleFromBucket(verId int64, handler string) ModuleLifeTime

func NewModuleLifeTime

func NewModuleLifeTime(start int64, end int64, handler string, store []string) ModuleLifeTime

type ModuleLifeTimeList

type ModuleLifeTimeList []ModuleLifeTime

func GetModuleListFromBucket

func GetModuleListFromBucket(verId int64) (ModuleLifeTimeList, bool)

func NewModuleLifeTimeList

func NewModuleLifeTimeList() ModuleLifeTimeList

func (ModuleLifeTimeList) BuildModuleLifeTime

func (mlist ModuleLifeTimeList) BuildModuleLifeTime(start int64, handler string, store []string) ModuleLifeTimeList

type MsgSwitch

type MsgSwitch struct {
	Title      string
	ProposalID int64
	Voter      sdk.AccAddress
}

func NewMsgSwitch

func NewMsgSwitch(title string, proposalID int64, voter sdk.AccAddress) MsgSwitch

func (MsgSwitch) GetSignBytes

func (msg MsgSwitch) GetSignBytes() []byte

func (MsgSwitch) GetSigners

func (msg MsgSwitch) GetSigners() []sdk.AccAddress

func (MsgSwitch) Type

func (msg MsgSwitch) Type() string

func (MsgSwitch) ValidateBasic

func (msg MsgSwitch) ValidateBasic() sdk.Error

type Version

type Version struct {
	Id         int64
	ProposalID int64
	Start      int64
	ModuleList ModuleLifeTimeList
}

func NewVersion

func NewVersion(id int64, proposalID int64, start int64, moduleList ModuleLifeTimeList) Version

type VersionList

type VersionList []Version

func NewVersionList

func NewVersionList() VersionList

func (VersionList) AddVersion

func (m VersionList) AddVersion(v Version)

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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