validator

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// ModuleKey is the name of the module
	ModuleName = "validator"

	// RouterKey is the message route for gov
	RouterKey = ModuleName

	// QuerierRoute is the querier route for gov
	QuerierRoute = ModuleName

	QueryValidator        = "validator"
	QueryValidatorList    = "valList"
	QueryElectionVoteList = "electionVoteList"
)

Variables

This section is empty.

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, vm ValidatorKeeper)

BeginBlocker - execute before every block.

func NewHandler

func NewHandler(vm ValidatorKeeper) sdk.Handler

NewHandler - Handle all "validator" type messages.

func NewQuerier added in v0.2.0

func NewQuerier(vm ValidatorKeeper) sdk.Querier

creates a querier for validator REST endpoints

Types

type ValidatorKeeper added in v0.4.0

type ValidatorKeeper interface {
	InitGenesis(ctx sdk.Context)
	OnBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock)
	RegisterValidator(ctx sdk.Context, username linotypes.AccountKey, valPubKey crypto.PubKey, link string) sdk.Error
	RevokeValidator(ctx sdk.Context, username linotypes.AccountKey) sdk.Error
	VoteValidator(ctx sdk.Context, username linotypes.AccountKey, votedValidators []linotypes.AccountKey) sdk.Error
	DistributeInflationToValidator(ctx sdk.Context) sdk.Error
	PunishCommittingValidator(ctx sdk.Context, username linotypes.AccountKey,
		penalty linotypes.Coin, punishType linotypes.PunishType) sdk.Error
	Hooks() votemn.Hooks
	UpdateValidator(ctx sdk.Context, username linotypes.AccountKey, link string) sdk.Error

	// getters
	GetInitValidators(ctx sdk.Context) ([]abci.ValidatorUpdate, sdk.Error)
	GetValidatorUpdates(ctx sdk.Context) ([]abci.ValidatorUpdate, sdk.Error)
	GetValidator(ctx sdk.Context, username linotypes.AccountKey) (*model.Validator, sdk.Error)
	GetValidatorList(ctx sdk.Context) *model.ValidatorList
	GetElectionVoteList(ctx sdk.Context, accKey linotypes.AccountKey) *model.ElectionVoteList
	GetCommittingValidators(ctx sdk.Context) []linotypes.AccountKey
	GetCommittingValidatorVoteStatus(ctx sdk.Context) []model.ReceivedVotesStatus

	// import export
	ExportToFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error
	ImportFromFile(ctx sdk.Context, cdc *codec.Codec, filepath string) error
}

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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