Documentation ¶
Overview ¶
Package eventhandler provides support for handling registry contract events and persisting them to the database.
Index ¶
Constants ¶
View Source
const ( OperatorAdded = "OperatorAdded" OperatorRemoved = "OperatorRemoved" ValidatorAdded = "ValidatorAdded" ValidatorRemoved = "ValidatorRemoved" ClusterLiquidated = "ClusterLiquidated" ClusterReactivated = "ClusterReactivated" FeeRecipientAddressUpdated = "FeeRecipientAddressUpdated" )
Event names
Variables ¶
View Source
var ( ErrAlreadyRegistered = fmt.Errorf("operator registered with the same operator public key") ErrOperatorDataNotFound = fmt.Errorf("operator data not found") ErrSignatureVerification = fmt.Errorf("signature verification failed") )
View Source
var ( // ErrInferiorBlock is returned when trying to process a block that is // not higher than the last processed block. ErrInferiorBlock = errors.New("block is not higher than the last processed block") )
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func New ¶
func New( nodeStorage nodestorage.Storage, eventParser eventparser.Parser, taskExecutor taskExecutor, domain spectypes.DomainType, operatorData OperatorData, shareEncryptionKeyProvider ShareEncryptionKeyProvider, keyManager spectypes.KeyManager, beacon beaconprotocol.BeaconNode, storageMap *qbftstorage.QBFTStores, opts ...Option, ) (*EventHandler, error)
func (*EventHandler) HandleBlockEventsStream ¶
func (eh *EventHandler) HandleBlockEventsStream(logs <-chan executionclient.BlockLogs, executeTasks bool) (lastProcessedBlock uint64, err error)
func (*EventHandler) HandleLocalEvents ¶
func (eh *EventHandler) HandleLocalEvents(localEvents []localevents.Event) error
type LiquidateClusterTask ¶
type LiquidateClusterTask struct {
// contains filtered or unexported fields
}
func NewLiquidateClusterTask ¶
func (LiquidateClusterTask) Execute ¶
func (t LiquidateClusterTask) Execute() error
type MalformedEventError ¶
type MalformedEventError struct {
Err error
}
MalformedEventError is returned when event is malformed
func (*MalformedEventError) Error ¶
func (e *MalformedEventError) Error() string
func (*MalformedEventError) Unwrap ¶
func (e *MalformedEventError) Unwrap() error
type OperatorData ¶
type OperatorData interface { GetOperatorData() *storage.OperatorData SetOperatorData(*storage.OperatorData) }
type Option ¶
type Option func(*EventHandler)
Option defines EventHandler configuration option.
func WithFullNode ¶
func WithFullNode() Option
WithFullNode signals that node works in a full node state.
type ReactivateClusterTask ¶
type ReactivateClusterTask struct {
// contains filtered or unexported fields
}
func (ReactivateClusterTask) Execute ¶
func (t ReactivateClusterTask) Execute() error
type ShareEncryptionKeyProvider ¶
type ShareEncryptionKeyProvider = func() (*rsa.PrivateKey, bool, error)
type StartValidatorTask ¶
type StartValidatorTask struct {
// contains filtered or unexported fields
}
func NewStartValidatorTask ¶
func NewStartValidatorTask(executor startValidatorExecutor, share *ssvtypes.SSVShare) *StartValidatorTask
func (StartValidatorTask) Execute ¶
func (t StartValidatorTask) Execute() error
type StopValidatorTask ¶
type StopValidatorTask struct {
// contains filtered or unexported fields
}
func NewStopValidatorTask ¶
func NewStopValidatorTask(executor stopValidatorExecutor, publicKey []byte) *StopValidatorTask
func (StopValidatorTask) Execute ¶
func (t StopValidatorTask) Execute() error
type UpdateFeeRecipientTask ¶
type UpdateFeeRecipientTask struct {
// contains filtered or unexported fields
}
func NewUpdateFeeRecipientTask ¶
func NewUpdateFeeRecipientTask(executor updateFeeRecipientExecutor, owner, recipient ethcommon.Address) *UpdateFeeRecipientTask
func (UpdateFeeRecipientTask) Execute ¶
func (t UpdateFeeRecipientTask) Execute() error
Click to show internal directories.
Click to hide internal directories.