Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidBlock is a general error used when the block structure is invalid or its field values are inconsistent. ErrInvalidBlock = errors.New("invalid block") // ErrInvalidBlockSequence is returned when the block sequence is invalid. ErrInvalidBlockSequence = errors.New("invalid block sequence") // ErrInvalidParentHash is returned when the parent block hash is invalid. ErrInvalidParentHash = errors.New("parent block hash is invalid") // ErrInvalidSha3Uncles is returned when the block's sha3 uncles root is invalid. ErrInvalidSha3Uncles = errors.New("invalid block sha3 uncles root") // ErrInvalidTxRoot is returned when the block's transactions root is invalid. ErrInvalidTxRoot = errors.New("invalid block transactions root") // ErrNoBlock is returned when no block data is passed in. ErrNoBlock = errors.New("no block data passed in") // ErrParentHashMismatch is returned when the parent block hash doesn't match. ErrParentHashMismatch = errors.New("invalid parent block hash") // ErrParentNotFound is returned when the parent block is not found. ErrParentNotFound = errors.New("parent block not found") )
Functions ¶
This section is empty.
Types ¶
type Validator ¶
type Validator interface {
Apply(block *types.Block) error
Check(block *types.Block) error
ProcessFraudproof(block *types.Block) error
}
Validator is an interface that defines methods for applying, checking, and processing fraudproof blocks.
func New ¶
func New(blockchain *blockchain.Blockchain, sequencer types.Address, logger hclog.Logger) Validator
New creates a new instance of Validator with the provided parameters.
Click to show internal directories.
Click to hide internal directories.