Documentation ¶
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k Keeper)
- func EndBlocker(ctx sdk.Context, k Keeper, coinKeeper coin.Keeper, supplyKeeper supply.Keeper, ...) []abci.ValidatorUpdate
- func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Context, keeper Keeper, supplyKeeper types.SupplyKeeper, ...) []abci.ValidatorUpdate
- func NewHandler(keeper Keeper) sdk.Handler
- func SyncDelegate(ctx sdk.Context, k Keeper)
- func SyncPools(ctx sdk.Context, k Keeper, supplyKeeper supply.Keeper)
- func SyncPools2(ctx sdk.Context, k Keeper, supplyKeeper supply.Keeper)
- func SyncUnbondingDelegations(ctx sdk.Context, k Keeper)
- func SyncValidators(ctx sdk.Context, k Keeper)
- func ValidateGenesis(data types.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 (AppModuleBasic) BuildCreateValidatorMsg(cliCtx context.CLIContext, txBldr authtypes.TxBuilder) (authtypes.TxBuilder, sdk.Msg, error)
- func (AppModuleBasic) CreateValidatorMsgHelpers(ipDefault string) (fs *flag.FlagSet, nodeIDFlag, pubkeyFlag, amountFlag, defaultsDesc string)
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) PrepareFlagsForTxCreateValidator(config *cfg.Config, nodeID, chainID string, valPubKey crypto.PubKey)
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type BondStatus
- type CodeType
- type Description
- type GenesisState
- type Keeper
- type MsgDeclareCandidate
- type MsgDelegate
- type MsgDelegateNFT
- type MsgEditCandidate
- type MsgSetOffline
- type MsgSetOnline
- type MsgUnbond
- type MsgUnbondNFT
- type Params
- type UnbondingDelegation
- type UnbondingDelegationEntry
- type Validator
Constants ¶
const ( ModuleName = types.ModuleName RouterKey = types.RouterKey StoreKey = types.StoreKey TStoreKey = types.TStoreKey DefaultParamSpace = keeper.DefaultParamspace DefaultCodespace = types.DefaultCodespace QuerierRoute = types.QuerierRoute NotBondedPoolName = types.NotBondedPoolName BondedPoolName = types.BondedPoolName DefaultBondDenom = types.DefaultBondDenom ValidatorsKey = types.ValidatorsKey DeclareCandidateConst = types.DeclareCandidateConst DelegateConst = types.DelegateConst SetOnlineConst = types.SetOnlineConst SetOfflineConst = types.SetOfflineConst UnbondConst = types.UnbondConst EditCandidateConst = types.EditCandidateConst DAOAddress1 = keeper.DAOAddress1 DAOAddress2 = keeper.DAOAddress2 DAOAddress3 = keeper.DAOAddress3 DevelopAddress1 = keeper.DevelopAddress1 DevelopAddress2 = keeper.DevelopAddress2 DevelopAddress3 = keeper.DevelopAddress3 Unbonded = types.Unbonded Unbonding = types.Unbonding Bonded = types.Bonded )
Variables ¶
var ( // functions aliases NewKeeper = keeper.NewKeeper NewQuerier = keeper.NewQuerier RegisterCodec = types.RegisterCodec DefaultGenesisState = types.DefaultGenesisState NewMsgDeclareCandidate = types.NewMsgDeclareCandidate NewMsgEditCandidate = types.NewMsgEditCandidate NewMsgDelegate = types.NewMsgDelegate NewMsgUnbond = types.NewMsgUnbond NewMsgSetOnline = types.NewMsgSetOnline NewMsgSetOffline = types.NewMsgSetOffline NewMsgDelegateNFT = types.NewMsgDelegateNFT NewMsgUnbondNFT = types.NewMsgUnbondNFT NewValidator = types.NewValidator ErrCalculateCommission = types.ErrCalculateCommission ErrUpdateBalance = types.ErrUpdateBalance ErrInsufficientFunds = types.ErrInsufficientFunds ErrInsufficientCoinToPayCommission = types.ErrInsufficientCoinToPayCommission DefaultParams = types.DefaultParams TokensFromConsensusPower = types.TokensFromConsensusPower TokensToConsensusPower = types.TokensToConsensusPower // variable aliases ModuleCdc = types.ModuleCdc )
Functions ¶
func BeginBlocker ¶
func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k Keeper)
BeginBlocker check for infraction evidence or downtime of validators on every begin block
func EndBlocker ¶
func EndBlocker(ctx sdk.Context, k Keeper, coinKeeper coin.Keeper, supplyKeeper supply.Keeper, withRewards bool) []abci.ValidatorUpdate
EndBlocker called every block, process inflation, update validator set.
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
ExportGenesis returns a GenesisState for a given context and keeper. The GenesisState will contain the pool, params, validators, and bonds found in the keeper.
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, supplyKeeper types.SupplyKeeper, data GenesisState) []abci.ValidatorUpdate
InitGenesis sets the pool and parameters for the provided keeper. For each validator in data, it sets that validator in the keeper along with manually setting the indexes. In addition, it also sets any delegations found in data. Finally, it updates the bonded validators. Returns final validator set after applying all declaration and delegations
func NewHandler ¶
NewHandler creates an sdk.Handler for all the validator type messages
func SyncDelegate ¶ added in v1.2.6
func SyncValidators ¶
func ValidateGenesis ¶
func ValidateGenesis(data types.GenesisState) error
ValidateGenesis validates the provided staking genesis state to ensure the expected invariants holds. (i.e. params in correct bounds, no duplicate validators)
func WriteValidators ¶
func WriteValidators(ctx sdk.Context, keeper Keeper) (vals []tmtypes.GenesisValidator)
WriteValidators returns a slice of bonded 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 validator module.
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the validator 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 validator module.
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis performs genesis initialization for the validator module. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the validator module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the validator module sdk.Querier.
func (AppModule) QuerierRoute ¶
QuerierRoute returns the validator module's querier route name.
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
RegisterInvariants registers the validator module invariants.
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic defines the basic application module used by the validator module.
func (AppModuleBasic) BuildCreateValidatorMsg ¶
func (AppModuleBasic) BuildCreateValidatorMsg(cliCtx context.CLIContext, txBldr authtypes.TxBuilder) (authtypes.TxBuilder, sdk.Msg, error)
BuildCreateValidatorMsg - used for gen-tx
func (AppModuleBasic) CreateValidatorMsgHelpers ¶
func (AppModuleBasic) CreateValidatorMsgHelpers(ipDefault string) ( fs *flag.FlagSet, nodeIDFlag, pubkeyFlag, amountFlag, defaultsDesc string)
CreateValidatorMsgHelpers - used for gen-tx
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis returns default genesis state as raw bytes for the validator module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns no root query command for the validator module.
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd returns the root tx command for the validator module.
func (AppModuleBasic) Name ¶
func (AppModuleBasic) Name() string
Name returns the validator module's name.
func (AppModuleBasic) PrepareFlagsForTxCreateValidator ¶
func (AppModuleBasic) PrepareFlagsForTxCreateValidator(config *cfg.Config, nodeID, chainID string, valPubKey crypto.PubKey)
PrepareFlagsForTxCreateValidator - used for gen-tx
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec registers the validator module's types for the given codec.
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes registers the REST routes for the validator module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the validator module.
type BondStatus ¶
type BondStatus = types.BondStatus
type Description ¶
type Description = types.Description
type GenesisState ¶
type GenesisState = types.GenesisState
type MsgDeclareCandidate ¶
type MsgDeclareCandidate = types.MsgDeclareCandidate
func NewTestMsgDeclareCandidate ¶
func NewTestMsgDeclareCandidate(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int) MsgDeclareCandidate
func NewTestMsgDeclareCandidateWithCommission ¶
func NewTestMsgDeclareCandidateWithCommission(address sdk.ValAddress, pubKey crypto.PubKey, amt sdk.Int, commissionRate sdk.Dec) MsgDeclareCandidate
type MsgDelegate ¶
type MsgDelegate = types.MsgDelegate
func NewTestMsgDelegate ¶
func NewTestMsgDelegate(delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt sdk.Int) MsgDelegate
type MsgDelegateNFT ¶
type MsgDelegateNFT = types.MsgDelegateNFT
type MsgEditCandidate ¶
type MsgEditCandidate = types.MsgEditCandidate
type MsgSetOffline ¶
type MsgSetOffline = types.MsgSetOffline
type MsgSetOnline ¶
type MsgSetOnline = types.MsgSetOnline
type MsgUnbondNFT ¶
type MsgUnbondNFT = types.MsgUnbondNFT
type UnbondingDelegation ¶
type UnbondingDelegation = types.UnbondingDelegation
type UnbondingDelegationEntry ¶
type UnbondingDelegationEntry = types.UnbondingDelegationEntry