Documentation ¶
Overview ¶
Package staking defines the staking module.
Index ¶
- Constants
- Variables
- func NewHandler(k keeper.Keeper, ck types.CertKeeper) sdk.Handler
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, rbb abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Context, rbb 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 (am AppModule) Name() string
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (AppModule) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent
- func (am AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) Route() string
- func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation
- type AppModuleBasic
- func (AppModuleBasic) BuildCreateValidatorMsg(cliCtx context.CLIContext, txBldr authtypes.TxBuilder) (authtypes.TxBuilder, sdk.Msg, error)
- func (AppModuleBasic) CreateValidatorMsgHelpers(ipDefault string) (fs *pflag.FlagSet, nodeIDFlag, pubkeyFlag, amountFlag, defaultsDesc string)
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState)
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) PrepareFlagsForTxCreateValidator(cfg *config.Config, nodeID, chainID string, valPubKey crypto.PubKey)
- func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(cliCtx context.CLIContext, route *mux.Router)
- func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type Keeper
Constants ¶
const ( ModuleName = staking.ModuleName StoreKey = staking.StoreKey BondedPoolName = staking.BondedPoolName NotBondedPoolName = staking.NotBondedPoolName TStoreKey = staking.TStoreKey DefaultParamspace = staking.DefaultParamspace )
Variables ¶
var ( // function aliases NewKeeper = staking.NewKeeper RegisterCodec = staking.RegisterCodec InitGenesis = staking.InitGenesis DefaultParams = staking.DefaultParams NewMultiStakingHooks = staking.NewMultiStakingHooks )
ErrUnauthorizedValidator is the SDK error for creating validators from non-certified full nodes.
Functions ¶
func NewHandler ¶
NewHandler returns a customized staking message handler.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule implements an application module for the staking module.
func NewAppModule ¶
func NewAppModule( stakingKeeper staking.Keeper, accountKeeper stakingTypes.AccountKeeper, supplyKeeper stakingTypes.SupplyKeeper, certKeeper types.CertKeeper, ) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, rbb abci.RequestBeginBlock)
BeginBlock implements the Cosmos SDK BeginBlock module function.
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, rbb abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock implements the Cosmos SDK EndBlock module function.
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis returns the exported genesis state as raw bytes for the staking module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the staking module.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the staking module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the staking module sdk.Querier.
func (AppModule) ProposalContents ¶
func (AppModule) ProposalContents(_ module.SimulationState) []sim.WeightedProposalContent
ProposalContents returns functions that generate proposals for the module.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the staking module's querier route name.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants registers the staking module invariants.
func (AppModule) WeightedOperations ¶
func (am AppModule) WeightedOperations(simState module.SimulationState) []sim.WeightedOperation
WeightedOperations returns staking operations for use in simulations.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the staking module.
func (AppModuleBasic) BuildCreateValidatorMsg ¶
func (AppModuleBasic) BuildCreateValidatorMsg(cliCtx context.CLIContext, txBldr authtypes.TxBuilder) (authtypes.TxBuilder, sdk.Msg, error)
BuildCreateValidatorMsg is used for gen-tx.
func (AppModuleBasic) CreateValidatorMsgHelpers ¶
func (AppModuleBasic) CreateValidatorMsgHelpers(ipDefault string) ( fs *pflag.FlagSet, nodeIDFlag, pubkeyFlag, amountFlag, defaultsDesc string)
CreateValidatorMsgHelpers is used for gen-tx.
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the staking module.
func (AppModuleBasic) GenerateGenesisState ¶
func (AppModuleBasic) GenerateGenesisState(simState *module.SimulationState)
GenerateGenesisState creates a randomized GenState of this module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns the root query command for the staking module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd returns the root tx command for the staking module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the staking module's name.
func (AppModuleBasic) PrepareFlagsForTxCreateValidator ¶
func (AppModuleBasic) PrepareFlagsForTxCreateValidator(cfg *config.Config, nodeID, chainID string, valPubKey crypto.PubKey)
PrepareFlagsForTxCreateValidator is used for gen-tx.
func (AppModuleBasic) RandomizedParams ¶
func (AppModuleBasic) RandomizedParams(r *rand.Rand) []sim.ParamChange
RandomizedParams returns functions that generate params for the module.
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the staking module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(cliCtx context.CLIContext, route *mux.Router)
RegisterRESTRoutes registers the REST routes for the staking module.
func (AppModuleBasic) RegisterStoreDecoder ¶
func (AppModuleBasic) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry)
RegisterStoreDecoder registers a decoder for staking module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the staking module.