Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, keeper Keeper)
- func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
- func MakeTestCodec() *codec.Codec
- func NewPubKey(pk string) (res crypto.PubKey)
- func TestAddr(addr string, bech string) sdk.AccAddress
- type AppModule
- func (a AppModule) BeginBlock(sdk.Context, types.RequestBeginBlock)
- func (a AppModule) EndBlock(ctx sdk.Context, b types.RequestEndBlock) []types.ValidatorUpdate
- func (a AppModule) ExportGenesis(sdk.Context) json.RawMessage
- func (a AppModule) InitGenesis(ctx sdk.Context, d json.RawMessage) []types.ValidatorUpdate
- func (a AppModule) NewHandler() sdk.Handler
- func (a AppModule) NewQuerierHandler() sdk.Querier
- func (a AppModule) QuerierRoute() string
- func (a AppModule) RegisterInvariants(sdk.InvariantRegistry)
- func (a AppModule) Route() string
- type AppModuleBasic
- func (a AppModuleBasic) DefaultGenesis() json.RawMessage
- func (a AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (a AppModuleBasic) GetTxCmd(*codec.Codec) *cobra.Command
- func (a AppModuleBasic) Name() string
- func (a AppModuleBasic) RegisterCodec(*codec.Codec)
- func (a AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (a AppModuleBasic) ValidateGenesis(d json.RawMessage) error
- type GenesisState
- type Keeper
- func (k Keeper) AddNewVersionInfo(ctx sdk.Context, versionInfo types.VersionInfo)
- func (k Keeper) DeleteSignal(ctx sdk.Context, protocol uint64, address string) bool
- func (k Keeper) GetCurrentVersion(ctx sdk.Context) uint64
- func (k Keeper) GetSignal(ctx sdk.Context, protocol uint64, address string) bool
- func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, ...)
- func (k Keeper) SetAppUpgradeConfig(ctx sdk.Context, proposalID, version, upgradeHeight uint64, software string) error
- func (k Keeper) SetSignal(ctx sdk.Context, protocol uint64, address string)
Constants ¶
const ( StoreKey = types.StoreKey ModuleName = types.ModuleName )
Variables ¶
var ( Addrs = createTestAddrs(500) PKs = createTestPubKeys(500) )
Functions ¶
func EndBlocker ¶
EndBlocker does signal maintenance in the end of block
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)
InitGenesis builds the genesis version for first version
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule is a struct of app module
func NewAppModule ¶
NewAppModule creates a new AppModule object for upgrade module
func (AppModule) BeginBlock ¶
func (a AppModule) BeginBlock(sdk.Context, types.RequestBeginBlock)
BeginBlock returns the begin blocker for the upgrade module.
func (AppModule) EndBlock ¶
func (a AppModule) EndBlock(ctx sdk.Context, b types.RequestEndBlock) []types.ValidatorUpdate
EndBlock returns the end blocker for the upgrade module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (a AppModule) ExportGenesis(sdk.Context) json.RawMessage
ExportGenesis exports module genesis
func (AppModule) InitGenesis ¶
func (a AppModule) InitGenesis(ctx sdk.Context, d json.RawMessage) []types.ValidatorUpdate
InitGenesis initializes module genesis
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the upgrade module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the auth module sdk.Querier.
func (AppModule) QuerierRoute ¶
QuerierRoute returns module querier route name
func (AppModule) RegisterInvariants ¶
func (a AppModule) RegisterInvariants(sdk.InvariantRegistry)
RegisterInvariants performs a no-op.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic is a struct of app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (a AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (a AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd gets the root query command of the upgrade module
func (AppModuleBasic) GetTxCmd ¶
func (a AppModuleBasic) GetTxCmd(*codec.Codec) *cobra.Command
GetTxCmd returns the transaction commands for this module
func (AppModuleBasic) RegisterCodec ¶
func (a AppModuleBasic) RegisterCodec(*codec.Codec)
RegisterCodec registers module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (a AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (a AppModuleBasic) ValidateGenesis(d json.RawMessage) error
ValidateGenesis validates genesis
type GenesisState ¶
type GenesisState struct {
GenesisVersion types.VersionInfo `json:"genesis_version" yaml:"genesis_version"`
}
GenesisState contains all upgrade state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns default raw genesis raw message
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper defines the keeper struct of the upgrade store
func CreateTestInput ¶
func CreateTestInput(t *testing.T, initPower int64) (ctx sdk.Context, keeper Keeper, stakingKeeper staking.Keeper, paramsKeeper params.Keeper)
CreateTestInput create test input nolint
func NewKeeper ¶
func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, protocolKeeper sdk.ProtocolKeeper, sk staking.Keeper) Keeper
NewKeeper creates a new upgrade keeper
func (Keeper) AddNewVersionInfo ¶
func (k Keeper) AddNewVersionInfo(ctx sdk.Context, versionInfo types.VersionInfo)
AddNewVersionInfo adds new version info
func (Keeper) DeleteSignal ¶
DeleteSignal removes signal
func (Keeper) GetCurrentVersion ¶
GetCurrentVersion gets current version
func (Keeper) IterateBondedValidatorsByPower ¶
func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator exported.ValidatorI) (stop bool))
IterateBondedValidatorsByPower iterates bonded validators by power