Documentation
¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, keeper Keeper) (tags sdk.Tags)
- func GetAddressFromSignalKey(key []byte) string
- func GetAppVersionKey(versionID uint64, proposalID uint64) []byte
- func GetProposalIDKey(proposalID uint64) []byte
- func GetSignalKey(versionID uint64, switchVoterAddr string) []byte
- func GetSignalPrefixKey(versionID uint64) []byte
- func GetSuccessAppVersionKey(versionID uint64) []byte
- func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
- func IntToHexString(i int64) string
- func NewError(codespace sdk.CodespaceType, code sdk.CodeType, msg string) sdk.Error
- func RegisterCodec(cdc *codec.Codec)
- func UintToHexString(i uint64) string
- type AppVersion
- type GenesisState
- type Keeper
- func (k Keeper) AddNewVersion(ctx sdk.Context, appVersion AppVersion)
- func (k Keeper) DeleteSignal(ctx sdk.Context, protocol uint64, address string)
- func (k Keeper) GetSignal(ctx sdk.Context, protocol uint64, address string) bool
- func (k Keeper) GetVersionByProposalId(ctx sdk.Context, proposalId uint64) *AppVersion
- func (k Keeper) SetSignal(ctx sdk.Context, protocol uint64, address string)
Constants ¶
View Source
const ( DefaultCodespace sdk.CodespaceType = "upgrade" CodeInvalidMsgType sdk.CodeType = 100 CodeUnSupportedMsgType sdk.CodeType = 101 CodeUnknownRequest sdk.CodeType = sdk.CodeUnknownRequest CodeNotCurrentProposal sdk.CodeType = 102 CodeNotValidator sdk.CodeType = 103 CodeDoubleSwitch sdk.CodeType = 104 )
Variables ¶
View Source
var Threshold = sdk.NewDecWithPrec(90, 2)
Functions ¶
func GetAddressFromSignalKey ¶ added in v0.9.1
func GetAppVersionKey ¶ added in v0.9.0
func GetProposalIDKey ¶
func GetSignalKey ¶ added in v0.9.0
func GetSignalPrefixKey ¶ added in v0.9.1
func GetSuccessAppVersionKey ¶ added in v0.9.0
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
InitGenesis - build the genesis version For first Version
func IntToHexString ¶ added in v0.7.0
func RegisterCodec ¶ added in v0.7.0
Register concrete types on codec codec
func UintToHexString ¶ added in v0.7.0
Types ¶
type AppVersion ¶ added in v0.9.0
type AppVersion struct { ProposalID uint64 Success bool Protocol common.ProtocolDefinition }
func NewVersion ¶
func NewVersion(upgradeConfig protocol.UpgradeConfig, success bool) AppVersion
type GenesisState ¶ added in v0.6.0
type GenesisState struct {
GenesisVersion AppVersion `json:genesis_version`
}
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 ExportGenesis ¶ added in v0.9.0
func ExportGenesis(ctx sdk.Context) GenesisState
WriteGenesis - output genesis parameters
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) AddNewVersion ¶
func (k Keeper) AddNewVersion(ctx sdk.Context, appVersion AppVersion)
func (Keeper) DeleteSignal ¶ added in v0.9.0
func (Keeper) GetVersionByProposalId ¶
func (k Keeper) GetVersionByProposalId(ctx sdk.Context, proposalId uint64) *AppVersion
Click to show internal directories.
Click to hide internal directories.