Documentation ¶
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, k keeper.Keeper)
- func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate
- func ExportGenesis(ctx sdk.Context, keeper Keeper) types.GenesisState
- func InitGenesis(ctx sdk.Context, keeper Keeper, accountKeeper types.AccountKeeper, ...) (res []abci.ValidatorUpdate)
- func NewHandler(k keeper.Keeper) sdk.Handler
- 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, _ 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(ir 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 DVPair
- type Delegation
- type DelegationI
- type DelegationResponse
- type DelegationResponses
- type Delegations
- type Description
- type GenesisState
- type HistoricalInfo
- type Keeper
- type LastValidatorPower
- type MsgCreateValidator
- type MsgDelegate
- type MsgEditValidator
- type MsgUndelegate
- type MultiStakingHooks
- type Params
- type Pool
- type QueryBondsParams
- type QueryDelegatorParams
- type QueryHistoricalInfoParams
- type QueryValidatorParams
- type QueryValidatorsParams
- type UnbondingDelegation
- type UnbondingDelegationEntry
- type UnbondingDelegations
- type Validator
- type ValidatorI
- type Validators
Constants ¶
const ( DefaultParamspace = keeper.DefaultParamspace ModuleName = types.ModuleName StoreKey = types.StoreKey TStoreKey = types.TStoreKey QuerierRoute = types.QuerierRoute RouterKey = types.RouterKey DefaultUnbondingTime = types.DefaultUnbondingTime DefaultMaxValidators = types.DefaultMaxValidators DefaultMaxEntries = types.DefaultMaxEntries NotBondedPoolName = types.NotBondedPoolName BondedPoolName = types.BondedPoolName QueryValidators = types.QueryValidators QueryValidator = types.QueryValidator QueryDelegatorDelegations = types.QueryDelegatorDelegations QueryDelegatorUnbondingDelegations = types.QueryDelegatorUnbondingDelegations QueryValidatorDelegations = types.QueryValidatorDelegations QueryValidatorUnbondingDelegations = types.QueryValidatorUnbondingDelegations QueryDelegation = types.QueryDelegation QueryUnbondingDelegation = types.QueryUnbondingDelegation QueryDelegatorValidators = types.QueryDelegatorValidators QueryDelegatorValidator = types.QueryDelegatorValidator QueryPool = types.QueryPool QueryParameters = types.QueryParameters QueryHistoricalInfo = types.QueryHistoricalInfo MaxMonikerLength = types.MaxMonikerLength MaxIdentityLength = types.MaxIdentityLength MaxWebsiteLength = types.MaxWebsiteLength MaxDetailsLength = types.MaxDetailsLength DoNotModifyDesc = types.DoNotModifyDesc )
Variables ¶
var ( // functions aliases RegisterInvariants = keeper.RegisterInvariants AllInvariants = keeper.AllInvariants ModuleAccountInvariants = keeper.ModuleAccountInvariants NonNegativePowerInvariant = keeper.NonNegativePowerInvariant PositiveDelegationInvariant = keeper.PositiveDelegationInvariant NewKeeper = keeper.NewKeeper ParamKeyTable = keeper.ParamKeyTable NewQuerier = keeper.NewQuerier RegisterCodec = types.RegisterCodec NewDelegation = types.NewDelegation MustMarshalDelegation = types.MustMarshalDelegation MustUnmarshalDelegation = types.MustUnmarshalDelegation UnmarshalDelegation = types.UnmarshalDelegation NewUnbondingDelegation = types.NewUnbondingDelegation NewUnbondingDelegationEntry = types.NewUnbondingDelegationEntry MustMarshalUBD = types.MustMarshalUBD MustUnmarshalUBD = types.MustUnmarshalUBD UnmarshalUBD = types.UnmarshalUBD NewDelegationResp = types.NewDelegationResp NewHistoricalInfo = types.NewHistoricalInfo MustMarshalHistoricalInfo = types.MustMarshalHistoricalInfo MustUnmarshalHistoricalInfo = types.MustUnmarshalHistoricalInfo UnmarshalHistoricalInfo = types.UnmarshalHistoricalInfo ErrEmptyValidatorAddr = types.ErrEmptyValidatorAddr ErrBadValidatorAddr = types.ErrBadValidatorAddr ErrNoValidatorFound = types.ErrNoValidatorFound ErrValidatorOwnerExists = types.ErrValidatorOwnerExists ErrValidatorPubKeyExists = types.ErrValidatorPubKeyExists ErrValidatorPubKeyTypeNotSupported = types.ErrValidatorPubKeyTypeNotSupported ErrValidatorJailed = types.ErrValidatorJailed ErrBadRemoveValidator = types.ErrBadRemoveValidator ErrSelfDelegationBelowMinimum = types.ErrSelfDelegationBelowMinimum ErrMinSelfDelegationInvalid = types.ErrMinSelfDelegationInvalid ErrMinSelfDelegationDecreased = types.ErrMinSelfDelegationDecreased ErrEmptyDelegatorAddr = types.ErrEmptyDelegatorAddr ErrBadDenom = types.ErrBadDenom ErrBadDelegationAddr = types.ErrBadDelegationAddr ErrBadDelegationAmount = types.ErrBadDelegationAmount ErrNoDelegation = types.ErrNoDelegation ErrBadDelegatorAddr = types.ErrBadDelegatorAddr ErrNoDelegatorForAddress = types.ErrNoDelegatorForAddress ErrDelegationValidatorEmpty = types.ErrDelegationValidatorEmpty ErrNotMature = types.ErrNotMature ErrNoUnbondingDelegation = types.ErrNoUnbondingDelegation ErrMaxUnbondingDelegationEntries = types.ErrMaxUnbondingDelegationEntries ErrInvalidHistoricalInfo = types.ErrInvalidHistoricalInfo ErrNoHistoricalInfo = types.ErrNoHistoricalInfo NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState NewMultiStakingHooks = types.NewMultiStakingHooks GetValidatorKey = types.GetValidatorKey GetValidatorByConsAddrKey = types.GetValidatorByConsAddrKey AddressFromLastValidatorPowerKey = types.AddressFromLastValidatorPowerKey GetValidatorsByPowerIndexKey = types.GetValidatorsByPowerIndexKey GetLastValidatorPowerKey = types.GetLastValidatorPowerKey ParseValidatorPowerRankKey = types.ParseValidatorPowerRankKey GetValidatorQueueTimeKey = types.GetValidatorQueueTimeKey GetDelegationKey = types.GetDelegationKey GetDelegationsKey = types.GetDelegationsKey GetUBDKey = types.GetUBDKey GetUBDByValIndexKey = types.GetUBDByValIndexKey GetUBDKeyFromValIndexKey = types.GetUBDKeyFromValIndexKey GetUBDsKey = types.GetUBDsKey GetUBDsByValIndexKey = types.GetUBDsByValIndexKey GetUnbondingDelegationTimeKey = types.GetUnbondingDelegationTimeKey GetHistoricalInfoKey = types.GetHistoricalInfoKey NewMsgCreateValidator = types.NewMsgCreateValidator NewMsgEditValidator = types.NewMsgEditValidator NewMsgDelegate = types.NewMsgDelegate NewMsgUndelegate = types.NewMsgUndelegate NewParams = types.NewParams DefaultParams = types.DefaultParams MustUnmarshalParams = types.MustUnmarshalParams UnmarshalParams = types.UnmarshalParams NewPool = types.NewPool NewQueryDelegatorParams = types.NewQueryDelegatorParams NewQueryValidatorParams = types.NewQueryValidatorParams NewQueryBondsParams = types.NewQueryBondsParams NewQueryValidatorsParams = types.NewQueryValidatorsParams NewQueryHistoricalInfoParams = types.NewQueryHistoricalInfoParams NewValidator = types.NewValidator MustMarshalValidator = types.MustMarshalValidator MustUnmarshalValidator = types.MustUnmarshalValidator UnmarshalValidator = types.UnmarshalValidator NewDescription = types.NewDescription // variable aliases ModuleCdc = types.ModuleCdc LastValidatorPowerKey = types.LastValidatorPowerKey LastTotalPowerKey = types.LastTotalPowerKey ValidatorsKey = types.ValidatorsKey ValidatorsByConsAddrKey = types.ValidatorsByConsAddrKey ValidatorsByPowerIndexKey = types.ValidatorsByPowerIndexKey DelegationKey = types.DelegationKey UnbondingDelegationKey = types.UnbondingDelegationKey UnbondingDelegationByValIndexKey = types.UnbondingDelegationByValIndexKey UnbondingQueueKey = types.UnbondingQueueKey ValidatorQueueKey = types.ValidatorQueueKey HistoricalInfoKey = types.HistoricalInfoKey KeyUnbondingTime = types.KeyUnbondingTime KeyMaxValidators = types.KeyMaxValidators KeyMaxEntries = types.KeyMaxEntries KeyBondDenom = types.KeyBondDenom )
Functions ¶
func BeginBlocker ¶
BeginBlocker will persist the current header and validator set as a historical entry and prune the oldest entry based on the HistoricalEntries parameter
func EndBlocker ¶
Called every block, 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, accountKeeper types.AccountKeeper, supplyKeeper types.SupplyKeeper, data types.GenesisState) (res []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 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 staking module.
func NewAppModule ¶
func NewAppModule(keeper Keeper, accountKeeper types.AccountKeeper, supplyKeeper types.SupplyKeeper) AppModule
NewAppModule creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)
BeginBlock returns the begin blocker for the staking module.
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock returns the end blocker for the staking 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 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. It returns no validator updates.
func (AppModule) NewHandler ¶
NewHandler returns an sdk.Handler for the staking module.
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler returns the staking module sdk.Querier.
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.
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 - 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 staking module.
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd returns no 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(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 staking 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 staking module.
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis performs genesis state validation for the staking module.
type Delegation ¶
type Delegation = types.Delegation
type DelegationI ¶
type DelegationI = exported.DelegationI
type DelegationResponse ¶
type DelegationResponse = types.DelegationResponse
type DelegationResponses ¶
type DelegationResponses = types.DelegationResponses
type Delegations ¶
type Delegations = types.Delegations
type Description ¶
type Description = types.Description
type GenesisState ¶
type GenesisState = types.GenesisState
type HistoricalInfo ¶
type HistoricalInfo = types.HistoricalInfo
type LastValidatorPower ¶
type LastValidatorPower = types.LastValidatorPower
type MsgCreateValidator ¶
type MsgCreateValidator = types.MsgCreateValidator
type MsgDelegate ¶
type MsgDelegate = types.MsgDelegate
type MsgEditValidator ¶
type MsgEditValidator = types.MsgEditValidator
type MsgUndelegate ¶
type MsgUndelegate = types.MsgUndelegate
type MultiStakingHooks ¶
type MultiStakingHooks = types.MultiStakingHooks
type QueryBondsParams ¶
type QueryBondsParams = types.QueryBondsParams
type QueryDelegatorParams ¶
type QueryDelegatorParams = types.QueryDelegatorParams
type QueryHistoricalInfoParams ¶
type QueryHistoricalInfoParams = types.QueryHistoricalInfoParams
type QueryValidatorParams ¶
type QueryValidatorParams = types.QueryValidatorParams
type QueryValidatorsParams ¶
type QueryValidatorsParams = types.QueryValidatorsParams
type UnbondingDelegation ¶
type UnbondingDelegation = types.UnbondingDelegation
type UnbondingDelegationEntry ¶
type UnbondingDelegationEntry = types.UnbondingDelegationEntry
type UnbondingDelegations ¶
type UnbondingDelegations = types.UnbondingDelegations
type ValidatorI ¶
type ValidatorI = exported.ValidatorI
type Validators ¶
type Validators = types.Validators