Documentation
¶
Index ¶
- Constants
- Variables
- type Block
- type Downloader
- type DownloaderMock
- type DownloaderMock_Download_Call
- func (_c *DownloaderMock_Download_Call) Return() *DownloaderMock_Download_Call
- func (_c *DownloaderMock_Download_Call) Run(run func(ctx context.Context, fromBlock uint64, downloadedCh chan EVMBlock)) *DownloaderMock_Download_Call
- func (_c *DownloaderMock_Download_Call) RunAndReturn(run func(context.Context, uint64, chan EVMBlock)) *DownloaderMock_Download_Call
- type DownloaderMock_Expecter
- type DownloaderMock_RuntimeData_Call
- func (_c *DownloaderMock_RuntimeData_Call) Return(_a0 RuntimeData, _a1 error) *DownloaderMock_RuntimeData_Call
- func (_c *DownloaderMock_RuntimeData_Call) Run(run func(ctx context.Context)) *DownloaderMock_RuntimeData_Call
- func (_c *DownloaderMock_RuntimeData_Call) RunAndReturn(run func(context.Context) (RuntimeData, error)) *DownloaderMock_RuntimeData_Call
- type EVMBlock
- type EVMBlockHeader
- type EVMBlocks
- type EVMDownloader
- type EVMDownloaderImplementation
- func (d *EVMDownloaderImplementation) ChainID(ctx context.Context) (uint64, error)
- func (d *EVMDownloaderImplementation) GetBlockHeader(ctx context.Context, blockNum uint64) (EVMBlockHeader, bool)
- func (d *EVMDownloaderImplementation) GetEventsByBlockRange(ctx context.Context, fromBlock, toBlock uint64) EVMBlocks
- func (d *EVMDownloaderImplementation) GetLastFinalizedBlock(ctx context.Context) (uint64, error)
- func (d *EVMDownloaderImplementation) GetLogs(ctx context.Context, fromBlock, toBlock uint64) []types.Log
- func (d *EVMDownloaderImplementation) WaitForNewBlocks(ctx context.Context, latestSyncedBlock uint64) (newLatestBlock uint64)
- type EVMDownloaderInterface
- type EVMDownloaderMock
- func (_m *EVMDownloaderMock) ChainID(ctx context.Context) (uint64, error)
- func (_m *EVMDownloaderMock) EXPECT() *EVMDownloaderMock_Expecter
- func (_m *EVMDownloaderMock) GetBlockHeader(ctx context.Context, blockNum uint64) (EVMBlockHeader, bool)
- func (_m *EVMDownloaderMock) GetEventsByBlockRange(ctx context.Context, fromBlock uint64, toBlock uint64) EVMBlocks
- func (_m *EVMDownloaderMock) GetLastFinalizedBlock(ctx context.Context) (uint64, error)
- func (_m *EVMDownloaderMock) GetLogs(ctx context.Context, fromBlock uint64, toBlock uint64) []types.Log
- func (_m *EVMDownloaderMock) WaitForNewBlocks(ctx context.Context, lastBlockSeen uint64) uint64
- type EVMDownloaderMock_ChainID_Call
- func (_c *EVMDownloaderMock_ChainID_Call) Return(_a0 uint64, _a1 error) *EVMDownloaderMock_ChainID_Call
- func (_c *EVMDownloaderMock_ChainID_Call) Run(run func(ctx context.Context)) *EVMDownloaderMock_ChainID_Call
- func (_c *EVMDownloaderMock_ChainID_Call) RunAndReturn(run func(context.Context) (uint64, error)) *EVMDownloaderMock_ChainID_Call
- type EVMDownloaderMock_Expecter
- func (_e *EVMDownloaderMock_Expecter) ChainID(ctx interface{}) *EVMDownloaderMock_ChainID_Call
- func (_e *EVMDownloaderMock_Expecter) GetBlockHeader(ctx interface{}, blockNum interface{}) *EVMDownloaderMock_GetBlockHeader_Call
- func (_e *EVMDownloaderMock_Expecter) GetEventsByBlockRange(ctx interface{}, fromBlock interface{}, toBlock interface{}) *EVMDownloaderMock_GetEventsByBlockRange_Call
- func (_e *EVMDownloaderMock_Expecter) GetLastFinalizedBlock(ctx interface{}) *EVMDownloaderMock_GetLastFinalizedBlock_Call
- func (_e *EVMDownloaderMock_Expecter) GetLogs(ctx interface{}, fromBlock interface{}, toBlock interface{}) *EVMDownloaderMock_GetLogs_Call
- func (_e *EVMDownloaderMock_Expecter) WaitForNewBlocks(ctx interface{}, lastBlockSeen interface{}) *EVMDownloaderMock_WaitForNewBlocks_Call
- type EVMDownloaderMock_GetBlockHeader_Call
- func (_c *EVMDownloaderMock_GetBlockHeader_Call) Return(_a0 EVMBlockHeader, _a1 bool) *EVMDownloaderMock_GetBlockHeader_Call
- func (_c *EVMDownloaderMock_GetBlockHeader_Call) Run(run func(ctx context.Context, blockNum uint64)) *EVMDownloaderMock_GetBlockHeader_Call
- func (_c *EVMDownloaderMock_GetBlockHeader_Call) RunAndReturn(run func(context.Context, uint64) (EVMBlockHeader, bool)) *EVMDownloaderMock_GetBlockHeader_Call
- type EVMDownloaderMock_GetEventsByBlockRange_Call
- func (_c *EVMDownloaderMock_GetEventsByBlockRange_Call) Return(_a0 EVMBlocks) *EVMDownloaderMock_GetEventsByBlockRange_Call
- func (_c *EVMDownloaderMock_GetEventsByBlockRange_Call) Run(run func(ctx context.Context, fromBlock uint64, toBlock uint64)) *EVMDownloaderMock_GetEventsByBlockRange_Call
- func (_c *EVMDownloaderMock_GetEventsByBlockRange_Call) RunAndReturn(run func(context.Context, uint64, uint64) EVMBlocks) *EVMDownloaderMock_GetEventsByBlockRange_Call
- type EVMDownloaderMock_GetLastFinalizedBlock_Call
- func (_c *EVMDownloaderMock_GetLastFinalizedBlock_Call) Return(_a0 uint64, _a1 error) *EVMDownloaderMock_GetLastFinalizedBlock_Call
- func (_c *EVMDownloaderMock_GetLastFinalizedBlock_Call) Run(run func(ctx context.Context)) *EVMDownloaderMock_GetLastFinalizedBlock_Call
- func (_c *EVMDownloaderMock_GetLastFinalizedBlock_Call) RunAndReturn(run func(context.Context) (uint64, error)) *EVMDownloaderMock_GetLastFinalizedBlock_Call
- type EVMDownloaderMock_GetLogs_Call
- func (_c *EVMDownloaderMock_GetLogs_Call) Return(_a0 []types.Log) *EVMDownloaderMock_GetLogs_Call
- func (_c *EVMDownloaderMock_GetLogs_Call) Run(run func(ctx context.Context, fromBlock uint64, toBlock uint64)) *EVMDownloaderMock_GetLogs_Call
- func (_c *EVMDownloaderMock_GetLogs_Call) RunAndReturn(run func(context.Context, uint64, uint64) []types.Log) *EVMDownloaderMock_GetLogs_Call
- type EVMDownloaderMock_WaitForNewBlocks_Call
- func (_c *EVMDownloaderMock_WaitForNewBlocks_Call) Return(newLastBlock uint64) *EVMDownloaderMock_WaitForNewBlocks_Call
- func (_c *EVMDownloaderMock_WaitForNewBlocks_Call) Run(run func(ctx context.Context, lastBlockSeen uint64)) *EVMDownloaderMock_WaitForNewBlocks_Call
- func (_c *EVMDownloaderMock_WaitForNewBlocks_Call) RunAndReturn(run func(context.Context, uint64) uint64) *EVMDownloaderMock_WaitForNewBlocks_Call
- type EVMDriver
- type LogAppenderMap
- type ProcessorMock
- func (_m *ProcessorMock) EXPECT() *ProcessorMock_Expecter
- func (_m *ProcessorMock) GetLastProcessedBlock(ctx context.Context) (uint64, error)
- func (_m *ProcessorMock) ProcessBlock(ctx context.Context, block Block) error
- func (_m *ProcessorMock) Reorg(ctx context.Context, firstReorgedBlock uint64) error
- type ProcessorMock_Expecter
- func (_e *ProcessorMock_Expecter) GetLastProcessedBlock(ctx interface{}) *ProcessorMock_GetLastProcessedBlock_Call
- func (_e *ProcessorMock_Expecter) ProcessBlock(ctx interface{}, block interface{}) *ProcessorMock_ProcessBlock_Call
- func (_e *ProcessorMock_Expecter) Reorg(ctx interface{}, firstReorgedBlock interface{}) *ProcessorMock_Reorg_Call
- type ProcessorMock_GetLastProcessedBlock_Call
- func (_c *ProcessorMock_GetLastProcessedBlock_Call) Return(_a0 uint64, _a1 error) *ProcessorMock_GetLastProcessedBlock_Call
- func (_c *ProcessorMock_GetLastProcessedBlock_Call) Run(run func(ctx context.Context)) *ProcessorMock_GetLastProcessedBlock_Call
- func (_c *ProcessorMock_GetLastProcessedBlock_Call) RunAndReturn(run func(context.Context) (uint64, error)) *ProcessorMock_GetLastProcessedBlock_Call
- type ProcessorMock_ProcessBlock_Call
- func (_c *ProcessorMock_ProcessBlock_Call) Return(_a0 error) *ProcessorMock_ProcessBlock_Call
- func (_c *ProcessorMock_ProcessBlock_Call) Run(run func(ctx context.Context, block Block)) *ProcessorMock_ProcessBlock_Call
- func (_c *ProcessorMock_ProcessBlock_Call) RunAndReturn(run func(context.Context, Block) error) *ProcessorMock_ProcessBlock_Call
- type ProcessorMock_Reorg_Call
- func (_c *ProcessorMock_Reorg_Call) Return(_a0 error) *ProcessorMock_Reorg_Call
- func (_c *ProcessorMock_Reorg_Call) Run(run func(ctx context.Context, firstReorgedBlock uint64)) *ProcessorMock_Reorg_Call
- func (_c *ProcessorMock_Reorg_Call) RunAndReturn(run func(context.Context, uint64) error) *ProcessorMock_Reorg_Call
- type ReorgDetector
- type ReorgDetectorMock
- func (_m *ReorgDetectorMock) AddBlockToTrack(ctx context.Context, id string, blockNum uint64, blockHash common.Hash) error
- func (_m *ReorgDetectorMock) EXPECT() *ReorgDetectorMock_Expecter
- func (_m *ReorgDetectorMock) GetFinalizedBlockType() types.BlockNumberFinality
- func (_m *ReorgDetectorMock) GetTrackedBlockByBlockNumber(id string, blockNumber uint64) (*reorgdetector.Header, error)
- func (_m *ReorgDetectorMock) String() string
- func (_m *ReorgDetectorMock) Subscribe(id string) (*reorgdetector.Subscription, error)
- type ReorgDetectorMock_AddBlockToTrack_Call
- func (_c *ReorgDetectorMock_AddBlockToTrack_Call) Return(_a0 error) *ReorgDetectorMock_AddBlockToTrack_Call
- func (_c *ReorgDetectorMock_AddBlockToTrack_Call) Run(...) *ReorgDetectorMock_AddBlockToTrack_Call
- func (_c *ReorgDetectorMock_AddBlockToTrack_Call) RunAndReturn(run func(context.Context, string, uint64, common.Hash) error) *ReorgDetectorMock_AddBlockToTrack_Call
- type ReorgDetectorMock_Expecter
- func (_e *ReorgDetectorMock_Expecter) AddBlockToTrack(ctx interface{}, id interface{}, blockNum interface{}, blockHash interface{}) *ReorgDetectorMock_AddBlockToTrack_Call
- func (_e *ReorgDetectorMock_Expecter) GetFinalizedBlockType() *ReorgDetectorMock_GetFinalizedBlockType_Call
- func (_e *ReorgDetectorMock_Expecter) GetTrackedBlockByBlockNumber(id interface{}, blockNumber interface{}) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
- func (_e *ReorgDetectorMock_Expecter) String() *ReorgDetectorMock_String_Call
- func (_e *ReorgDetectorMock_Expecter) Subscribe(id interface{}) *ReorgDetectorMock_Subscribe_Call
- type ReorgDetectorMock_GetFinalizedBlockType_Call
- func (_c *ReorgDetectorMock_GetFinalizedBlockType_Call) Return(_a0 types.BlockNumberFinality) *ReorgDetectorMock_GetFinalizedBlockType_Call
- func (_c *ReorgDetectorMock_GetFinalizedBlockType_Call) Run(run func()) *ReorgDetectorMock_GetFinalizedBlockType_Call
- func (_c *ReorgDetectorMock_GetFinalizedBlockType_Call) RunAndReturn(run func() types.BlockNumberFinality) *ReorgDetectorMock_GetFinalizedBlockType_Call
- type ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
- func (_c *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) Return(_a0 *reorgdetector.Header, _a1 error) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
- func (_c *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) Run(run func(id string, blockNumber uint64)) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
- func (_c *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) RunAndReturn(run func(string, uint64) (*reorgdetector.Header, error)) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
- type ReorgDetectorMock_String_Call
- type ReorgDetectorMock_Subscribe_Call
- func (_c *ReorgDetectorMock_Subscribe_Call) Return(_a0 *reorgdetector.Subscription, _a1 error) *ReorgDetectorMock_Subscribe_Call
- func (_c *ReorgDetectorMock_Subscribe_Call) Run(run func(id string)) *ReorgDetectorMock_Subscribe_Call
- func (_c *ReorgDetectorMock_Subscribe_Call) RunAndReturn(run func(string) (*reorgdetector.Subscription, error)) *ReorgDetectorMock_Subscribe_Call
- type RetryHandler
- type RuntimeData
Constants ¶
const ( DefaultWaitPeriodBlockNotFound = time.Millisecond * 100 MaxRetryCountBlockHashMismatch = 5 // DefaultFilterLogsTimeout is the default timeout for filter logs operations to prevent hanging DefaultFilterLogsTimeout = 2 * time.Minute )
Variables ¶
var ErrInconsistentState = errors.New("state is inconsistent, try again later once the state is consolidated")
var LogFatalf = log.Fatalf
Functions ¶
This section is empty.
Types ¶
type Downloader ¶ added in v0.5.0
type DownloaderMock ¶ added in v0.3.0
DownloaderMock is an autogenerated mock type for the Downloader type
func NewDownloaderMock ¶ added in v0.3.0
func NewDownloaderMock(t interface {
mock.TestingT
Cleanup(func())
}) *DownloaderMock
NewDownloaderMock creates a new instance of DownloaderMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*DownloaderMock) Download ¶ added in v0.3.0
func (_m *DownloaderMock) Download(ctx context.Context, fromBlock uint64, downloadedCh chan EVMBlock)
Download provides a mock function with given fields: ctx, fromBlock, downloadedCh
func (*DownloaderMock) EXPECT ¶ added in v0.3.0
func (_m *DownloaderMock) EXPECT() *DownloaderMock_Expecter
func (*DownloaderMock) RuntimeData ¶ added in v0.3.0
func (_m *DownloaderMock) RuntimeData(ctx context.Context) (RuntimeData, error)
RuntimeData provides a mock function with given fields: ctx
type DownloaderMock_Download_Call ¶ added in v0.3.0
DownloaderMock_Download_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Download'
func (*DownloaderMock_Download_Call) Return ¶ added in v0.3.0
func (_c *DownloaderMock_Download_Call) Return() *DownloaderMock_Download_Call
func (*DownloaderMock_Download_Call) Run ¶ added in v0.3.0
func (_c *DownloaderMock_Download_Call) Run(run func(ctx context.Context, fromBlock uint64, downloadedCh chan EVMBlock)) *DownloaderMock_Download_Call
func (*DownloaderMock_Download_Call) RunAndReturn ¶ added in v0.3.0
func (_c *DownloaderMock_Download_Call) RunAndReturn(run func(context.Context, uint64, chan EVMBlock)) *DownloaderMock_Download_Call
type DownloaderMock_Expecter ¶ added in v0.3.0
type DownloaderMock_Expecter struct {
// contains filtered or unexported fields
}
func (*DownloaderMock_Expecter) Download ¶ added in v0.3.0
func (_e *DownloaderMock_Expecter) Download(ctx interface{}, fromBlock interface{}, downloadedCh interface{}) *DownloaderMock_Download_Call
Download is a helper method to define mock.On call
- ctx context.Context
- fromBlock uint64
- downloadedCh chan EVMBlock
func (*DownloaderMock_Expecter) RuntimeData ¶ added in v0.3.0
func (_e *DownloaderMock_Expecter) RuntimeData(ctx interface{}) *DownloaderMock_RuntimeData_Call
RuntimeData is a helper method to define mock.On call
- ctx context.Context
type DownloaderMock_RuntimeData_Call ¶ added in v0.3.0
DownloaderMock_RuntimeData_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RuntimeData'
func (*DownloaderMock_RuntimeData_Call) Return ¶ added in v0.3.0
func (_c *DownloaderMock_RuntimeData_Call) Return(_a0 RuntimeData, _a1 error) *DownloaderMock_RuntimeData_Call
func (*DownloaderMock_RuntimeData_Call) Run ¶ added in v0.3.0
func (_c *DownloaderMock_RuntimeData_Call) Run(run func(ctx context.Context)) *DownloaderMock_RuntimeData_Call
func (*DownloaderMock_RuntimeData_Call) RunAndReturn ¶ added in v0.3.0
func (_c *DownloaderMock_RuntimeData_Call) RunAndReturn(run func(context.Context) (RuntimeData, error)) *DownloaderMock_RuntimeData_Call
type EVMBlock ¶
type EVMBlock struct {
EVMBlockHeader
IsFinalizedBlock bool
Events []interface{}
}
type EVMBlockHeader ¶
type EVMDownloader ¶
type EVMDownloader struct {
EVMDownloaderInterface
// contains filtered or unexported fields
}
func NewEVMDownloader ¶
func NewEVMDownloader( syncerID string, ethClient aggkittypes.BaseEthereumClienter, syncBlockChunkSize uint64, finality aggkittypes.BlockNumberFinality, waitForNewBlocksPeriod time.Duration, appender LogAppenderMap, addressesToQuery []common.Address, rh *RetryHandler, finalizedBlockType aggkittypes.BlockNumberFinality, reorgDetector ReorgDetector, reorgDetectorID string, ) (*EVMDownloader, error)
func (*EVMDownloader) Download ¶
func (d *EVMDownloader) Download(ctx context.Context, fromBlock uint64, downloadedCh chan EVMBlock)
func (*EVMDownloader) RuntimeData ¶ added in v0.2.0
func (d *EVMDownloader) RuntimeData(ctx context.Context) (RuntimeData, error)
RuntimeData returns the runtime data: chainID + addresses to query
type EVMDownloaderImplementation ¶
type EVMDownloaderImplementation struct {
// contains filtered or unexported fields
}
func NewEVMDownloaderImplementation ¶
func NewEVMDownloaderImplementation( syncerID string, ethClient aggkittypes.BaseEthereumClienter, blockFinality aggkittypes.BlockNumberFinality, waitForNewBlocksPeriod time.Duration, appender LogAppenderMap, addressesToQuery []common.Address, rh *RetryHandler, finalizedBlockType *aggkittypes.BlockNumberFinality, reorgDetector ReorgDetector, reorgDetectorID string, ) *EVMDownloaderImplementation
NewEVMDownloaderImplementation creates a new EVMDownloaderImplementation finalizedBlockType can be nil, in this case, it means that the reorgs are not happening on the network
func (*EVMDownloaderImplementation) ChainID ¶ added in v0.2.0
func (d *EVMDownloaderImplementation) ChainID(ctx context.Context) (uint64, error)
func (*EVMDownloaderImplementation) GetBlockHeader ¶
func (d *EVMDownloaderImplementation) GetBlockHeader(ctx context.Context, blockNum uint64) (EVMBlockHeader, bool)
func (*EVMDownloaderImplementation) GetEventsByBlockRange ¶
func (d *EVMDownloaderImplementation) GetEventsByBlockRange(ctx context.Context, fromBlock, toBlock uint64) EVMBlocks
func (*EVMDownloaderImplementation) GetLastFinalizedBlock ¶ added in v0.0.2
func (d *EVMDownloaderImplementation) GetLastFinalizedBlock(ctx context.Context) (uint64, error)
func (*EVMDownloaderImplementation) WaitForNewBlocks ¶
func (d *EVMDownloaderImplementation) WaitForNewBlocks( ctx context.Context, latestSyncedBlock uint64) (newLatestBlock uint64)
type EVMDownloaderInterface ¶
type EVMDownloaderInterface interface {
WaitForNewBlocks(ctx context.Context, lastBlockSeen uint64) (newLastBlock uint64)
GetEventsByBlockRange(ctx context.Context, fromBlock, toBlock uint64) EVMBlocks
GetLogs(ctx context.Context, fromBlock, toBlock uint64) []types.Log
GetBlockHeader(ctx context.Context, blockNum uint64) (EVMBlockHeader, bool)
GetLastFinalizedBlock(ctx context.Context) (uint64, error)
ChainID(ctx context.Context) (uint64, error)
}
type EVMDownloaderMock ¶
EVMDownloaderMock is an autogenerated mock type for the EVMDownloaderInterface type
func NewEVMDownloaderMock ¶
func NewEVMDownloaderMock(t interface {
mock.TestingT
Cleanup(func())
}) *EVMDownloaderMock
NewEVMDownloaderMock creates a new instance of EVMDownloaderMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*EVMDownloaderMock) ChainID ¶ added in v0.2.0
func (_m *EVMDownloaderMock) ChainID(ctx context.Context) (uint64, error)
ChainID provides a mock function with given fields: ctx
func (*EVMDownloaderMock) EXPECT ¶
func (_m *EVMDownloaderMock) EXPECT() *EVMDownloaderMock_Expecter
func (*EVMDownloaderMock) GetBlockHeader ¶
func (_m *EVMDownloaderMock) GetBlockHeader(ctx context.Context, blockNum uint64) (EVMBlockHeader, bool)
GetBlockHeader provides a mock function with given fields: ctx, blockNum
func (*EVMDownloaderMock) GetEventsByBlockRange ¶
func (_m *EVMDownloaderMock) GetEventsByBlockRange(ctx context.Context, fromBlock uint64, toBlock uint64) EVMBlocks
GetEventsByBlockRange provides a mock function with given fields: ctx, fromBlock, toBlock
func (*EVMDownloaderMock) GetLastFinalizedBlock ¶ added in v0.0.2
func (_m *EVMDownloaderMock) GetLastFinalizedBlock(ctx context.Context) (uint64, error)
GetLastFinalizedBlock provides a mock function with given fields: ctx
func (*EVMDownloaderMock) GetLogs ¶
func (_m *EVMDownloaderMock) GetLogs(ctx context.Context, fromBlock uint64, toBlock uint64) []types.Log
GetLogs provides a mock function with given fields: ctx, fromBlock, toBlock
func (*EVMDownloaderMock) WaitForNewBlocks ¶
func (_m *EVMDownloaderMock) WaitForNewBlocks(ctx context.Context, lastBlockSeen uint64) uint64
WaitForNewBlocks provides a mock function with given fields: ctx, lastBlockSeen
type EVMDownloaderMock_ChainID_Call ¶ added in v0.3.0
EVMDownloaderMock_ChainID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChainID'
func (*EVMDownloaderMock_ChainID_Call) Return ¶ added in v0.3.0
func (_c *EVMDownloaderMock_ChainID_Call) Return(_a0 uint64, _a1 error) *EVMDownloaderMock_ChainID_Call
func (*EVMDownloaderMock_ChainID_Call) Run ¶ added in v0.3.0
func (_c *EVMDownloaderMock_ChainID_Call) Run(run func(ctx context.Context)) *EVMDownloaderMock_ChainID_Call
func (*EVMDownloaderMock_ChainID_Call) RunAndReturn ¶ added in v0.3.0
func (_c *EVMDownloaderMock_ChainID_Call) RunAndReturn(run func(context.Context) (uint64, error)) *EVMDownloaderMock_ChainID_Call
type EVMDownloaderMock_Expecter ¶
type EVMDownloaderMock_Expecter struct {
// contains filtered or unexported fields
}
func (*EVMDownloaderMock_Expecter) ChainID ¶ added in v0.3.0
func (_e *EVMDownloaderMock_Expecter) ChainID(ctx interface{}) *EVMDownloaderMock_ChainID_Call
ChainID is a helper method to define mock.On call
- ctx context.Context
func (*EVMDownloaderMock_Expecter) GetBlockHeader ¶
func (_e *EVMDownloaderMock_Expecter) GetBlockHeader(ctx interface{}, blockNum interface{}) *EVMDownloaderMock_GetBlockHeader_Call
GetBlockHeader is a helper method to define mock.On call
- ctx context.Context
- blockNum uint64
func (*EVMDownloaderMock_Expecter) GetEventsByBlockRange ¶
func (_e *EVMDownloaderMock_Expecter) GetEventsByBlockRange(ctx interface{}, fromBlock interface{}, toBlock interface{}) *EVMDownloaderMock_GetEventsByBlockRange_Call
GetEventsByBlockRange is a helper method to define mock.On call
- ctx context.Context
- fromBlock uint64
- toBlock uint64
func (*EVMDownloaderMock_Expecter) GetLastFinalizedBlock ¶ added in v0.0.2
func (_e *EVMDownloaderMock_Expecter) GetLastFinalizedBlock(ctx interface{}) *EVMDownloaderMock_GetLastFinalizedBlock_Call
GetLastFinalizedBlock is a helper method to define mock.On call
- ctx context.Context
func (*EVMDownloaderMock_Expecter) GetLogs ¶
func (_e *EVMDownloaderMock_Expecter) GetLogs(ctx interface{}, fromBlock interface{}, toBlock interface{}) *EVMDownloaderMock_GetLogs_Call
GetLogs is a helper method to define mock.On call
- ctx context.Context
- fromBlock uint64
- toBlock uint64
func (*EVMDownloaderMock_Expecter) WaitForNewBlocks ¶
func (_e *EVMDownloaderMock_Expecter) WaitForNewBlocks(ctx interface{}, lastBlockSeen interface{}) *EVMDownloaderMock_WaitForNewBlocks_Call
WaitForNewBlocks is a helper method to define mock.On call
- ctx context.Context
- lastBlockSeen uint64
type EVMDownloaderMock_GetBlockHeader_Call ¶
EVMDownloaderMock_GetBlockHeader_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlockHeader'
func (*EVMDownloaderMock_GetBlockHeader_Call) Return ¶
func (_c *EVMDownloaderMock_GetBlockHeader_Call) Return(_a0 EVMBlockHeader, _a1 bool) *EVMDownloaderMock_GetBlockHeader_Call
func (*EVMDownloaderMock_GetBlockHeader_Call) Run ¶
func (_c *EVMDownloaderMock_GetBlockHeader_Call) Run(run func(ctx context.Context, blockNum uint64)) *EVMDownloaderMock_GetBlockHeader_Call
func (*EVMDownloaderMock_GetBlockHeader_Call) RunAndReturn ¶
func (_c *EVMDownloaderMock_GetBlockHeader_Call) RunAndReturn(run func(context.Context, uint64) (EVMBlockHeader, bool)) *EVMDownloaderMock_GetBlockHeader_Call
type EVMDownloaderMock_GetEventsByBlockRange_Call ¶
EVMDownloaderMock_GetEventsByBlockRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEventsByBlockRange'
func (*EVMDownloaderMock_GetEventsByBlockRange_Call) Return ¶
func (_c *EVMDownloaderMock_GetEventsByBlockRange_Call) Return(_a0 EVMBlocks) *EVMDownloaderMock_GetEventsByBlockRange_Call
func (*EVMDownloaderMock_GetEventsByBlockRange_Call) Run ¶
func (_c *EVMDownloaderMock_GetEventsByBlockRange_Call) Run(run func(ctx context.Context, fromBlock uint64, toBlock uint64)) *EVMDownloaderMock_GetEventsByBlockRange_Call
func (*EVMDownloaderMock_GetEventsByBlockRange_Call) RunAndReturn ¶
func (_c *EVMDownloaderMock_GetEventsByBlockRange_Call) RunAndReturn(run func(context.Context, uint64, uint64) EVMBlocks) *EVMDownloaderMock_GetEventsByBlockRange_Call
type EVMDownloaderMock_GetLastFinalizedBlock_Call ¶ added in v0.0.2
EVMDownloaderMock_GetLastFinalizedBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLastFinalizedBlock'
func (*EVMDownloaderMock_GetLastFinalizedBlock_Call) Return ¶ added in v0.0.2
func (_c *EVMDownloaderMock_GetLastFinalizedBlock_Call) Return(_a0 uint64, _a1 error) *EVMDownloaderMock_GetLastFinalizedBlock_Call
func (*EVMDownloaderMock_GetLastFinalizedBlock_Call) Run ¶ added in v0.0.2
func (_c *EVMDownloaderMock_GetLastFinalizedBlock_Call) Run(run func(ctx context.Context)) *EVMDownloaderMock_GetLastFinalizedBlock_Call
func (*EVMDownloaderMock_GetLastFinalizedBlock_Call) RunAndReturn ¶ added in v0.0.2
func (_c *EVMDownloaderMock_GetLastFinalizedBlock_Call) RunAndReturn(run func(context.Context) (uint64, error)) *EVMDownloaderMock_GetLastFinalizedBlock_Call
type EVMDownloaderMock_GetLogs_Call ¶
EVMDownloaderMock_GetLogs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLogs'
func (*EVMDownloaderMock_GetLogs_Call) Return ¶
func (_c *EVMDownloaderMock_GetLogs_Call) Return(_a0 []types.Log) *EVMDownloaderMock_GetLogs_Call
func (*EVMDownloaderMock_GetLogs_Call) Run ¶
func (_c *EVMDownloaderMock_GetLogs_Call) Run(run func(ctx context.Context, fromBlock uint64, toBlock uint64)) *EVMDownloaderMock_GetLogs_Call
func (*EVMDownloaderMock_GetLogs_Call) RunAndReturn ¶
func (_c *EVMDownloaderMock_GetLogs_Call) RunAndReturn(run func(context.Context, uint64, uint64) []types.Log) *EVMDownloaderMock_GetLogs_Call
type EVMDownloaderMock_WaitForNewBlocks_Call ¶
EVMDownloaderMock_WaitForNewBlocks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WaitForNewBlocks'
func (*EVMDownloaderMock_WaitForNewBlocks_Call) Return ¶
func (_c *EVMDownloaderMock_WaitForNewBlocks_Call) Return(newLastBlock uint64) *EVMDownloaderMock_WaitForNewBlocks_Call
func (*EVMDownloaderMock_WaitForNewBlocks_Call) Run ¶
func (_c *EVMDownloaderMock_WaitForNewBlocks_Call) Run(run func(ctx context.Context, lastBlockSeen uint64)) *EVMDownloaderMock_WaitForNewBlocks_Call
func (*EVMDownloaderMock_WaitForNewBlocks_Call) RunAndReturn ¶
func (_c *EVMDownloaderMock_WaitForNewBlocks_Call) RunAndReturn(run func(context.Context, uint64) uint64) *EVMDownloaderMock_WaitForNewBlocks_Call
type EVMDriver ¶
type EVMDriver struct {
// contains filtered or unexported fields
}
func NewEVMDriver ¶
func NewEVMDriver( reorgDetector ReorgDetector, processor processorInterface, downloader Downloader, reorgDetectorID string, downloadBufferSize int, rh *RetryHandler, compatibilityChecker compatibility.CompatibilityChecker, ) (*EVMDriver, error)
type LogAppenderMap ¶
func (LogAppenderMap) GetTopics ¶ added in v0.5.0
func (m LogAppenderMap) GetTopics() []common.Hash
GetTopics returns the EVM event topics that are being queried
type ProcessorMock ¶
ProcessorMock is an autogenerated mock type for the processorInterface type
func NewProcessorMock ¶
func NewProcessorMock(t interface {
mock.TestingT
Cleanup(func())
}) *ProcessorMock
NewProcessorMock creates a new instance of ProcessorMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*ProcessorMock) EXPECT ¶
func (_m *ProcessorMock) EXPECT() *ProcessorMock_Expecter
func (*ProcessorMock) GetLastProcessedBlock ¶
func (_m *ProcessorMock) GetLastProcessedBlock(ctx context.Context) (uint64, error)
GetLastProcessedBlock provides a mock function with given fields: ctx
func (*ProcessorMock) ProcessBlock ¶
func (_m *ProcessorMock) ProcessBlock(ctx context.Context, block Block) error
ProcessBlock provides a mock function with given fields: ctx, block
type ProcessorMock_Expecter ¶
type ProcessorMock_Expecter struct {
// contains filtered or unexported fields
}
func (*ProcessorMock_Expecter) GetLastProcessedBlock ¶
func (_e *ProcessorMock_Expecter) GetLastProcessedBlock(ctx interface{}) *ProcessorMock_GetLastProcessedBlock_Call
GetLastProcessedBlock is a helper method to define mock.On call
- ctx context.Context
func (*ProcessorMock_Expecter) ProcessBlock ¶
func (_e *ProcessorMock_Expecter) ProcessBlock(ctx interface{}, block interface{}) *ProcessorMock_ProcessBlock_Call
ProcessBlock is a helper method to define mock.On call
- ctx context.Context
- block Block
func (*ProcessorMock_Expecter) Reorg ¶
func (_e *ProcessorMock_Expecter) Reorg(ctx interface{}, firstReorgedBlock interface{}) *ProcessorMock_Reorg_Call
Reorg is a helper method to define mock.On call
- ctx context.Context
- firstReorgedBlock uint64
type ProcessorMock_GetLastProcessedBlock_Call ¶
ProcessorMock_GetLastProcessedBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLastProcessedBlock'
func (*ProcessorMock_GetLastProcessedBlock_Call) Return ¶
func (_c *ProcessorMock_GetLastProcessedBlock_Call) Return(_a0 uint64, _a1 error) *ProcessorMock_GetLastProcessedBlock_Call
func (*ProcessorMock_GetLastProcessedBlock_Call) Run ¶
func (_c *ProcessorMock_GetLastProcessedBlock_Call) Run(run func(ctx context.Context)) *ProcessorMock_GetLastProcessedBlock_Call
func (*ProcessorMock_GetLastProcessedBlock_Call) RunAndReturn ¶
func (_c *ProcessorMock_GetLastProcessedBlock_Call) RunAndReturn(run func(context.Context) (uint64, error)) *ProcessorMock_GetLastProcessedBlock_Call
type ProcessorMock_ProcessBlock_Call ¶
ProcessorMock_ProcessBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProcessBlock'
func (*ProcessorMock_ProcessBlock_Call) Return ¶
func (_c *ProcessorMock_ProcessBlock_Call) Return(_a0 error) *ProcessorMock_ProcessBlock_Call
func (*ProcessorMock_ProcessBlock_Call) Run ¶
func (_c *ProcessorMock_ProcessBlock_Call) Run(run func(ctx context.Context, block Block)) *ProcessorMock_ProcessBlock_Call
func (*ProcessorMock_ProcessBlock_Call) RunAndReturn ¶
func (_c *ProcessorMock_ProcessBlock_Call) RunAndReturn(run func(context.Context, Block) error) *ProcessorMock_ProcessBlock_Call
type ProcessorMock_Reorg_Call ¶
ProcessorMock_Reorg_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Reorg'
func (*ProcessorMock_Reorg_Call) Return ¶
func (_c *ProcessorMock_Reorg_Call) Return(_a0 error) *ProcessorMock_Reorg_Call
func (*ProcessorMock_Reorg_Call) Run ¶
func (_c *ProcessorMock_Reorg_Call) Run(run func(ctx context.Context, firstReorgedBlock uint64)) *ProcessorMock_Reorg_Call
func (*ProcessorMock_Reorg_Call) RunAndReturn ¶
func (_c *ProcessorMock_Reorg_Call) RunAndReturn(run func(context.Context, uint64) error) *ProcessorMock_Reorg_Call
type ReorgDetector ¶
type ReorgDetector interface {
Subscribe(id string) (*reorgdetector.Subscription, error)
AddBlockToTrack(ctx context.Context, id string, blockNum uint64, blockHash common.Hash) error
GetFinalizedBlockType() aggkittypes.BlockNumberFinality
GetTrackedBlockByBlockNumber(id string, blockNumber uint64) (*reorgdetector.Header, error)
String() string
}
type ReorgDetectorMock ¶
ReorgDetectorMock is an autogenerated mock type for the ReorgDetector type
func NewReorgDetectorMock ¶
func NewReorgDetectorMock(t interface {
mock.TestingT
Cleanup(func())
}) *ReorgDetectorMock
NewReorgDetectorMock creates a new instance of ReorgDetectorMock. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*ReorgDetectorMock) AddBlockToTrack ¶
func (_m *ReorgDetectorMock) AddBlockToTrack(ctx context.Context, id string, blockNum uint64, blockHash common.Hash) error
AddBlockToTrack provides a mock function with given fields: ctx, id, blockNum, blockHash
func (*ReorgDetectorMock) EXPECT ¶
func (_m *ReorgDetectorMock) EXPECT() *ReorgDetectorMock_Expecter
func (*ReorgDetectorMock) GetFinalizedBlockType ¶ added in v0.0.2
func (_m *ReorgDetectorMock) GetFinalizedBlockType() types.BlockNumberFinality
GetFinalizedBlockType provides a mock function with no fields
func (*ReorgDetectorMock) GetTrackedBlockByBlockNumber ¶ added in v0.7.1
func (_m *ReorgDetectorMock) GetTrackedBlockByBlockNumber(id string, blockNumber uint64) (*reorgdetector.Header, error)
GetTrackedBlockByBlockNumber provides a mock function with given fields: id, blockNumber
func (*ReorgDetectorMock) String ¶ added in v0.0.2
func (_m *ReorgDetectorMock) String() string
String provides a mock function with no fields
func (*ReorgDetectorMock) Subscribe ¶
func (_m *ReorgDetectorMock) Subscribe(id string) (*reorgdetector.Subscription, error)
Subscribe provides a mock function with given fields: id
type ReorgDetectorMock_AddBlockToTrack_Call ¶
ReorgDetectorMock_AddBlockToTrack_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddBlockToTrack'
func (*ReorgDetectorMock_AddBlockToTrack_Call) Return ¶
func (_c *ReorgDetectorMock_AddBlockToTrack_Call) Return(_a0 error) *ReorgDetectorMock_AddBlockToTrack_Call
func (*ReorgDetectorMock_AddBlockToTrack_Call) Run ¶
func (_c *ReorgDetectorMock_AddBlockToTrack_Call) Run(run func(ctx context.Context, id string, blockNum uint64, blockHash common.Hash)) *ReorgDetectorMock_AddBlockToTrack_Call
func (*ReorgDetectorMock_AddBlockToTrack_Call) RunAndReturn ¶
func (_c *ReorgDetectorMock_AddBlockToTrack_Call) RunAndReturn(run func(context.Context, string, uint64, common.Hash) error) *ReorgDetectorMock_AddBlockToTrack_Call
type ReorgDetectorMock_Expecter ¶
type ReorgDetectorMock_Expecter struct {
// contains filtered or unexported fields
}
func (*ReorgDetectorMock_Expecter) AddBlockToTrack ¶
func (_e *ReorgDetectorMock_Expecter) AddBlockToTrack(ctx interface{}, id interface{}, blockNum interface{}, blockHash interface{}) *ReorgDetectorMock_AddBlockToTrack_Call
AddBlockToTrack is a helper method to define mock.On call
- ctx context.Context
- id string
- blockNum uint64
- blockHash common.Hash
func (*ReorgDetectorMock_Expecter) GetFinalizedBlockType ¶ added in v0.0.2
func (_e *ReorgDetectorMock_Expecter) GetFinalizedBlockType() *ReorgDetectorMock_GetFinalizedBlockType_Call
GetFinalizedBlockType is a helper method to define mock.On call
func (*ReorgDetectorMock_Expecter) GetTrackedBlockByBlockNumber ¶ added in v0.7.1
func (_e *ReorgDetectorMock_Expecter) GetTrackedBlockByBlockNumber(id interface{}, blockNumber interface{}) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
GetTrackedBlockByBlockNumber is a helper method to define mock.On call
- id string
- blockNumber uint64
func (*ReorgDetectorMock_Expecter) String ¶ added in v0.0.2
func (_e *ReorgDetectorMock_Expecter) String() *ReorgDetectorMock_String_Call
String is a helper method to define mock.On call
func (*ReorgDetectorMock_Expecter) Subscribe ¶
func (_e *ReorgDetectorMock_Expecter) Subscribe(id interface{}) *ReorgDetectorMock_Subscribe_Call
Subscribe is a helper method to define mock.On call
- id string
type ReorgDetectorMock_GetFinalizedBlockType_Call ¶ added in v0.0.2
ReorgDetectorMock_GetFinalizedBlockType_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFinalizedBlockType'
func (*ReorgDetectorMock_GetFinalizedBlockType_Call) Run ¶ added in v0.0.2
func (_c *ReorgDetectorMock_GetFinalizedBlockType_Call) Run(run func()) *ReorgDetectorMock_GetFinalizedBlockType_Call
func (*ReorgDetectorMock_GetFinalizedBlockType_Call) RunAndReturn ¶ added in v0.0.2
func (_c *ReorgDetectorMock_GetFinalizedBlockType_Call) RunAndReturn(run func() types.BlockNumberFinality) *ReorgDetectorMock_GetFinalizedBlockType_Call
type ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call ¶ added in v0.7.1
ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTrackedBlockByBlockNumber'
func (*ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) Return ¶ added in v0.7.1
func (_c *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) Return(_a0 *reorgdetector.Header, _a1 error) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
func (*ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) Run ¶ added in v0.7.1
func (_c *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) Run(run func(id string, blockNumber uint64)) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
func (*ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) RunAndReturn ¶ added in v0.7.1
func (_c *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call) RunAndReturn(run func(string, uint64) (*reorgdetector.Header, error)) *ReorgDetectorMock_GetTrackedBlockByBlockNumber_Call
type ReorgDetectorMock_String_Call ¶ added in v0.0.2
ReorgDetectorMock_String_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'String'
func (*ReorgDetectorMock_String_Call) Return ¶ added in v0.0.2
func (_c *ReorgDetectorMock_String_Call) Return(_a0 string) *ReorgDetectorMock_String_Call
func (*ReorgDetectorMock_String_Call) Run ¶ added in v0.0.2
func (_c *ReorgDetectorMock_String_Call) Run(run func()) *ReorgDetectorMock_String_Call
func (*ReorgDetectorMock_String_Call) RunAndReturn ¶ added in v0.0.2
func (_c *ReorgDetectorMock_String_Call) RunAndReturn(run func() string) *ReorgDetectorMock_String_Call
type ReorgDetectorMock_Subscribe_Call ¶
ReorgDetectorMock_Subscribe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Subscribe'
func (*ReorgDetectorMock_Subscribe_Call) Return ¶
func (_c *ReorgDetectorMock_Subscribe_Call) Return(_a0 *reorgdetector.Subscription, _a1 error) *ReorgDetectorMock_Subscribe_Call
func (*ReorgDetectorMock_Subscribe_Call) Run ¶
func (_c *ReorgDetectorMock_Subscribe_Call) Run(run func(id string)) *ReorgDetectorMock_Subscribe_Call
func (*ReorgDetectorMock_Subscribe_Call) RunAndReturn ¶
func (_c *ReorgDetectorMock_Subscribe_Call) RunAndReturn(run func(string) (*reorgdetector.Subscription, error)) *ReorgDetectorMock_Subscribe_Call
type RetryHandler ¶
func (*RetryHandler) Handle ¶
func (h *RetryHandler) Handle(ctx context.Context, funcName string, attempts int)
Handle is a method that handles retries If reach max retry attempts, it will log.Fatalf Otherwise, it will sleep for RetryAfterErrorPeriod For be able to test it, the Fatalf function can be override with var LogFatalf and change it for a panic that be catched by the test
type RuntimeData ¶ added in v0.2.0
RuntimeData is the data that is used to check that the DB is compatible with the runtime data basically it contains the relevant data from runtime environment
func (RuntimeData) IsCompatible ¶ added in v0.2.0
func (r RuntimeData) IsCompatible(other RuntimeData) error
func (RuntimeData) String ¶ added in v0.2.0
func (r RuntimeData) String() string