validator

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName               = types.ModuleName
	RouterKey                = types.RouterKey
	StoreKey                 = types.StoreKey
	QuerySyncer              = types.QuerySyncer
	QueryDelegator           = types.QueryDelegator
	QueryCandidate           = types.QueryCandidate
	QueryCandidateDelegators = types.QueryCandidateDelegators
	QueryReward              = types.QueryReward
	QueryParameters          = types.QueryParameters
	TypeMsgWithdrawReward    = types.TypeMsgWithdrawReward
	AttributeKeyEthAddress   = types.AttributeKeyEthAddress
	ActionInitiateWithdraw   = types.ActionInitiateWithdraw
	ServiceReward            = types.ServiceReward
	MiningReward             = types.MiningReward
)
View Source
const (
	DefaultParamspace = types.ModuleName
)

Default parameter namespace

Variables

View Source
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
	GetRewardKey                   = types.GetRewardKey
	NewSyncer                      = types.NewSyncer
	NewDelegator                   = types.NewDelegator
	NewCandidate                   = types.NewCandidate
	NewReward                      = types.NewReward
	CLIQuerySyncer                 = cli.QuerySyncer
	CLIQueryCandidate              = cli.QueryCandidate
	CLIQueryCandidateDelegators    = cli.QueryCandidateDelegators
	CLIQueryReward                 = cli.QueryReward
	CLIQueryDelegator              = cli.QueryDelegator
	CLIQueryValidator              = cli.QueryValidator
	CLIQueryValidators             = cli.QueryValidators
	CLIQueryBondedValidators       = cli.QueryBondedValidators
	DefaultParams                  = types.DefaultParams
)

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, req abci.RequestEndBlock, keeper Keeper) (updates []abci.ValidatorUpdate)

EndBlocker called every block, process inflation, update validator set.

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper Keeper, data GenesisState) []abci.ValidatorUpdate

func NewHandler

func NewHandler(keeper Keeper) sdk.Handler

NewHandler returns a handler for "validator" type messages.

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamTable for validator module

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(k Keeper) AppModule

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, req 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) Name

func (AppModule) Name() string

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

func (AppModule) Route

func (am AppModule) Route() string

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 Candidate

type Candidate = types.Candidate

type Delegator

type Delegator = types.Delegator

type GenesisState

type GenesisState struct {
	Params Params `json:"params" yaml:"params"`
}

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) AddReward added in v0.2.0

func (k Keeper) AddReward(ctx sdk.Context, ethAddress string, amount sdk.Int, rewardType RewardType)

AddReward add reward to a specific ethAddress

func (Keeper) DistributeReward

func (k Keeper) DistributeReward(ctx sdk.Context, totalReward sdk.Int, rewardType RewardType)

DistributeServiceReward distributes rewards to candidates and their delegators

func (Keeper) GetAllCandidates

func (k Keeper) GetAllCandidates(ctx sdk.Context) (candidates []Candidate)

Get the list of all candidates

func (Keeper) GetAllDelegators

func (k Keeper) GetAllDelegators(ctx sdk.Context, candidateAddr string) (delegators []Delegator)

Get the list of all delegators

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) GetParams

func (k Keeper) GetParams(ctx sdk.Context) types.Params

Get all parameteras as types.Params

func (Keeper) GetReward

func (k Keeper) GetReward(ctx sdk.Context, ethAddress string) (Reward, bool)

Get the entire Reward metadata for ethAddress

func (Keeper) GetSyncer added in v0.2.3

func (k Keeper) GetSyncer(ctx sdk.Context) Syncer

Get the entire Syncer metadata

func (Keeper) GetValidator

func (k Keeper) GetValidator(ctx sdk.Context, addr sdk.ValAddress) (staking.Validator, bool)

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

func (k Keeper) GetValidatorCandidates(ctx sdk.Context) (candidates []Candidate)

GetValidatorCandidates get candidates info for current validators

func (Keeper) GetValidators

func (k Keeper) GetValidators(ctx sdk.Context) []staking.Validator

Get validators metadata

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 (k Keeper) IterateBondedValidatorsByPower(ctx sdk.Context, fn func(index int64, validator exported.ValidatorI) (stop bool))

func (Keeper) MiningReward

func (k Keeper) MiningReward(ctx sdk.Context) (res sdk.Int)

MiningReward - mining reward

func (Keeper) PullerReward added in v0.2.0

func (k Keeper) PullerReward(ctx sdk.Context) (res sdk.Int)

PullerReward - puller reward

func (Keeper) SetCandidate

func (k Keeper) SetCandidate(ctx sdk.Context, candidate Candidate)

Sets the Candidate metadata

func (Keeper) SetDelegator

func (k Keeper) SetDelegator(ctx sdk.Context, delegator Delegator)

Sets the entire Delegator metadata for a candidateAddr and delegatorAddr

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

set the params

func (Keeper) SetReward

func (k Keeper) SetReward(ctx sdk.Context, reward Reward)

Sets the Reward metadata for ethAddress

func (Keeper) SetSyncer added in v0.2.3

func (k Keeper) SetSyncer(ctx sdk.Context, syncer Syncer)

Sets the entire Syncer metadata

func (Keeper) SyncerDuration added in v0.2.3

func (k Keeper) SyncerDuration(ctx sdk.Context) (res uint)

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 Params

type Params = types.Params

type QueryCandidateParams

type QueryCandidateParams = types.QueryCandidateParams

type QueryDelegatorParams

type QueryDelegatorParams = types.QueryDelegatorParams

type QueryRewardParams

type QueryRewardParams = types.QueryRewardParams

type Reward

type Reward = types.Reward

type RewardType

type RewardType = types.RewardType

type Syncer added in v0.2.3

type Syncer = types.Syncer

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL