Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, keeper Keeper) (updates []abci.ValidatorUpdate)
- func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- func ParamKeyTable() params.KeyTable
- func ValidateGenesis(data GenesisState) error
- 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 (am AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (am AppModule) Route() string
- type AppModuleBasic
- 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) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type Candidate
- type Delegator
- type GenesisState
- type Keeper
- func (k Keeper) AddEpochMiningReward(ctx sdk.Context, amount sdk.Int)
- func (k Keeper) AddEpochServiceReward(ctx sdk.Context, amount sdk.Int)
- func (k Keeper) AddReward(ctx sdk.Context, ethAddress string, miningReward, serviceReward sdk.Int)
- func (k Keeper) DistributeCandidatePendingReward(ctx sdk.Context, ethAddress string)
- func (k Keeper) DistributeReward(ctx sdk.Context)
- func (k Keeper) EpochLength(ctx sdk.Context) (res uint)
- func (k Keeper) GetAllCandidates(ctx sdk.Context) (candidates []Candidate)
- func (k Keeper) GetAllDelegators(ctx sdk.Context, candidateAddr string) (delegators []Delegator)
- func (k Keeper) GetBondedValidators(ctx sdk.Context) []staking.Validator
- func (k Keeper) GetCandidate(ctx sdk.Context, candidateAddr string) (candidate Candidate, found bool)
- func (k Keeper) GetDelegator(ctx sdk.Context, candidateAddr, delegatorAddr string) (delegator Delegator, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetPendingReward(ctx sdk.Context, ethAddress string) (pendingReward PendingReward)
- func (keeper Keeper) GetPendingRewards(ctx sdk.Context) (pendingRewards []PendingReward)
- func (k Keeper) GetReward(ctx sdk.Context, ethAddress string) (Reward, bool)
- func (k Keeper) GetRewardEpoch(ctx sdk.Context) (epoch RewardEpoch)
- func (k Keeper) GetRewardStats(ctx sdk.Context) RewardStats
- func (keeper Keeper) GetRewards(ctx sdk.Context) (rewards []Reward)
- func (k Keeper) GetSyncer(ctx sdk.Context) Syncer
- func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (staking.Validator, bool)
- func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) (staking.Validator, bool)
- func (k Keeper) GetValidatorCandidates(ctx sdk.Context) (candidates []Candidate)
- func (k Keeper) InitAccount(ctx sdk.Context, accAddress sdk.AccAddress)
- func (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, ...)
- func (k Keeper) IteratePendingRewards(ctx sdk.Context, handler func(pendingReward PendingReward) (stop bool))
- func (k Keeper) IterateRewards(ctx sdk.Context, handler func(reward Reward) (stop bool))
- func (k Keeper) MaxValidatorDiff(ctx sdk.Context) (res uint)
- func (k Keeper) MiningReward(ctx sdk.Context) (res sdk.Int)
- func (k Keeper) PullerReward(ctx sdk.Context) (res sdk.Int)
- func (k Keeper) RemoveAccount(ctx sdk.Context, accAddress sdk.AccAddress)
- func (k Keeper) RemoveDelegator(ctx sdk.Context, delegator Delegator)
- func (k Keeper) ResetPendingReward(ctx sdk.Context, ethAddress string)
- func (k Keeper) ResetRewardEpoch(ctx sdk.Context)
- func (k Keeper) SetCandidate(ctx sdk.Context, candidate Candidate)
- func (k Keeper) SetDelegator(ctx sdk.Context, delegator Delegator)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetPendingReward(ctx sdk.Context, pendingReward PendingReward)
- func (k Keeper) SetReward(ctx sdk.Context, reward Reward)
- func (k Keeper) SetRewardEpoch(ctx sdk.Context, epoch RewardEpoch)
- func (k Keeper) SetSyncer(ctx sdk.Context, syncer Syncer)
- func (k Keeper) SyncerDuration(ctx sdk.Context) (res uint)
- func (k Keeper) WithdrawWindow(ctx sdk.Context) (res time.Duration)
- type MsgEditCandidateDescription
- type MsgSetTransactors
- type MsgSignReward
- type MsgWithdrawReward
- type Params
- type PendingReward
- type QueryCandidateParams
- type QueryDelegatorParams
- type QueryRewardParams
- type Reward
- type RewardEpoch
- type RewardStats
- type Syncer
Constants ¶
const ( ModuleName = types.ModuleName RouterKey = types.RouterKey StoreKey = types.StoreKey QuerySyncer = types.QuerySyncer QueryDelegator = types.QueryDelegator QueryCandidate = types.QueryCandidate QueryCandidates = types.QueryCandidates QueryCandidateDelegators = types.QueryCandidateDelegators QueryReward = types.QueryReward QueryRewardEpoch = types.QueryRewardEpoch QueryRewardStats = types.QueryRewardStats QueryParameters = types.QueryParameters TypeMsgWithdrawReward = types.TypeMsgWithdrawReward AttributeKeyEthAddress = types.AttributeKeyEthAddress ActionInitiateWithdraw = types.ActionInitiateWithdraw )
const (
DefaultParamspace = types.ModuleName
)
Default parameter namespace
Variables ¶
var ( NewMsgSetTransactors = types.NewMsgSetTransactors NewMsgWithdrawReward = types.NewMsgWithdrawReward NewMsgEditCandidateDescription = types.NewMsgEditCandidateDescription NewMsgSignReward = types.NewMsgSignReward NewQueryRewardParams = types.NewQueryRewardParams ModuleCdc = types.ModuleCdc RegisterCodec = types.RegisterCodec SyncerKey = types.SyncerKey CandidateKeyPrefix = types.CandidateKeyPrefix GetDelegatorKey = types.GetDelegatorKey GetDelegatorsKey = types.GetDelegatorsKey GetCandidateKey = types.GetCandidateKey RewardKeyPrefix = types.RewardKeyPrefix GetRewardKey = types.GetRewardKey PendingRewardKeyPrefix = types.PendingRewardKeyPrefix GetPendingRewardKey = types.GetPendingRewardKey RewardEpochKey = types.RewardEpochKey NewSyncer = types.NewSyncer NewDelegator = types.NewDelegator NewCandidate = types.NewCandidate NewReward = types.NewReward NewRewardEpoch = types.NewRewardEpoch NewPendingReward = types.NewPendingReward NewRewardStats = types.NewRewardStats CLIQuerySyncer = cli.QuerySyncer CLIQueryCandidate = cli.QueryCandidate CLIQueryCandidates = cli.QueryCandidates CLIQueryCandidateDelegators = cli.QueryCandidateDelegators CLIQueryReward = cli.QueryReward CLIQueryDelegator = cli.QueryDelegator CLIQueryValidator = cli.QueryValidator CLIQueryValidators = cli.QueryValidators CLIQueryBondedValidators = cli.QueryBondedValidators CLIQueryParams = cli.QueryParams DefaultParams = types.DefaultParams )
Functions ¶
func EndBlocker ¶
func EndBlocker(ctx sdk.Context, keeper Keeper) (updates []abci.ValidatorUpdate)
EndBlocker called every block, update validator set, distribute rewards
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate
func NewHandler ¶
NewHandler returns a handler for "validator" type messages.
func NewQuerier ¶
NewQuerier is the module level router for state queries
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
func NewAppModule ¶
NewAppModule creates a new AppModule Object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
func (AppModule) NewHandler ¶
func (AppModule) NewQuerierHandler ¶
func (AppModule) QuerierRoute ¶
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
type AppModuleBasic ¶
type AppModuleBasic struct{}
app module Basics object
func (AppModuleBasic) DefaultGenesis ¶
func (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 (AppModuleBasic) Name() string
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
Register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
Validation check of the Genesis
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` Syncer Syncer `json:"syncer" yaml:"syncer"` Candidates []Candidate `json:"candidates" yaml:"candidates"` Delegators []Delegator `json:"delegators" yaml:"delegators"` Rewards []Reward `json:"rewards" yaml:"rewards"` PendingRewards []PendingReward `json:"pending_rewards" yaml:"pending_rewards"` RewardEpoch RewardEpoch `json:"reward_epoch" yaml:"reward_epoch"` }
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper Keeper) GenesisState
func NewGenesisState ¶
func NewGenesisState(params Params) GenesisState
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec, accountKeeper auth.AccountKeeper, stakingKeeper staking.Keeper, paramstore params.Subspace) Keeper
NewKeeper creates new instances of the validator Keeper
func (Keeper) AddEpochMiningReward ¶ added in v0.2.4
func (Keeper) AddEpochServiceReward ¶ added in v0.2.4
func (Keeper) DistributeCandidatePendingReward ¶ added in v0.2.4
func (Keeper) DistributeReward ¶
Distribute epoch rewards to all validators and delegators
func (Keeper) EpochLength ¶ added in v0.2.4
EpochLength - epoch length
func (Keeper) GetAllCandidates ¶
Get the list of all candidates
func (Keeper) GetAllDelegators ¶
Get the list of all delegators
func (Keeper) GetBondedValidators ¶ added in v0.2.4
Get validators metadata
func (Keeper) GetCandidate ¶
func (k Keeper) GetCandidate(ctx sdk.Context, candidateAddr string) (candidate Candidate, found bool)
Get the entire Candidate metadata
func (Keeper) GetDelegator ¶
func (k Keeper) GetDelegator(ctx sdk.Context, candidateAddr, delegatorAddr string) (delegator Delegator, found bool)
Get the entire Delegator metadata for a candidateAddr and delegatorAddr
func (Keeper) GetPendingReward ¶ added in v0.2.4
func (k Keeper) GetPendingReward(ctx sdk.Context, ethAddress string) (pendingReward PendingReward)
func (Keeper) GetPendingRewards ¶ added in v0.2.5
func (keeper Keeper) GetPendingRewards(ctx sdk.Context) (pendingRewards []PendingReward)
GetPendingRewards returns all the pendingRewards from store
func (Keeper) GetRewardEpoch ¶ added in v0.2.4
func (k Keeper) GetRewardEpoch(ctx sdk.Context) (epoch RewardEpoch)
func (Keeper) GetRewardStats ¶ added in v0.2.5
func (k Keeper) GetRewardStats(ctx sdk.Context) RewardStats
func (Keeper) GetRewards ¶ added in v0.2.5
GetRewards returns all the rewards from store
func (Keeper) GetValidator ¶
Get a validator by validator account address
func (Keeper) GetValidatorByConsAddr ¶
func (k Keeper) GetValidatorByConsAddr(ctx sdk.Context, addr sdk.ConsAddress) (staking.Validator, bool)
Get a validator by consencus address
func (Keeper) GetValidatorCandidates ¶
GetValidatorCandidates get candidates info for current validators
func (Keeper) InitAccount ¶ added in v0.2.0
func (k Keeper) InitAccount(ctx sdk.Context, accAddress sdk.AccAddress)
func (Keeper) IterateBondedValidatorsByPower ¶ added in v0.2.0
func (Keeper) IteratePendingRewards ¶ added in v0.2.5
func (k Keeper) IteratePendingRewards(ctx sdk.Context, handler func(pendingReward PendingReward) (stop bool))
IteratePendingRewards iterates over the stored penalties
func (Keeper) IterateRewards ¶ added in v0.2.5
IterateRewards iterates over the stored penalties
func (Keeper) MaxValidatorDiff ¶ added in v0.2.5
MaxValidatorDiff - max validator add
func (Keeper) MiningReward ¶
MiningReward - mining reward
func (Keeper) PullerReward ¶ added in v0.2.0
PullerReward - puller reward
func (Keeper) RemoveAccount ¶ added in v0.2.5
func (k Keeper) RemoveAccount(ctx sdk.Context, accAddress sdk.AccAddress)
func (Keeper) RemoveDelegator ¶ added in v0.2.4
func (Keeper) ResetPendingReward ¶ added in v0.2.4
func (Keeper) ResetRewardEpoch ¶ added in v0.2.4
func (Keeper) SetCandidate ¶
Sets the Candidate metadata
func (Keeper) SetDelegator ¶
Sets the entire Delegator metadata for a candidateAddr and delegatorAddr
func (Keeper) SetPendingReward ¶ added in v0.2.4
func (k Keeper) SetPendingReward(ctx sdk.Context, pendingReward PendingReward)
func (Keeper) SetRewardEpoch ¶ added in v0.2.4
func (k Keeper) SetRewardEpoch(ctx sdk.Context, epoch RewardEpoch)
func (Keeper) SyncerDuration ¶ added in v0.2.3
SyncerDuration - syncer duration
type MsgEditCandidateDescription ¶ added in v0.2.3
type MsgEditCandidateDescription = types.MsgEditCandidateDescription
type MsgSetTransactors ¶ added in v0.2.0
type MsgSetTransactors = types.MsgSetTransactors
type MsgSignReward ¶
type MsgSignReward = types.MsgSignReward
type MsgWithdrawReward ¶
type MsgWithdrawReward = types.MsgWithdrawReward
type PendingReward ¶ added in v0.2.4
type PendingReward = types.PendingReward
type QueryCandidateParams ¶
type QueryCandidateParams = types.QueryCandidateParams
type QueryDelegatorParams ¶
type QueryDelegatorParams = types.QueryDelegatorParams
type QueryRewardParams ¶
type QueryRewardParams = types.QueryRewardParams
type RewardEpoch ¶ added in v0.2.4
type RewardEpoch = types.RewardEpoch
type RewardStats ¶ added in v0.2.5
type RewardStats = types.RewardStats