Documentation
¶
Index ¶
- Constants
- Variables
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) (res []abci.ValidatorUpdate)
- func NewHandler(k Keeper, authKeeper auth.Keeper) sdk.Handler
- func ValidateGenesis(data GenesisState) error
- func WriteValidators(ctx sdk.Context, keeper Keeper) (vals []tmtypes.GenesisValidator)
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (a AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (a AppModuleBasic) Name() string
- func (a AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (a AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type GenesisState
- type Keeper
- type MissedBlock
- type MsgCreateValidator
- type TestSetup
- type Validator
Constants ¶
const ( ModuleName = types.ModuleName StoreKey = types.StoreKey RouterKey = types.RouterKey )
Variables ¶
var ( NewKeeper = keeper.NewKeeper NewQuerier = keeper.NewQuerier NewValidator = types.NewValidator RegisterCodec = types.RegisterCodec ModuleCdc = types.ModuleCdc )
Functions ¶
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) (res []abci.ValidatorUpdate)
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the provided validator genesis state to ensure the expected invariants holds.
func WriteValidators ¶
func WriteValidators(ctx sdk.Context, keeper Keeper) (vals []tmtypes.GenesisValidator)
WriteValidators returns a slice of genesis validators.
Types ¶
type AppModule ¶
type AppModule struct {
AppModuleBasic
// contains filtered or unexported fields
}
AppModule implements an application module for the validator module.
func NewAppModule ¶
NewAppModule creates a new AppModule object.
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
BeginBlock returns the begin blocker for the module.
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the module. It returns no validator updates.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the module. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the validator module sdk.Querier.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the module's querier route name.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(sdk.InvariantRegistry)
RegisterInvariants registers the module invariants.
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module Basics object.
func (AppModuleBasic) DefaultGenesis ¶
func (a AppModuleBasic) DefaultGenesis() json.RawMessage
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
Get the root query command of this module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
Get the root tx command of this module.
func (AppModuleBasic) Name ¶
func (a AppModuleBasic) Name() string
func (AppModuleBasic) RegisterCodec ¶
func (a AppModuleBasic) RegisterCodec(cdc *codec.Codec)
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
Register rest routes.
func (AppModuleBasic) ValidateGenesis ¶
func (a AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
type GenesisState ¶
type GenesisState struct {
Validators []Validator `json:"validators"`
LastValidators []types.LastValidatorPower `json:"last_validators"`
SigningInfos map[string]types.ValidatorSigningInfo `json:"signing_infos"`
MissedBlocks map[string][]MissedBlock `json:"missed_blocks"`
}
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState
ExportGenesis returns a GenesisState for a given context and keeper.
type MissedBlock ¶
type MsgCreateValidator ¶
type MsgCreateValidator = types.MsgCreateValidator