Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, keeper Keeper) (tags sdk.Tags)
- func GetCurrentVersionKey() []byte
- func GetDoingSwitchKey() []byte
- func GetProposalIDKey(proposalID uint64) []byte
- func GetStartHeightKey(height int64) []byte
- func GetSwitchKey(proposalID uint64, switchVoterAddr sdk.AccAddress) []byte
- func GetVersionIDKey(versionID int64) []byte
- func InitGenesis(ctx sdk.Context, k Keeper, router bam.Router, data GenesisState)
- func InitGenesis_commitID(ctx sdk.Context, k Keeper)
- func IntToHexString(i int64) string
- func NewError(codespace sdk.CodespaceType, code sdk.CodeType, msg string) sdk.Error
- func NewHandler(k Keeper) sdk.Handler
- func RegisterCodec(cdc *codec.Codec)
- func RegisterModuleList(router bam.Router)
- func UintToHexString(i uint64) string
- type GenesisState
- type Keeper
- func (k Keeper) AddNewVersion(ctx sdk.Context, version Version)
- func (k Keeper) DoSwitchBegin(ctx sdk.Context)
- func (k Keeper) DoSwitchEnd(ctx sdk.Context)
- func (k Keeper) GetCurrentVersion(ctx sdk.Context) *Version
- func (k Keeper) GetCurrentVersionByStore(kvStore sdk.KVStore) *Version
- func (k Keeper) GetDoingSwitch(ctx sdk.Context) bool
- func (keeper Keeper) GetKVStoreKeylist(ctx sdk.Context) string
- func (k Keeper) GetMsgTypeInCurrentVersion(ctx sdk.Context, msg sdk.Msg) (string, sdk.Error)
- func (k Keeper) GetSwitch(ctx sdk.Context, propsalID uint64, address sdk.AccAddress) (MsgSwitch, bool)
- func (k Keeper) GetVersionByHeight(ctx sdk.Context, blockHeight int64) *Version
- func (k Keeper) GetVersionByProposalId(ctx sdk.Context, proposalId uint64) *Version
- func (k Keeper) GetVersionByVersionId(versionId int64) *Version
- func (k Keeper) GetVersionList(ctx sdk.Context) VersionList
- func (k Keeper) GetVersionListByStore(kvStore sdk.KVStore) VersionList
- func (k Keeper) OnlyRunAfterVersionId(ctx sdk.Context, versionId int64) bool
- func (k Keeper) RefreshVersionList(kvStore sdk.KVStore)
- func (k Keeper) SetDoingSwitch(ctx sdk.Context, doing bool)
- func (keeper Keeper) SetKVStoreKeylist(ctx sdk.Context)
- func (k Keeper) SetSwitch(ctx sdk.Context, propsalID uint64, address sdk.AccAddress, cmsg MsgSwitch)
- type ModuleLifeTime
- type ModuleLifeTimeList
- type MsgSwitch
- type Version
- type VersionList
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 MsgRoute = "upgrade"
name to idetify transaction types
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.NewDecWithPrec(95, 2)
Functions ¶
func GetCurrentVersionKey ¶
func GetCurrentVersionKey() []byte
func GetDoingSwitchKey ¶
func GetDoingSwitchKey() []byte
func GetProposalIDKey ¶
func GetStartHeightKey ¶
func GetSwitchKey ¶
func GetSwitchKey(proposalID uint64, switchVoterAddr sdk.AccAddress) []byte
func GetVersionIDKey ¶
func InitGenesis ¶
InitGenesis - build the genesis version For first Version
func InitGenesis_commitID ¶
"main:acc:ibc:stake:slashing:fee:gov:upgrade"
func IntToHexString ¶ added in v0.7.0
func NewHandler ¶
func RegisterCodec ¶ added in v0.7.0
Register concrete types on codec codec
func RegisterModuleList ¶
func UintToHexString ¶ added in v0.7.0
Types ¶
type GenesisState ¶ added in v0.6.0
type GenesisState struct {
SwitchPeriod int64 `json:"switch_period"`
}
GenesisState - all upgrade state that must be provided at genesis
func DefaultGenesisState ¶ added in v0.6.0
func DefaultGenesisState() GenesisState
get raw genesis raw message for testing
func DefaultGenesisStateForTest ¶ added in v0.6.0
func DefaultGenesisStateForTest() GenesisState
get raw genesis raw message for testing
func WriteGenesis ¶ added in v0.7.0
func WriteGenesis(ctx sdk.Context, k Keeper) GenesisState
WriteGenesis - output genesis parameters
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) DoSwitchBegin ¶
func (Keeper) DoSwitchEnd ¶
func (Keeper) GetCurrentVersionByStore ¶
func (Keeper) GetMsgTypeInCurrentVersion ¶
func (Keeper) GetVersionByHeight ¶
func (Keeper) GetVersionByProposalId ¶
func (Keeper) GetVersionByVersionId ¶
func (Keeper) GetVersionList ¶
func (k Keeper) GetVersionList(ctx sdk.Context) VersionList
func (Keeper) GetVersionListByStore ¶ added in v0.6.0
func (k Keeper) GetVersionListByStore(kvStore sdk.KVStore) VersionList
func (Keeper) OnlyRunAfterVersionId ¶
func (Keeper) RefreshVersionList ¶ added in v0.6.0
func (Keeper) SetKVStoreKeylist ¶
run when do switch
type ModuleLifeTime ¶
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 uint64 Voter sdk.AccAddress }
func NewMsgSwitch ¶
func NewMsgSwitch(title string, proposalID uint64, voter sdk.AccAddress) MsgSwitch
func (MsgSwitch) GetSignBytes ¶
func (MsgSwitch) GetSigners ¶
func (msg MsgSwitch) GetSigners() []sdk.AccAddress
func (MsgSwitch) ValidateBasic ¶
type Version ¶
type Version struct { Id int64 ProposalID uint64 Start int64 ModuleList ModuleLifeTimeList }
func NewVersion ¶
func NewVersion(id int64, proposalID uint64, start int64, moduleList ModuleLifeTimeList) Version
type VersionList ¶
type VersionList []Version
var VersionListCached VersionList
func NewVersionList ¶
func NewVersionList() VersionList
func (VersionList) AddVersion ¶
func (m VersionList) AddVersion(v Version)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.