rules

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafetyError

type SafetyError interface {
	error
	Common() bool
	Fetch() bool   //Is the error need fetch
	NewView() bool //need change view
	FetchPrepare() bool
}

type SafetyRules

type SafetyRules interface {
	// Security rules for proposed blocks
	PrepareBlockRules(block *protocols.PrepareBlock) SafetyError

	// Security rules for proposed votes
	PrepareVoteRules(vote *protocols.PrepareVote) SafetyError

	// Security rules for viewChange
	ViewChangeRules(vote *protocols.ViewChange) SafetyError

	// Security rules for qcblock
	QCBlockRules(block *types.Block, qc *ctypes.QuorumCert) SafetyError
}

func NewSafetyRules

func NewSafetyRules(viewState *state.ViewState, blockTree *ctypes.BlockTree, config *ctypes.Config, validatorPool *validator.ValidatorPool) SafetyRules

type VoteError

type VoteError interface {
	error
	Discard() bool //Is the error need discard
}

type VoteRules

type VoteRules interface {
	// Determine if the resulting vote is allowed to be sent
	AllowVote(vote *protocols.PrepareVote) VoteError
}

func NewVoteRules

func NewVoteRules(viewState *state.ViewState) VoteRules

Jump to

Keyboard shortcuts

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