mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
1a6b83b82c
1. Adds an eth/stagedsync/test package which provides a test Harness object 2. Adds the first automated test to the bor-heimdall stage regarding span persistence (more to come in subsequent PRs) 3. Fixes a bug in the bor-heimdall stage which was uncovered with the test - we do not fetch span 0 when we sync straight from blockNum=0 without snapshots 4. Reorganises all mocks to be placed under ./mock sub-package within their respective packages
151 lines
5.2 KiB
Go
151 lines
5.2 KiB
Go
// Code generated by MockGen. DO NOT EDIT.
|
|
// Source: github.com/ledgerwatch/erigon/consensus (interfaces: ChainHeaderReader)
|
|
|
|
// Package mock is a generated GoMock package.
|
|
package mock
|
|
|
|
import (
|
|
big "math/big"
|
|
reflect "reflect"
|
|
|
|
gomock "github.com/golang/mock/gomock"
|
|
chain "github.com/ledgerwatch/erigon-lib/chain"
|
|
common "github.com/ledgerwatch/erigon-lib/common"
|
|
types "github.com/ledgerwatch/erigon/core/types"
|
|
)
|
|
|
|
// MockChainHeaderReader is a mock of ChainHeaderReader interface.
|
|
type MockChainHeaderReader struct {
|
|
ctrl *gomock.Controller
|
|
recorder *MockChainHeaderReaderMockRecorder
|
|
}
|
|
|
|
// MockChainHeaderReaderMockRecorder is the mock recorder for MockChainHeaderReader.
|
|
type MockChainHeaderReaderMockRecorder struct {
|
|
mock *MockChainHeaderReader
|
|
}
|
|
|
|
// NewMockChainHeaderReader creates a new mock instance.
|
|
func NewMockChainHeaderReader(ctrl *gomock.Controller) *MockChainHeaderReader {
|
|
mock := &MockChainHeaderReader{ctrl: ctrl}
|
|
mock.recorder = &MockChainHeaderReaderMockRecorder{mock}
|
|
return mock
|
|
}
|
|
|
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
|
func (m *MockChainHeaderReader) EXPECT() *MockChainHeaderReaderMockRecorder {
|
|
return m.recorder
|
|
}
|
|
|
|
// BorSpan mocks base method.
|
|
func (m *MockChainHeaderReader) BorSpan(arg0 uint64) []byte {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "BorSpan", arg0)
|
|
ret0, _ := ret[0].([]byte)
|
|
return ret0
|
|
}
|
|
|
|
// BorSpan indicates an expected call of BorSpan.
|
|
func (mr *MockChainHeaderReaderMockRecorder) BorSpan(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BorSpan", reflect.TypeOf((*MockChainHeaderReader)(nil).BorSpan), arg0)
|
|
}
|
|
|
|
// Config mocks base method.
|
|
func (m *MockChainHeaderReader) Config() *chain.Config {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "Config")
|
|
ret0, _ := ret[0].(*chain.Config)
|
|
return ret0
|
|
}
|
|
|
|
// Config indicates an expected call of Config.
|
|
func (mr *MockChainHeaderReaderMockRecorder) Config() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Config", reflect.TypeOf((*MockChainHeaderReader)(nil).Config))
|
|
}
|
|
|
|
// CurrentHeader mocks base method.
|
|
func (m *MockChainHeaderReader) CurrentHeader() *types.Header {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "CurrentHeader")
|
|
ret0, _ := ret[0].(*types.Header)
|
|
return ret0
|
|
}
|
|
|
|
// CurrentHeader indicates an expected call of CurrentHeader.
|
|
func (mr *MockChainHeaderReaderMockRecorder) CurrentHeader() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentHeader", reflect.TypeOf((*MockChainHeaderReader)(nil).CurrentHeader))
|
|
}
|
|
|
|
// FrozenBlocks mocks base method.
|
|
func (m *MockChainHeaderReader) FrozenBlocks() uint64 {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "FrozenBlocks")
|
|
ret0, _ := ret[0].(uint64)
|
|
return ret0
|
|
}
|
|
|
|
// FrozenBlocks indicates an expected call of FrozenBlocks.
|
|
func (mr *MockChainHeaderReaderMockRecorder) FrozenBlocks() *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FrozenBlocks", reflect.TypeOf((*MockChainHeaderReader)(nil).FrozenBlocks))
|
|
}
|
|
|
|
// GetHeader mocks base method.
|
|
func (m *MockChainHeaderReader) GetHeader(arg0 common.Hash, arg1 uint64) *types.Header {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetHeader", arg0, arg1)
|
|
ret0, _ := ret[0].(*types.Header)
|
|
return ret0
|
|
}
|
|
|
|
// GetHeader indicates an expected call of GetHeader.
|
|
func (mr *MockChainHeaderReaderMockRecorder) GetHeader(arg0, arg1 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeader), arg0, arg1)
|
|
}
|
|
|
|
// GetHeaderByHash mocks base method.
|
|
func (m *MockChainHeaderReader) GetHeaderByHash(arg0 common.Hash) *types.Header {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetHeaderByHash", arg0)
|
|
ret0, _ := ret[0].(*types.Header)
|
|
return ret0
|
|
}
|
|
|
|
// GetHeaderByHash indicates an expected call of GetHeaderByHash.
|
|
func (mr *MockChainHeaderReaderMockRecorder) GetHeaderByHash(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByHash", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeaderByHash), arg0)
|
|
}
|
|
|
|
// GetHeaderByNumber mocks base method.
|
|
func (m *MockChainHeaderReader) GetHeaderByNumber(arg0 uint64) *types.Header {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetHeaderByNumber", arg0)
|
|
ret0, _ := ret[0].(*types.Header)
|
|
return ret0
|
|
}
|
|
|
|
// GetHeaderByNumber indicates an expected call of GetHeaderByNumber.
|
|
func (mr *MockChainHeaderReaderMockRecorder) GetHeaderByNumber(arg0 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByNumber", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeaderByNumber), arg0)
|
|
}
|
|
|
|
// GetTd mocks base method.
|
|
func (m *MockChainHeaderReader) GetTd(arg0 common.Hash, arg1 uint64) *big.Int {
|
|
m.ctrl.T.Helper()
|
|
ret := m.ctrl.Call(m, "GetTd", arg0, arg1)
|
|
ret0, _ := ret[0].(*big.Int)
|
|
return ret0
|
|
}
|
|
|
|
// GetTd indicates an expected call of GetTd.
|
|
func (mr *MockChainHeaderReaderMockRecorder) GetTd(arg0, arg1 interface{}) *gomock.Call {
|
|
mr.mock.ctrl.T.Helper()
|
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTd", reflect.TypeOf((*MockChainHeaderReader)(nil).GetTd), arg0, arg1)
|
|
}
|