upgrade

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

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
)
View Source
const (
	MetricsSubsystem = "module_upgrade"
	ValidatorLabel   = "validator_address"
	VersionLabel     = "version"
)

Variables

This section is empty.

Functions

func EndBlocker

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

do switch

func GetAddressFromSignalKey

func GetAddressFromSignalKey(key []byte) string

func GetFailedVersionKey

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

func GetProposalIDKey

func GetProposalIDKey(proposalID uint64) []byte

func GetSignalKey

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

func GetSignalPrefixKey

func GetSignalPrefixKey(versionID uint64) []byte

func GetSuccessVersionKey

func GetSuccessVersionKey(versionID uint64) []byte

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)

InitGenesis - build the genesis version For first Version

func IntToHexString

func IntToHexString(i int64) string

func NewError

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

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

func UintToHexString

func UintToHexString(i uint64) string

Types

type GenesisState

type GenesisState struct {
	GenesisVersion VersionInfo `json:genesis_version`
}

GenesisState - all upgrade state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

get raw genesis raw message for testing

func DefaultGenesisStateForTest

func DefaultGenesisStateForTest() GenesisState

get raw genesis raw message for testing

func ExportGenesis

func ExportGenesis(ctx sdk.Context) GenesisState

WriteGenesis - output genesis parameters

type Keeper

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

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, protocolKeeper sdk.ProtocolKeeper, sk stake.Keeper, metrics *Metrics) Keeper

func (Keeper) AddNewVersionInfo

func (k Keeper) AddNewVersionInfo(ctx sdk.Context, versionInfo VersionInfo)

func (Keeper) DeleteSignal

func (k Keeper) DeleteSignal(ctx sdk.Context, protocol uint64, address string) bool

func (Keeper) GetSignal

func (k Keeper) GetSignal(ctx sdk.Context, protocol uint64, address string) bool

func (Keeper) SetSignal

func (k Keeper) SetSignal(ctx sdk.Context, protocol uint64, address string)

type Metrics

type Metrics struct {
	Signal  metrics.Gauge
	Upgrade metrics.Gauge
}

func NopMetrics

func NopMetrics() *Metrics

func PrometheusMetrics

func PrometheusMetrics(config *cfg.InstrumentationConfig) *Metrics

PrometheusMetrics returns Metrics build using Prometheus client library.

type VersionInfo

type VersionInfo struct {
	UpgradeInfo sdk.UpgradeConfig
	Success     bool
}

func NewVersionInfo

func NewVersionInfo(upgradeConfig sdk.UpgradeConfig, success bool) VersionInfo

Directories

Path Synopsis
cli

Jump to

Keyboard shortcuts

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