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 BlockState ¶
type BlockState interface { BestBlockHeader() (*types.Header, error) 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) SetEpochData(epoch uint64, info *types.EpochData) error SetConfigData(epoch uint64, info *types.ConfigData) error StoreBABENextEpochData(epoch uint64, hash common.Hash, nextEpochData types.NextEpochData) StoreBABENextConfigData(epoch uint64, hash common.Hash, nextEpochData types.NextConfigData) FinalizeBABENextEpochData(finalizedHeader *types.Header) error FinalizeBABENextConfigData(finalizedHeader *types.Header) error }
EpochState is the interface for state.EpochState
type GrandpaState ¶
type GrandpaState interface { SetNextChange(authorities []grandpa.Voter, number uint) error IncrementSetID() (newSetID uint64, err error) SetNextPause(number uint) error SetNextResume(number uint) error GetCurrentSetID() (uint64, error) HandleGRANDPADigest(header *types.Header, digest scale.VaryingDataType) error ApplyScheduledChanges(finalizedHeader *types.Header) error ApplyForcedChanges(importedHeader *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(lvl log.Level, blockState BlockState, epochState EpochState, grandpaState GrandpaState) (*Handler, error)
NewHandler returns a new Handler
func (*Handler) HandleDigests ¶
HandleDigests handles consensus digests for an imported block
Click to show internal directories.
Click to hide internal directories.