Documentation ¶
Overview ¶
Package eth1 is a generated GoMock package.
Package eth1 is a generated GoMock package.
Index ¶
- func ContractABI(abiVersion Version) string
- func HandleEventResult(logger *zap.Logger, event Event, logFields []zap.Field, err error, ...) []error
- func LoadABI(logger *zap.Logger, abiFilePath string) error
- func SyncEth1Events(logger *zap.Logger, client Client, storage SyncOffsetStorage, ...) error
- type AbiParser
- func (ap AbiParser) ParseClusterLiquidatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ClusterLiquidatedEvent, error)
- func (ap AbiParser) ParseClusterReactivatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ClusterReactivatedEvent, error)
- func (ap AbiParser) ParseFeeRecipientAddressUpdatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.FeeRecipientAddressUpdatedEvent, error)
- func (ap AbiParser) ParseOperatorAddedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.OperatorAddedEvent, error)
- func (ap AbiParser) ParseOperatorRemovedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.OperatorRemovedEvent, error)
- func (ap AbiParser) ParseValidatorAddedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ValidatorAddedEvent, error)
- func (ap AbiParser) ParseValidatorRemovedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ValidatorRemovedEvent, error)
- type AbiVersion
- type Client
- type ClusterLiquidatedEventYAML
- type ClusterReactivatedEventYAML
- type Event
- type FeeRecipientAddressUpdatedEventYAML
- type MockClient
- type MockClientMockRecorder
- type MockSyncOffsetStorage
- type MockSyncOffsetStorageMockRecorder
- type OperatorRemovedEventYAML
- type Options
- type SyncEndedEvent
- type SyncEventHandler
- type SyncOffset
- type SyncOffsetStorage
- type ValidatorRemovedEventYAML
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContractABI ¶ added in v0.0.6
ContractABI abi of the ssv-network contract
func HandleEventResult ¶ added in v0.3.0
func HandleEventResult(logger *zap.Logger, event Event, logFields []zap.Field, err error, ongoingSync bool) []error
HandleEventResult handles the result of an event
func SyncEth1Events ¶ added in v0.0.4
func SyncEth1Events( logger *zap.Logger, client Client, storage SyncOffsetStorage, network networkconfig.NetworkConfig, syncOffset *SyncOffset, handler SyncEventHandler, ) error
SyncEth1Events sync past events
Types ¶
type AbiParser ¶ added in v0.1.8
type AbiParser struct {
Version AbiVersion
}
AbiParser serves as a parsing client for events from contract
func (AbiParser) ParseClusterLiquidatedEvent ¶ added in v0.4.7
func (ap AbiParser) ParseClusterLiquidatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ClusterLiquidatedEvent, error)
ParseClusterLiquidatedEvent parses ClusterLiquidatedEvent
func (AbiParser) ParseClusterReactivatedEvent ¶ added in v0.4.7
func (ap AbiParser) ParseClusterReactivatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ClusterReactivatedEvent, error)
ParseClusterReactivatedEvent parses ClusterReactivatedEvent
func (AbiParser) ParseFeeRecipientAddressUpdatedEvent ¶ added in v0.4.7
func (ap AbiParser) ParseFeeRecipientAddressUpdatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.FeeRecipientAddressUpdatedEvent, error)
ParseFeeRecipientAddressUpdatedEvent parses FeeRecipientAddressUpdatedEvent
func (AbiParser) ParseOperatorAddedEvent ¶ added in v0.1.8
func (ap AbiParser) ParseOperatorAddedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.OperatorAddedEvent, error)
ParseOperatorAddedEvent parses an OperatorAddedEvent
func (AbiParser) ParseOperatorRemovedEvent ¶ added in v0.4.7
func (ap AbiParser) ParseOperatorRemovedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.OperatorRemovedEvent, error)
ParseOperatorRemovedEvent parses an OperatorRemovedEvent
func (AbiParser) ParseValidatorAddedEvent ¶ added in v0.1.8
func (ap AbiParser) ParseValidatorAddedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ValidatorAddedEvent, error)
ParseValidatorAddedEvent parses ValidatorAddedEvent
func (AbiParser) ParseValidatorRemovedEvent ¶ added in v0.2.0
func (ap AbiParser) ParseValidatorRemovedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ValidatorRemovedEvent, error)
ParseValidatorRemovedEvent parses ValidatorRemovedEvent
type AbiVersion ¶ added in v0.1.8
type AbiVersion interface { ParseOperatorAddedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.OperatorAddedEvent, error) ParseOperatorRemovedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.OperatorRemovedEvent, error) ParseValidatorAddedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ValidatorAddedEvent, error) ParseValidatorRemovedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ValidatorRemovedEvent, error) ParseClusterLiquidatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ClusterLiquidatedEvent, error) ParseClusterReactivatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.ClusterReactivatedEvent, error) ParseFeeRecipientAddressUpdatedEvent(log types.Log, contractAbi abi.ABI) (*abiparser.FeeRecipientAddressUpdatedEvent, error) }
AbiVersion serves as the parser client interface
type Client ¶
type Client interface { EventsFeed() *event.Feed Start(logger *zap.Logger) error Sync(logger *zap.Logger, fromBlock *big.Int) error IsReady(ctx context.Context) (bool, error) }
Client represents the required interface for eth1 client
type ClusterLiquidatedEventYAML ¶ added in v0.4.7
type ClusterReactivatedEventYAML ¶ added in v0.4.7
type Event ¶
type Event struct { // Log is the raw event log Log types.Log // Name is the event name used for internal representation. Name string // Data is the parsed event Data interface{} }
Event represents an eth1 event log in the system
func (*Event) UnmarshalYAML ¶ added in v0.4.0
type FeeRecipientAddressUpdatedEventYAML ¶ added in v0.4.7
type MockClient ¶ added in v0.2.0
type MockClient struct {
// contains filtered or unexported fields
}
MockClient is a mock of Client interface.
func NewMockClient ¶ added in v0.2.0
func NewMockClient(ctrl *gomock.Controller) *MockClient
NewMockClient creates a new mock instance.
func (*MockClient) EXPECT ¶ added in v0.2.0
func (m *MockClient) EXPECT() *MockClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockClient) EventsFeed ¶ added in v0.2.0
func (m *MockClient) EventsFeed() *event.Feed
EventsFeed mocks base method.
func (*MockClient) IsReady ¶
func (m *MockClient) IsReady(ctx context.Context) (bool, error)
IsReady mocks base method.
type MockClientMockRecorder ¶ added in v0.2.0
type MockClientMockRecorder struct {
// contains filtered or unexported fields
}
MockClientMockRecorder is the mock recorder for MockClient.
func (*MockClientMockRecorder) EventsFeed ¶ added in v0.2.0
func (mr *MockClientMockRecorder) EventsFeed() *gomock.Call
EventsFeed indicates an expected call of EventsFeed.
func (*MockClientMockRecorder) IsReady ¶
func (mr *MockClientMockRecorder) IsReady(ctx interface{}) *gomock.Call
IsReady indicates an expected call of IsReady.
func (*MockClientMockRecorder) Start ¶ added in v0.2.0
func (mr *MockClientMockRecorder) Start(logger interface{}) *gomock.Call
Start indicates an expected call of Start.
func (*MockClientMockRecorder) Sync ¶ added in v0.2.0
func (mr *MockClientMockRecorder) Sync(logger, fromBlock interface{}) *gomock.Call
Sync indicates an expected call of Sync.
type MockSyncOffsetStorage ¶ added in v0.2.0
type MockSyncOffsetStorage struct {
// contains filtered or unexported fields
}
MockSyncOffsetStorage is a mock of SyncOffsetStorage interface.
func NewMockSyncOffsetStorage ¶ added in v0.2.0
func NewMockSyncOffsetStorage(ctrl *gomock.Controller) *MockSyncOffsetStorage
NewMockSyncOffsetStorage creates a new mock instance.
func (*MockSyncOffsetStorage) EXPECT ¶ added in v0.2.0
func (m *MockSyncOffsetStorage) EXPECT() *MockSyncOffsetStorageMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSyncOffsetStorage) GetSyncOffset ¶ added in v0.2.0
func (m *MockSyncOffsetStorage) GetSyncOffset() (*SyncOffset, bool, error)
GetSyncOffset mocks base method.
func (*MockSyncOffsetStorage) SaveSyncOffset ¶ added in v0.2.0
func (m *MockSyncOffsetStorage) SaveSyncOffset(offset *SyncOffset) error
SaveSyncOffset mocks base method.
type MockSyncOffsetStorageMockRecorder ¶ added in v0.2.0
type MockSyncOffsetStorageMockRecorder struct {
// contains filtered or unexported fields
}
MockSyncOffsetStorageMockRecorder is the mock recorder for MockSyncOffsetStorage.
func (*MockSyncOffsetStorageMockRecorder) GetSyncOffset ¶ added in v0.2.0
func (mr *MockSyncOffsetStorageMockRecorder) GetSyncOffset() *gomock.Call
GetSyncOffset indicates an expected call of GetSyncOffset.
func (*MockSyncOffsetStorageMockRecorder) SaveSyncOffset ¶ added in v0.2.0
func (mr *MockSyncOffsetStorageMockRecorder) SaveSyncOffset(offset interface{}) *gomock.Call
SaveSyncOffset indicates an expected call of SaveSyncOffset.
type OperatorRemovedEventYAML ¶ added in v0.4.7
type OperatorRemovedEventYAML struct {
ID uint64 `yaml:"ID"`
}
type Options ¶ added in v0.0.6
type Options struct { ETH1Addr string `yaml:"ETH1Addr" env:"ETH_1_ADDR" env-required:"true" env-description:"ETH1 node WebSocket address"` ETH1ConnectionTimeout time.Duration `yaml:"ETH1ConnectionTimeout" env:"ETH_1_CONNECTION_TIMEOUT" env-default:"10s" env-description:"eth1 node connection timeout"` RegistryContractABI string AbiVersion Version }
Options configurations related to eth1
type SyncEndedEvent ¶
type SyncEndedEvent struct { // Success returns true if the sync went well (all events were parsed) Success bool // Block is the block number of the last block synced Block uint64 }
SyncEndedEvent meant to notify an observer that the sync is over
type SyncEventHandler ¶ added in v0.0.18
SyncEventHandler handles a given event
type SyncOffset ¶ added in v0.0.4
SyncOffset is the type of variable used for passing around the offset
func StringToSyncOffset ¶ added in v0.4.7
func StringToSyncOffset(syncOffset string) *SyncOffset
StringToSyncOffset converts string to SyncOffset
type SyncOffsetStorage ¶ added in v0.0.4
type SyncOffsetStorage interface { // SaveSyncOffset saves the offset (block number) SaveSyncOffset(offset *SyncOffset) error // GetSyncOffset returns the sync offset GetSyncOffset() (*SyncOffset, bool, error) }
SyncOffsetStorage represents the interface for compatible storage