Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnknownConsensusEngineID = errors.New("unknown consensus engine ID")
)
Functions ¶
This section is empty.
Types ¶
type BlockImportHandler ¶ added in v0.8.0
type BlockImportHandler struct {
// contains filtered or unexported fields
}
func NewBlockImportHandler ¶ added in v0.8.0
func NewBlockImportHandler(epochState EpochState, grandpaState GrandpaState) *BlockImportHandler
func (*BlockImportHandler) HandleDigests ¶ added in v0.8.0
func (h *BlockImportHandler) HandleDigests(header *types.Header) error
HandleDigests handles consensus digests for an imported block
type BlockState ¶
type BlockState interface {
GetImportedBlockNotifierChannel() chan *types.Block
FreeImportedBlockNotifierChannel(ch chan *types.Block)
GetFinalisedNotifierChannel() chan *types.FinalisationInfo
FreeFinalisedNotifierChannel(ch chan *types.FinalisationInfo)
}
BlockState interface for block state methods
type EpochState ¶
type EpochState interface {
GetEpochForBlock(header *types.Header) (uint64, error)
HandleBABEDigest(header *types.Header, digest types.BabeConsensusDigest) error
FinalizeBABENextEpochData(finalizedHeader *types.Header) error
FinalizeBABENextConfigData(finalizedHeader *types.Header) error
}
EpochState is the interface for state.EpochState
type GrandpaState ¶
type GrandpaState interface {
HandleGRANDPADigest(header *types.Header, digest types.GrandpaConsensusDigest) error
ApplyScheduledChanges(finalizedHeader *types.Header) error
}
GrandpaState is the interface for the state.GrandpaState
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is used to handle consensus messages and relevant authority updates to BABE and GRANDPA
func NewHandler ¶
func NewHandler(blockState BlockState, epochState EpochState, grandpaState GrandpaState) (*Handler, error)
NewHandler returns a new Handler
Click to show internal directories.
Click to hide internal directories.