Documentation ¶
Index ¶
- Variables
- func IsURLAvailable(address string) bool
- type EthClient
- type HeaderTraversal
- type Logs
- type MockEthClient
- func (m *MockEthClient) BlockHeaderByHash(hash common.Hash) (*types.Header, error)
- func (m *MockEthClient) BlockHeaderByNumber(number *big.Int) (*types.Header, error)
- func (m *MockEthClient) BlockHeadersByRange(from, to *big.Int, chainId uint) ([]types.Header, error)
- func (m *MockEthClient) Close()
- func (m *MockEthClient) FilterLogs(query ethereum.FilterQuery) (Logs, error)
- func (m *MockEthClient) LatestFinalizedBlockHeader() (*types.Header, error)
- func (m *MockEthClient) LatestSafeBlockHeader() (*types.Header, error)
- func (m *MockEthClient) StorageHash(address common.Address, blockNumber *big.Int) (common.Hash, error)
- func (m *MockEthClient) TxByHash(hash common.Hash) (*types.Transaction, error)
- type RPC
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHeaderTraversalAheadOfProvider = errors.New("the HeaderTraversal's internal state is ahead of the provider") ErrHeaderTraversalAndProviderMismatchedState = errors.New("the HeaderTraversal and provider have diverged in state") )
Functions ¶
func IsURLAvailable ¶
Types ¶
type EthClient ¶
type EthClient interface { BlockHeaderByNumber(*big.Int) (*types.Header, error) LatestSafeBlockHeader() (*types.Header, error) LatestFinalizedBlockHeader() (*types.Header, error) BlockHeaderByHash(common.Hash) (*types.Header, error) BlockHeadersByRange(*big.Int, *big.Int, uint) ([]types.Header, error) TxByHash(common.Hash) (*types.Transaction, error) StorageHash(common.Address, *big.Int) (common.Hash, error) FilterLogs(ethereum.FilterQuery) (Logs, error) // Close closes the underlying RPC connection. // RPC close does not return any errors, but does shut down e.g. a websocket connection. Close() }
type HeaderTraversal ¶
type HeaderTraversal struct {
// contains filtered or unexported fields
}
func NewHeaderTraversal ¶
func NewHeaderTraversal(ethClient EthClient, fromHeader *types.Header, confDepth *big.Int, chainId uint) *HeaderTraversal
NewHeaderTraversal instantiates a new instance of HeaderTraversal against the supplied rpc client. The HeaderTraversal will start fetching blocks starting from the supplied header unless nil, indicating genesis.
func (*HeaderTraversal) LastTraversedHeader ¶
func (f *HeaderTraversal) LastTraversedHeader() *types.Header
LastTraversedHeader returns the last header traversed.
- This is useful for testing the state of the HeaderTraversal
- LastTraversedHeader may be << LatestHeader depending on the number headers traversed via `NextHeaders`.
func (*HeaderTraversal) LatestHeader ¶
func (f *HeaderTraversal) LatestHeader() *types.Header
LatestHeader returns the latest header reported by underlying eth client as headers are traversed via `NextHeaders`.
func (*HeaderTraversal) NextHeaders ¶
func (f *HeaderTraversal) NextHeaders(maxSize uint64) ([]types.Header, error)
NextHeaders retrieves the next set of headers that have been marked as finalized by the connected client, bounded by the supplied size
type MockEthClient ¶
func (*MockEthClient) BlockHeaderByHash ¶
func (*MockEthClient) BlockHeaderByNumber ¶
func (*MockEthClient) BlockHeadersByRange ¶
func (*MockEthClient) Close ¶
func (m *MockEthClient) Close()
func (*MockEthClient) FilterLogs ¶
func (m *MockEthClient) FilterLogs(query ethereum.FilterQuery) (Logs, error)
func (*MockEthClient) LatestFinalizedBlockHeader ¶
func (m *MockEthClient) LatestFinalizedBlockHeader() (*types.Header, error)
func (*MockEthClient) LatestSafeBlockHeader ¶
func (m *MockEthClient) LatestSafeBlockHeader() (*types.Header, error)
func (*MockEthClient) StorageHash ¶
func (*MockEthClient) TxByHash ¶
func (m *MockEthClient) TxByHash(hash common.Hash) (*types.Transaction, error)
Click to show internal directories.
Click to hide internal directories.