diff --git a/cl/aggregation/mock_services/aggregation_pool_mock.go b/cl/aggregation/mock_services/aggregation_pool_mock.go index 246829e932b..56dce309153 100644 --- a/cl/aggregation/mock_services/aggregation_pool_mock.go +++ b/cl/aggregation/mock_services/aggregation_pool_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/aggregation_pool_mock.go -package=mock_services . AggregationPool +// mockgen -typed=true -destination=./mock_services/aggregation_pool_mock.go -package=mock_services . AggregationPool // // Package mock_services is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockAggregationPool) AddAttestation(arg0 *solid.Attestation) error { } // AddAttestation indicates an expected call of AddAttestation. -func (mr *MockAggregationPoolMockRecorder) AddAttestation(arg0 any) *gomock.Call { +func (mr *MockAggregationPoolMockRecorder) AddAttestation(arg0 any) *MockAggregationPoolAddAttestationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAttestation", reflect.TypeOf((*MockAggregationPool)(nil).AddAttestation), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAttestation", reflect.TypeOf((*MockAggregationPool)(nil).AddAttestation), arg0) + return &MockAggregationPoolAddAttestationCall{Call: call} +} + +// MockAggregationPoolAddAttestationCall wrap *gomock.Call +type MockAggregationPoolAddAttestationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAggregationPoolAddAttestationCall) Return(arg0 error) *MockAggregationPoolAddAttestationCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAggregationPoolAddAttestationCall) Do(f func(*solid.Attestation) error) *MockAggregationPoolAddAttestationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAggregationPoolAddAttestationCall) DoAndReturn(f func(*solid.Attestation) error) *MockAggregationPoolAddAttestationCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetAggregatationByRoot mocks base method. @@ -63,7 +87,31 @@ func (m *MockAggregationPool) GetAggregatationByRoot(arg0 common.Hash) *solid.At } // GetAggregatationByRoot indicates an expected call of GetAggregatationByRoot. -func (mr *MockAggregationPoolMockRecorder) GetAggregatationByRoot(arg0 any) *gomock.Call { +func (mr *MockAggregationPoolMockRecorder) GetAggregatationByRoot(arg0 any) *MockAggregationPoolGetAggregatationByRootCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatationByRoot", reflect.TypeOf((*MockAggregationPool)(nil).GetAggregatationByRoot), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatationByRoot", reflect.TypeOf((*MockAggregationPool)(nil).GetAggregatationByRoot), arg0) + return &MockAggregationPoolGetAggregatationByRootCall{Call: call} +} + +// MockAggregationPoolGetAggregatationByRootCall wrap *gomock.Call +type MockAggregationPoolGetAggregatationByRootCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAggregationPoolGetAggregatationByRootCall) Return(arg0 *solid.Attestation) *MockAggregationPoolGetAggregatationByRootCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAggregationPoolGetAggregatationByRootCall) Do(f func(common.Hash) *solid.Attestation) *MockAggregationPoolGetAggregatationByRootCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAggregationPoolGetAggregatationByRootCall) DoAndReturn(f func(common.Hash) *solid.Attestation) *MockAggregationPoolGetAggregatationByRootCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/aggregation/pool.go b/cl/aggregation/pool.go index 562bd8643c9..9efbd5c042a 100644 --- a/cl/aggregation/pool.go +++ b/cl/aggregation/pool.go @@ -5,7 +5,7 @@ import ( "github.com/ledgerwatch/erigon/cl/cltypes/solid" ) -//go:generate mockgen -destination=./mock_services/aggregation_pool_mock.go -package=mock_services . AggregationPool +//go:generate mockgen -typed=true -destination=./mock_services/aggregation_pool_mock.go -package=mock_services . AggregationPool type AggregationPool interface { // AddAttestation adds a single attestation to the pool. AddAttestation(att *solid.Attestation) error diff --git a/cl/beacon/synced_data/interface.go b/cl/beacon/synced_data/interface.go index ee35df33aad..e7566b8eea8 100644 --- a/cl/beacon/synced_data/interface.go +++ b/cl/beacon/synced_data/interface.go @@ -2,7 +2,7 @@ package synced_data import "github.com/ledgerwatch/erigon/cl/phase1/core/state" -//go:generate mockgen -destination=./mock_services/synced_data_mock.go -package=mock_services . SyncedData +//go:generate mockgen -typed=true -destination=./mock_services/synced_data_mock.go -package=mock_services . SyncedData type SyncedData interface { OnHeadState(newState *state.CachingBeaconState) (err error) HeadState() *state.CachingBeaconState diff --git a/cl/beacon/synced_data/mock_services/synced_data_mock.go b/cl/beacon/synced_data/mock_services/synced_data_mock.go index 33f8e1b7cc7..a5111b2e485 100644 --- a/cl/beacon/synced_data/mock_services/synced_data_mock.go +++ b/cl/beacon/synced_data/mock_services/synced_data_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/synced_data_mock.go -package=mock_services . SyncedData +// mockgen -typed=true -destination=./mock_services/synced_data_mock.go -package=mock_services . SyncedData // // Package mock_services is a generated GoMock package. @@ -48,9 +48,33 @@ func (m *MockSyncedData) HeadSlot() uint64 { } // HeadSlot indicates an expected call of HeadSlot. -func (mr *MockSyncedDataMockRecorder) HeadSlot() *gomock.Call { +func (mr *MockSyncedDataMockRecorder) HeadSlot() *MockSyncedDataHeadSlotCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadSlot", reflect.TypeOf((*MockSyncedData)(nil).HeadSlot)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadSlot", reflect.TypeOf((*MockSyncedData)(nil).HeadSlot)) + return &MockSyncedDataHeadSlotCall{Call: call} +} + +// MockSyncedDataHeadSlotCall wrap *gomock.Call +type MockSyncedDataHeadSlotCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncedDataHeadSlotCall) Return(arg0 uint64) *MockSyncedDataHeadSlotCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncedDataHeadSlotCall) Do(f func() uint64) *MockSyncedDataHeadSlotCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncedDataHeadSlotCall) DoAndReturn(f func() uint64) *MockSyncedDataHeadSlotCall { + c.Call = c.Call.DoAndReturn(f) + return c } // HeadState mocks base method. @@ -62,9 +86,33 @@ func (m *MockSyncedData) HeadState() *state.CachingBeaconState { } // HeadState indicates an expected call of HeadState. -func (mr *MockSyncedDataMockRecorder) HeadState() *gomock.Call { +func (mr *MockSyncedDataMockRecorder) HeadState() *MockSyncedDataHeadStateCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadState", reflect.TypeOf((*MockSyncedData)(nil).HeadState)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadState", reflect.TypeOf((*MockSyncedData)(nil).HeadState)) + return &MockSyncedDataHeadStateCall{Call: call} +} + +// MockSyncedDataHeadStateCall wrap *gomock.Call +type MockSyncedDataHeadStateCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncedDataHeadStateCall) Return(arg0 *state.CachingBeaconState) *MockSyncedDataHeadStateCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncedDataHeadStateCall) Do(f func() *state.CachingBeaconState) *MockSyncedDataHeadStateCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncedDataHeadStateCall) DoAndReturn(f func() *state.CachingBeaconState) *MockSyncedDataHeadStateCall { + c.Call = c.Call.DoAndReturn(f) + return c } // HeadStateReader mocks base method. @@ -76,9 +124,33 @@ func (m *MockSyncedData) HeadStateReader() state.BeaconStateReader { } // HeadStateReader indicates an expected call of HeadStateReader. -func (mr *MockSyncedDataMockRecorder) HeadStateReader() *gomock.Call { +func (mr *MockSyncedDataMockRecorder) HeadStateReader() *MockSyncedDataHeadStateReaderCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadStateReader", reflect.TypeOf((*MockSyncedData)(nil).HeadStateReader)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadStateReader", reflect.TypeOf((*MockSyncedData)(nil).HeadStateReader)) + return &MockSyncedDataHeadStateReaderCall{Call: call} +} + +// MockSyncedDataHeadStateReaderCall wrap *gomock.Call +type MockSyncedDataHeadStateReaderCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncedDataHeadStateReaderCall) Return(arg0 state.BeaconStateReader) *MockSyncedDataHeadStateReaderCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncedDataHeadStateReaderCall) Do(f func() state.BeaconStateReader) *MockSyncedDataHeadStateReaderCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncedDataHeadStateReaderCall) DoAndReturn(f func() state.BeaconStateReader) *MockSyncedDataHeadStateReaderCall { + c.Call = c.Call.DoAndReturn(f) + return c } // OnHeadState mocks base method. @@ -90,9 +162,33 @@ func (m *MockSyncedData) OnHeadState(arg0 *state.CachingBeaconState) error { } // OnHeadState indicates an expected call of OnHeadState. -func (mr *MockSyncedDataMockRecorder) OnHeadState(arg0 any) *gomock.Call { +func (mr *MockSyncedDataMockRecorder) OnHeadState(arg0 any) *MockSyncedDataOnHeadStateCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnHeadState", reflect.TypeOf((*MockSyncedData)(nil).OnHeadState), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnHeadState", reflect.TypeOf((*MockSyncedData)(nil).OnHeadState), arg0) + return &MockSyncedDataOnHeadStateCall{Call: call} +} + +// MockSyncedDataOnHeadStateCall wrap *gomock.Call +type MockSyncedDataOnHeadStateCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncedDataOnHeadStateCall) Return(arg0 error) *MockSyncedDataOnHeadStateCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncedDataOnHeadStateCall) Do(f func(*state.CachingBeaconState) error) *MockSyncedDataOnHeadStateCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncedDataOnHeadStateCall) DoAndReturn(f func(*state.CachingBeaconState) error) *MockSyncedDataOnHeadStateCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Syncing mocks base method. @@ -104,7 +200,31 @@ func (m *MockSyncedData) Syncing() bool { } // Syncing indicates an expected call of Syncing. -func (mr *MockSyncedDataMockRecorder) Syncing() *gomock.Call { +func (mr *MockSyncedDataMockRecorder) Syncing() *MockSyncedDataSyncingCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Syncing", reflect.TypeOf((*MockSyncedData)(nil).Syncing)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Syncing", reflect.TypeOf((*MockSyncedData)(nil).Syncing)) + return &MockSyncedDataSyncingCall{Call: call} +} + +// MockSyncedDataSyncingCall wrap *gomock.Call +type MockSyncedDataSyncingCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncedDataSyncingCall) Return(arg0 bool) *MockSyncedDataSyncingCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncedDataSyncingCall) Do(f func() bool) *MockSyncedDataSyncingCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncedDataSyncingCall) DoAndReturn(f func() bool) *MockSyncedDataSyncingCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/core/state/interface.go b/cl/phase1/core/state/interface.go index cd78e726357..eb1e14a3973 100644 --- a/cl/phase1/core/state/interface.go +++ b/cl/phase1/core/state/interface.go @@ -4,7 +4,7 @@ import libcommon "github.com/ledgerwatch/erigon-lib/common" // BeaconStateReader is an interface for reading the beacon state. // -//go:generate mockgen -destination=./mock_services/beacon_state_reader_mock.go -package=mock_services . BeaconStateReader +//go:generate mockgen -typed=true -destination=./mock_services/beacon_state_reader_mock.go -package=mock_services . BeaconStateReader type BeaconStateReader interface { ValidatorPublicKey(index int) (libcommon.Bytes48, error) GetDomain(domainType [4]byte, epoch uint64) ([]byte, error) diff --git a/cl/phase1/core/state/mock_services/beacon_state_reader_mock.go b/cl/phase1/core/state/mock_services/beacon_state_reader_mock.go index 5dd9b7062f7..94875a81103 100644 --- a/cl/phase1/core/state/mock_services/beacon_state_reader_mock.go +++ b/cl/phase1/core/state/mock_services/beacon_state_reader_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/beacon_state_reader_mock.go -package=mock_services . BeaconStateReader +// mockgen -typed=true -destination=./mock_services/beacon_state_reader_mock.go -package=mock_services . BeaconStateReader // // Package mock_services is a generated GoMock package. @@ -48,9 +48,33 @@ func (m *MockBeaconStateReader) CommitteeCount(arg0 uint64) uint64 { } // CommitteeCount indicates an expected call of CommitteeCount. -func (mr *MockBeaconStateReaderMockRecorder) CommitteeCount(arg0 any) *gomock.Call { +func (mr *MockBeaconStateReaderMockRecorder) CommitteeCount(arg0 any) *MockBeaconStateReaderCommitteeCountCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitteeCount", reflect.TypeOf((*MockBeaconStateReader)(nil).CommitteeCount), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitteeCount", reflect.TypeOf((*MockBeaconStateReader)(nil).CommitteeCount), arg0) + return &MockBeaconStateReaderCommitteeCountCall{Call: call} +} + +// MockBeaconStateReaderCommitteeCountCall wrap *gomock.Call +type MockBeaconStateReaderCommitteeCountCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBeaconStateReaderCommitteeCountCall) Return(arg0 uint64) *MockBeaconStateReaderCommitteeCountCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBeaconStateReaderCommitteeCountCall) Do(f func(uint64) uint64) *MockBeaconStateReaderCommitteeCountCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBeaconStateReaderCommitteeCountCall) DoAndReturn(f func(uint64) uint64) *MockBeaconStateReaderCommitteeCountCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetDomain mocks base method. @@ -63,9 +87,33 @@ func (m *MockBeaconStateReader) GetDomain(arg0 [4]byte, arg1 uint64) ([]byte, er } // GetDomain indicates an expected call of GetDomain. -func (mr *MockBeaconStateReaderMockRecorder) GetDomain(arg0, arg1 any) *gomock.Call { +func (mr *MockBeaconStateReaderMockRecorder) GetDomain(arg0, arg1 any) *MockBeaconStateReaderGetDomainCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDomain", reflect.TypeOf((*MockBeaconStateReader)(nil).GetDomain), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDomain", reflect.TypeOf((*MockBeaconStateReader)(nil).GetDomain), arg0, arg1) + return &MockBeaconStateReaderGetDomainCall{Call: call} +} + +// MockBeaconStateReaderGetDomainCall wrap *gomock.Call +type MockBeaconStateReaderGetDomainCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBeaconStateReaderGetDomainCall) Return(arg0 []byte, arg1 error) *MockBeaconStateReaderGetDomainCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBeaconStateReaderGetDomainCall) Do(f func([4]byte, uint64) ([]byte, error)) *MockBeaconStateReaderGetDomainCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBeaconStateReaderGetDomainCall) DoAndReturn(f func([4]byte, uint64) ([]byte, error)) *MockBeaconStateReaderGetDomainCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ValidatorPublicKey mocks base method. @@ -78,7 +126,31 @@ func (m *MockBeaconStateReader) ValidatorPublicKey(arg0 int) (common.Bytes48, er } // ValidatorPublicKey indicates an expected call of ValidatorPublicKey. -func (mr *MockBeaconStateReaderMockRecorder) ValidatorPublicKey(arg0 any) *gomock.Call { +func (mr *MockBeaconStateReaderMockRecorder) ValidatorPublicKey(arg0 any) *MockBeaconStateReaderValidatorPublicKeyCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPublicKey", reflect.TypeOf((*MockBeaconStateReader)(nil).ValidatorPublicKey), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPublicKey", reflect.TypeOf((*MockBeaconStateReader)(nil).ValidatorPublicKey), arg0) + return &MockBeaconStateReaderValidatorPublicKeyCall{Call: call} +} + +// MockBeaconStateReaderValidatorPublicKeyCall wrap *gomock.Call +type MockBeaconStateReaderValidatorPublicKeyCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBeaconStateReaderValidatorPublicKeyCall) Return(arg0 common.Bytes48, arg1 error) *MockBeaconStateReaderValidatorPublicKeyCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBeaconStateReaderValidatorPublicKeyCall) Do(f func(int) (common.Bytes48, error)) *MockBeaconStateReaderValidatorPublicKeyCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBeaconStateReaderValidatorPublicKeyCall) DoAndReturn(f func(int) (common.Bytes48, error)) *MockBeaconStateReaderValidatorPublicKeyCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/execution_client/execution_engine_mock.go b/cl/phase1/execution_client/execution_engine_mock.go index 78f2bd57f38..cb4171aab9e 100644 --- a/cl/phase1/execution_client/execution_engine_mock.go +++ b/cl/phase1/execution_client/execution_engine_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -source=./interface.go -destination=./execution_engine_mock.go -package=execution_client . ExecutionEngine +// mockgen -typed=true -source=./interface.go -destination=./execution_engine_mock.go -package=execution_client . ExecutionEngine // // Package execution_client is a generated GoMock package. @@ -54,9 +54,33 @@ func (m *MockExecutionEngine) CurrentHeader(ctx context.Context) (*types.Header, } // CurrentHeader indicates an expected call of CurrentHeader. -func (mr *MockExecutionEngineMockRecorder) CurrentHeader(ctx any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) CurrentHeader(ctx any) *MockExecutionEngineCurrentHeaderCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentHeader", reflect.TypeOf((*MockExecutionEngine)(nil).CurrentHeader), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentHeader", reflect.TypeOf((*MockExecutionEngine)(nil).CurrentHeader), ctx) + return &MockExecutionEngineCurrentHeaderCall{Call: call} +} + +// MockExecutionEngineCurrentHeaderCall wrap *gomock.Call +type MockExecutionEngineCurrentHeaderCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineCurrentHeaderCall) Return(arg0 *types.Header, arg1 error) *MockExecutionEngineCurrentHeaderCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineCurrentHeaderCall) Do(f func(context.Context) (*types.Header, error)) *MockExecutionEngineCurrentHeaderCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineCurrentHeaderCall) DoAndReturn(f func(context.Context) (*types.Header, error)) *MockExecutionEngineCurrentHeaderCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ForkChoiceUpdate mocks base method. @@ -69,9 +93,33 @@ func (m *MockExecutionEngine) ForkChoiceUpdate(ctx context.Context, finalized, h } // ForkChoiceUpdate indicates an expected call of ForkChoiceUpdate. -func (mr *MockExecutionEngineMockRecorder) ForkChoiceUpdate(ctx, finalized, head, attributes any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) ForkChoiceUpdate(ctx, finalized, head, attributes any) *MockExecutionEngineForkChoiceUpdateCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ForkChoiceUpdate", reflect.TypeOf((*MockExecutionEngine)(nil).ForkChoiceUpdate), ctx, finalized, head, attributes) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ForkChoiceUpdate", reflect.TypeOf((*MockExecutionEngine)(nil).ForkChoiceUpdate), ctx, finalized, head, attributes) + return &MockExecutionEngineForkChoiceUpdateCall{Call: call} +} + +// MockExecutionEngineForkChoiceUpdateCall wrap *gomock.Call +type MockExecutionEngineForkChoiceUpdateCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineForkChoiceUpdateCall) Return(arg0 []byte, arg1 error) *MockExecutionEngineForkChoiceUpdateCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineForkChoiceUpdateCall) Do(f func(context.Context, common.Hash, common.Hash, *engine_types.PayloadAttributes) ([]byte, error)) *MockExecutionEngineForkChoiceUpdateCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineForkChoiceUpdateCall) DoAndReturn(f func(context.Context, common.Hash, common.Hash, *engine_types.PayloadAttributes) ([]byte, error)) *MockExecutionEngineForkChoiceUpdateCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FrozenBlocks mocks base method. @@ -83,9 +131,33 @@ func (m *MockExecutionEngine) FrozenBlocks(ctx context.Context) uint64 { } // FrozenBlocks indicates an expected call of FrozenBlocks. -func (mr *MockExecutionEngineMockRecorder) FrozenBlocks(ctx any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) FrozenBlocks(ctx any) *MockExecutionEngineFrozenBlocksCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FrozenBlocks", reflect.TypeOf((*MockExecutionEngine)(nil).FrozenBlocks), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FrozenBlocks", reflect.TypeOf((*MockExecutionEngine)(nil).FrozenBlocks), ctx) + return &MockExecutionEngineFrozenBlocksCall{Call: call} +} + +// MockExecutionEngineFrozenBlocksCall wrap *gomock.Call +type MockExecutionEngineFrozenBlocksCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineFrozenBlocksCall) Return(arg0 uint64) *MockExecutionEngineFrozenBlocksCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineFrozenBlocksCall) Do(f func(context.Context) uint64) *MockExecutionEngineFrozenBlocksCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineFrozenBlocksCall) DoAndReturn(f func(context.Context) uint64) *MockExecutionEngineFrozenBlocksCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetAssembledBlock mocks base method. @@ -100,9 +172,33 @@ func (m *MockExecutionEngine) GetAssembledBlock(ctx context.Context, id []byte) } // GetAssembledBlock indicates an expected call of GetAssembledBlock. -func (mr *MockExecutionEngineMockRecorder) GetAssembledBlock(ctx, id any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) GetAssembledBlock(ctx, id any) *MockExecutionEngineGetAssembledBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAssembledBlock", reflect.TypeOf((*MockExecutionEngine)(nil).GetAssembledBlock), ctx, id) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAssembledBlock", reflect.TypeOf((*MockExecutionEngine)(nil).GetAssembledBlock), ctx, id) + return &MockExecutionEngineGetAssembledBlockCall{Call: call} +} + +// MockExecutionEngineGetAssembledBlockCall wrap *gomock.Call +type MockExecutionEngineGetAssembledBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineGetAssembledBlockCall) Return(arg0 *cltypes.Eth1Block, arg1 *engine_types.BlobsBundleV1, arg2 *big.Int, arg3 error) *MockExecutionEngineGetAssembledBlockCall { + c.Call = c.Call.Return(arg0, arg1, arg2, arg3) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineGetAssembledBlockCall) Do(f func(context.Context, []byte) (*cltypes.Eth1Block, *engine_types.BlobsBundleV1, *big.Int, error)) *MockExecutionEngineGetAssembledBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineGetAssembledBlockCall) DoAndReturn(f func(context.Context, []byte) (*cltypes.Eth1Block, *engine_types.BlobsBundleV1, *big.Int, error)) *MockExecutionEngineGetAssembledBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetBodiesByHashes mocks base method. @@ -115,9 +211,33 @@ func (m *MockExecutionEngine) GetBodiesByHashes(ctx context.Context, hashes []co } // GetBodiesByHashes indicates an expected call of GetBodiesByHashes. -func (mr *MockExecutionEngineMockRecorder) GetBodiesByHashes(ctx, hashes any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) GetBodiesByHashes(ctx, hashes any) *MockExecutionEngineGetBodiesByHashesCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBodiesByHashes", reflect.TypeOf((*MockExecutionEngine)(nil).GetBodiesByHashes), ctx, hashes) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBodiesByHashes", reflect.TypeOf((*MockExecutionEngine)(nil).GetBodiesByHashes), ctx, hashes) + return &MockExecutionEngineGetBodiesByHashesCall{Call: call} +} + +// MockExecutionEngineGetBodiesByHashesCall wrap *gomock.Call +type MockExecutionEngineGetBodiesByHashesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineGetBodiesByHashesCall) Return(arg0 []*types.RawBody, arg1 error) *MockExecutionEngineGetBodiesByHashesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineGetBodiesByHashesCall) Do(f func(context.Context, []common.Hash) ([]*types.RawBody, error)) *MockExecutionEngineGetBodiesByHashesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineGetBodiesByHashesCall) DoAndReturn(f func(context.Context, []common.Hash) ([]*types.RawBody, error)) *MockExecutionEngineGetBodiesByHashesCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetBodiesByRange mocks base method. @@ -130,9 +250,33 @@ func (m *MockExecutionEngine) GetBodiesByRange(ctx context.Context, start, count } // GetBodiesByRange indicates an expected call of GetBodiesByRange. -func (mr *MockExecutionEngineMockRecorder) GetBodiesByRange(ctx, start, count any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) GetBodiesByRange(ctx, start, count any) *MockExecutionEngineGetBodiesByRangeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBodiesByRange", reflect.TypeOf((*MockExecutionEngine)(nil).GetBodiesByRange), ctx, start, count) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBodiesByRange", reflect.TypeOf((*MockExecutionEngine)(nil).GetBodiesByRange), ctx, start, count) + return &MockExecutionEngineGetBodiesByRangeCall{Call: call} +} + +// MockExecutionEngineGetBodiesByRangeCall wrap *gomock.Call +type MockExecutionEngineGetBodiesByRangeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineGetBodiesByRangeCall) Return(arg0 []*types.RawBody, arg1 error) *MockExecutionEngineGetBodiesByRangeCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineGetBodiesByRangeCall) Do(f func(context.Context, uint64, uint64) ([]*types.RawBody, error)) *MockExecutionEngineGetBodiesByRangeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineGetBodiesByRangeCall) DoAndReturn(f func(context.Context, uint64, uint64) ([]*types.RawBody, error)) *MockExecutionEngineGetBodiesByRangeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // HasBlock mocks base method. @@ -145,9 +289,33 @@ func (m *MockExecutionEngine) HasBlock(ctx context.Context, hash common.Hash) (b } // HasBlock indicates an expected call of HasBlock. -func (mr *MockExecutionEngineMockRecorder) HasBlock(ctx, hash any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) HasBlock(ctx, hash any) *MockExecutionEngineHasBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasBlock", reflect.TypeOf((*MockExecutionEngine)(nil).HasBlock), ctx, hash) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HasBlock", reflect.TypeOf((*MockExecutionEngine)(nil).HasBlock), ctx, hash) + return &MockExecutionEngineHasBlockCall{Call: call} +} + +// MockExecutionEngineHasBlockCall wrap *gomock.Call +type MockExecutionEngineHasBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineHasBlockCall) Return(arg0 bool, arg1 error) *MockExecutionEngineHasBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineHasBlockCall) Do(f func(context.Context, common.Hash) (bool, error)) *MockExecutionEngineHasBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineHasBlockCall) DoAndReturn(f func(context.Context, common.Hash) (bool, error)) *MockExecutionEngineHasBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // InsertBlock mocks base method. @@ -159,9 +327,33 @@ func (m *MockExecutionEngine) InsertBlock(ctx context.Context, block *types.Bloc } // InsertBlock indicates an expected call of InsertBlock. -func (mr *MockExecutionEngineMockRecorder) InsertBlock(ctx, block any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) InsertBlock(ctx, block any) *MockExecutionEngineInsertBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlock", reflect.TypeOf((*MockExecutionEngine)(nil).InsertBlock), ctx, block) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlock", reflect.TypeOf((*MockExecutionEngine)(nil).InsertBlock), ctx, block) + return &MockExecutionEngineInsertBlockCall{Call: call} +} + +// MockExecutionEngineInsertBlockCall wrap *gomock.Call +type MockExecutionEngineInsertBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineInsertBlockCall) Return(arg0 error) *MockExecutionEngineInsertBlockCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineInsertBlockCall) Do(f func(context.Context, *types.Block) error) *MockExecutionEngineInsertBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineInsertBlockCall) DoAndReturn(f func(context.Context, *types.Block) error) *MockExecutionEngineInsertBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // InsertBlocks mocks base method. @@ -173,9 +365,33 @@ func (m *MockExecutionEngine) InsertBlocks(ctx context.Context, blocks []*types. } // InsertBlocks indicates an expected call of InsertBlocks. -func (mr *MockExecutionEngineMockRecorder) InsertBlocks(ctx, blocks, wait any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) InsertBlocks(ctx, blocks, wait any) *MockExecutionEngineInsertBlocksCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlocks", reflect.TypeOf((*MockExecutionEngine)(nil).InsertBlocks), ctx, blocks, wait) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlocks", reflect.TypeOf((*MockExecutionEngine)(nil).InsertBlocks), ctx, blocks, wait) + return &MockExecutionEngineInsertBlocksCall{Call: call} +} + +// MockExecutionEngineInsertBlocksCall wrap *gomock.Call +type MockExecutionEngineInsertBlocksCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineInsertBlocksCall) Return(arg0 error) *MockExecutionEngineInsertBlocksCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineInsertBlocksCall) Do(f func(context.Context, []*types.Block, bool) error) *MockExecutionEngineInsertBlocksCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineInsertBlocksCall) DoAndReturn(f func(context.Context, []*types.Block, bool) error) *MockExecutionEngineInsertBlocksCall { + c.Call = c.Call.DoAndReturn(f) + return c } // IsCanonicalHash mocks base method. @@ -188,9 +404,33 @@ func (m *MockExecutionEngine) IsCanonicalHash(ctx context.Context, hash common.H } // IsCanonicalHash indicates an expected call of IsCanonicalHash. -func (mr *MockExecutionEngineMockRecorder) IsCanonicalHash(ctx, hash any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) IsCanonicalHash(ctx, hash any) *MockExecutionEngineIsCanonicalHashCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsCanonicalHash", reflect.TypeOf((*MockExecutionEngine)(nil).IsCanonicalHash), ctx, hash) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsCanonicalHash", reflect.TypeOf((*MockExecutionEngine)(nil).IsCanonicalHash), ctx, hash) + return &MockExecutionEngineIsCanonicalHashCall{Call: call} +} + +// MockExecutionEngineIsCanonicalHashCall wrap *gomock.Call +type MockExecutionEngineIsCanonicalHashCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineIsCanonicalHashCall) Return(arg0 bool, arg1 error) *MockExecutionEngineIsCanonicalHashCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineIsCanonicalHashCall) Do(f func(context.Context, common.Hash) (bool, error)) *MockExecutionEngineIsCanonicalHashCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineIsCanonicalHashCall) DoAndReturn(f func(context.Context, common.Hash) (bool, error)) *MockExecutionEngineIsCanonicalHashCall { + c.Call = c.Call.DoAndReturn(f) + return c } // NewPayload mocks base method. @@ -203,9 +443,33 @@ func (m *MockExecutionEngine) NewPayload(ctx context.Context, payload *cltypes.E } // NewPayload indicates an expected call of NewPayload. -func (mr *MockExecutionEngineMockRecorder) NewPayload(ctx, payload, beaconParentRoot, versionedHashes any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) NewPayload(ctx, payload, beaconParentRoot, versionedHashes any) *MockExecutionEngineNewPayloadCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewPayload", reflect.TypeOf((*MockExecutionEngine)(nil).NewPayload), ctx, payload, beaconParentRoot, versionedHashes) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewPayload", reflect.TypeOf((*MockExecutionEngine)(nil).NewPayload), ctx, payload, beaconParentRoot, versionedHashes) + return &MockExecutionEngineNewPayloadCall{Call: call} +} + +// MockExecutionEngineNewPayloadCall wrap *gomock.Call +type MockExecutionEngineNewPayloadCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineNewPayloadCall) Return(arg0 bool, arg1 error) *MockExecutionEngineNewPayloadCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineNewPayloadCall) Do(f func(context.Context, *cltypes.Eth1Block, *common.Hash, []common.Hash) (bool, error)) *MockExecutionEngineNewPayloadCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineNewPayloadCall) DoAndReturn(f func(context.Context, *cltypes.Eth1Block, *common.Hash, []common.Hash) (bool, error)) *MockExecutionEngineNewPayloadCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Ready mocks base method. @@ -218,9 +482,33 @@ func (m *MockExecutionEngine) Ready(ctx context.Context) (bool, error) { } // Ready indicates an expected call of Ready. -func (mr *MockExecutionEngineMockRecorder) Ready(ctx any) *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) Ready(ctx any) *MockExecutionEngineReadyCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ready", reflect.TypeOf((*MockExecutionEngine)(nil).Ready), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ready", reflect.TypeOf((*MockExecutionEngine)(nil).Ready), ctx) + return &MockExecutionEngineReadyCall{Call: call} +} + +// MockExecutionEngineReadyCall wrap *gomock.Call +type MockExecutionEngineReadyCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineReadyCall) Return(arg0 bool, arg1 error) *MockExecutionEngineReadyCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineReadyCall) Do(f func(context.Context) (bool, error)) *MockExecutionEngineReadyCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineReadyCall) DoAndReturn(f func(context.Context) (bool, error)) *MockExecutionEngineReadyCall { + c.Call = c.Call.DoAndReturn(f) + return c } // SupportInsertion mocks base method. @@ -232,7 +520,31 @@ func (m *MockExecutionEngine) SupportInsertion() bool { } // SupportInsertion indicates an expected call of SupportInsertion. -func (mr *MockExecutionEngineMockRecorder) SupportInsertion() *gomock.Call { +func (mr *MockExecutionEngineMockRecorder) SupportInsertion() *MockExecutionEngineSupportInsertionCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SupportInsertion", reflect.TypeOf((*MockExecutionEngine)(nil).SupportInsertion)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SupportInsertion", reflect.TypeOf((*MockExecutionEngine)(nil).SupportInsertion)) + return &MockExecutionEngineSupportInsertionCall{Call: call} +} + +// MockExecutionEngineSupportInsertionCall wrap *gomock.Call +type MockExecutionEngineSupportInsertionCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockExecutionEngineSupportInsertionCall) Return(arg0 bool) *MockExecutionEngineSupportInsertionCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockExecutionEngineSupportInsertionCall) Do(f func() bool) *MockExecutionEngineSupportInsertionCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockExecutionEngineSupportInsertionCall) DoAndReturn(f func() bool) *MockExecutionEngineSupportInsertionCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/execution_client/interface.go b/cl/phase1/execution_client/interface.go index e7b2afa14c6..61a87c8be67 100644 --- a/cl/phase1/execution_client/interface.go +++ b/cl/phase1/execution_client/interface.go @@ -16,7 +16,7 @@ var errContextExceeded = "rpc error: code = DeadlineExceeded desc = context dead // ExecutionEngine is used only for syncing up very close to chain tip and to stay in sync. // It pretty much mimics engine API. -//go:generate mockgen -source=./interface.go -destination=./execution_engine_mock.go -package=execution_client . ExecutionEngine +//go:generate mockgen -typed=true -source=./interface.go -destination=./execution_engine_mock.go -package=execution_client . ExecutionEngine type ExecutionEngine interface { NewPayload(ctx context.Context, payload *cltypes.Eth1Block, beaconParentRoot *libcommon.Hash, versionedHashes []libcommon.Hash) (bool, error) ForkChoiceUpdate(ctx context.Context, finalized libcommon.Hash, head libcommon.Hash, attributes *engine_types.PayloadAttributes) ([]byte, error) diff --git a/cl/phase1/forkchoice/mock_services/forkchoice_mock.go b/cl/phase1/forkchoice/mock_services/forkchoice_mock.go index 1c117ca02ee..ea15759a373 100644 --- a/cl/phase1/forkchoice/mock_services/forkchoice_mock.go +++ b/cl/phase1/forkchoice/mock_services/forkchoice_mock.go @@ -61,38 +61,45 @@ func makeSyncContributionPoolMock(t *testing.T) sync_contribution_pool.SyncContr } u := map[syncContributionKey]*cltypes.Contribution{} pool := syncpoolmock.NewMockSyncContributionPool(ctrl) - pool.EXPECT().AddSyncContribution(gomock.Any(), gomock.Any()).DoAndReturn(func(headState *state.CachingBeaconState, contribution *cltypes.Contribution) error { - key := syncContributionKey{ - slot: contribution.Slot, - subcommitteeIndex: contribution.SubcommitteeIndex, - beaconBlockRoot: contribution.BeaconBlockRoot, - } - u[key] = contribution - return nil - }).AnyTimes() - pool.EXPECT().GetSyncContribution(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(slot uint64, subcommitteeIndex uint64, beaconBlockRoot common.Hash) (*cltypes.Contribution, bool) { - key := syncContributionKey{ - slot: slot, - subcommitteeIndex: subcommitteeIndex, - beaconBlockRoot: beaconBlockRoot, - } - v, ok := u[key] - return v, ok - }).AnyTimes() - pool.EXPECT().AddSyncCommitteeMessage(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(headState *state.CachingBeaconState, subCommitee uint64, message *cltypes.SyncCommitteeMessage) error { - key := syncContributionKey{ - slot: message.Slot, - subcommitteeIndex: subCommitee, - beaconBlockRoot: message.BeaconBlockRoot, - } - u[key] = &cltypes.Contribution{ - Slot: message.Slot, - SubcommitteeIndex: subCommitee, - BeaconBlockRoot: message.BeaconBlockRoot, - AggregationBits: make([]byte, cltypes.SyncCommitteeAggregationBitsSize), - } - return nil - }).AnyTimes() + pool.EXPECT(). + AddSyncContribution(gomock.Any(), gomock.Any()). + DoAndReturn(func(headState *state.CachingBeaconState, contribution *cltypes.Contribution) error { + key := syncContributionKey{ + slot: contribution.Slot, + subcommitteeIndex: contribution.SubcommitteeIndex, + beaconBlockRoot: contribution.BeaconBlockRoot, + } + u[key] = contribution + return nil + }). + AnyTimes() + pool.EXPECT(). + GetSyncContribution(gomock.Any(), gomock.Any(), gomock.Any()). + DoAndReturn(func(slot uint64, subcommitteeIndex uint64, beaconBlockRoot common.Hash) *cltypes.Contribution { + key := syncContributionKey{ + slot: slot, + subcommitteeIndex: subcommitteeIndex, + beaconBlockRoot: beaconBlockRoot, + } + return u[key] + }). + AnyTimes() + pool.EXPECT(). + AddSyncCommitteeMessage(gomock.Any(), gomock.Any(), gomock.Any()). + DoAndReturn(func(headState *state.CachingBeaconState, subCommitee uint64, message *cltypes.SyncCommitteeMessage) error { + key := syncContributionKey{ + slot: message.Slot, + subcommitteeIndex: subCommitee, + beaconBlockRoot: message.BeaconBlockRoot, + } + u[key] = &cltypes.Contribution{ + Slot: message.Slot, + SubcommitteeIndex: subCommitee, + BeaconBlockRoot: message.BeaconBlockRoot, + AggregationBits: make([]byte, cltypes.SyncCommitteeAggregationBitsSize), + } + return nil + }).AnyTimes() return pool } diff --git a/cl/phase1/network/services/interface.go b/cl/phase1/network/services/interface.go index 2507798daaf..62be577b940 100644 --- a/cl/phase1/network/services/interface.go +++ b/cl/phase1/network/services/interface.go @@ -13,29 +13,29 @@ type Service[T any] interface { ProcessMessage(ctx context.Context, subnet *uint64, msg T) error } -//go:generate mockgen -destination=./mock_services/block_service_mock.go -package=mock_services . BlockService +//go:generate mockgen -typed=true -destination=./mock_services/block_service_mock.go -package=mock_services . BlockService type BlockService Service[*cltypes.SignedBeaconBlock] -//go:generate mockgen -destination=./mock_services/blob_sidecars_service_mock.go -package=mock_services . BlobSidecarsService +//go:generate mockgen -typed=true -destination=./mock_services/blob_sidecars_service_mock.go -package=mock_services . BlobSidecarsService type BlobSidecarsService Service[*cltypes.BlobSidecar] -//go:generate mockgen -destination=./mock_services/sync_committee_messages_service_mock.go -package=mock_services . SyncCommitteeMessagesService +//go:generate mockgen -typed=true -destination=./mock_services/sync_committee_messages_service_mock.go -package=mock_services . SyncCommitteeMessagesService type SyncCommitteeMessagesService Service[*cltypes.SyncCommitteeMessage] -//go:generate mockgen -destination=./mock_services/sync_contribution_service_mock.go -package=mock_services . SyncContributionService +//go:generate mockgen -typed=true -destination=./mock_services/sync_contribution_service_mock.go -package=mock_services . SyncContributionService type SyncContributionService Service[*cltypes.SignedContributionAndProof] -//go:generate mockgen -destination=./mock_services/aggregate_and_proof_service_mock.go -package=mock_services . AggregateAndProofService +//go:generate mockgen -typed=true -destination=./mock_services/aggregate_and_proof_service_mock.go -package=mock_services . AggregateAndProofService type AggregateAndProofService Service[*cltypes.SignedAggregateAndProof] -//go:generate mockgen -destination=./mock_services/attestation_service_mock.go -package=mock_services . AttestationService +//go:generate mockgen -typed=true -destination=./mock_services/attestation_service_mock.go -package=mock_services . AttestationService type AttestationService Service[*solid.Attestation] -//go:generate mockgen -destination=./mock_services/voluntary_exit_service_mock.go -package=mock_services . VoluntaryExitService +//go:generate mockgen -typed=true -destination=./mock_services/voluntary_exit_service_mock.go -package=mock_services . VoluntaryExitService type VoluntaryExitService Service[*cltypes.SignedVoluntaryExit] -//go:generate mockgen -destination=./mock_services/bls_to_execution_change_service_mock.go -package=mock_services . BLSToExecutionChangeService +//go:generate mockgen -typed=true -destination=./mock_services/bls_to_execution_change_service_mock.go -package=mock_services . BLSToExecutionChangeService type BLSToExecutionChangeService Service[*cltypes.SignedBLSToExecutionChange] -//go:generate mockgen -destination=./mock_services/proposer_slashing_service_mock.go -package=mock_services . ProposerSlashingService +//go:generate mockgen -typed=true -destination=./mock_services/proposer_slashing_service_mock.go -package=mock_services . ProposerSlashingService type ProposerSlashingService Service[*cltypes.ProposerSlashing] diff --git a/cl/phase1/network/services/mock_services/aggregate_and_proof_service_mock.go b/cl/phase1/network/services/mock_services/aggregate_and_proof_service_mock.go index 5a399833bb6..7d0eff95ca9 100644 --- a/cl/phase1/network/services/mock_services/aggregate_and_proof_service_mock.go +++ b/cl/phase1/network/services/mock_services/aggregate_and_proof_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/aggregate_and_proof_service_mock.go -package=mock_services . AggregateAndProofService +// mockgen -typed=true -destination=./mock_services/aggregate_and_proof_service_mock.go -package=mock_services . AggregateAndProofService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockAggregateAndProofService) ProcessMessage(arg0 context.Context, arg1 } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockAggregateAndProofServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAggregateAndProofServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockAggregateAndProofServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockAggregateAndProofService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockAggregateAndProofService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockAggregateAndProofServiceProcessMessageCall{Call: call} +} + +// MockAggregateAndProofServiceProcessMessageCall wrap *gomock.Call +type MockAggregateAndProofServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAggregateAndProofServiceProcessMessageCall) Return(arg0 error) *MockAggregateAndProofServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAggregateAndProofServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.SignedAggregateAndProof) error) *MockAggregateAndProofServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAggregateAndProofServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.SignedAggregateAndProof) error) *MockAggregateAndProofServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/attestation_service_mock.go b/cl/phase1/network/services/mock_services/attestation_service_mock.go index 9b183096729..537da583a5d 100644 --- a/cl/phase1/network/services/mock_services/attestation_service_mock.go +++ b/cl/phase1/network/services/mock_services/attestation_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/attestation_service_mock.go -package=mock_services . AttestationService +// mockgen -typed=true -destination=./mock_services/attestation_service_mock.go -package=mock_services . AttestationService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockAttestationService) ProcessMessage(arg0 context.Context, arg1 *uint } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockAttestationServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAttestationServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockAttestationServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockAttestationService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockAttestationService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockAttestationServiceProcessMessageCall{Call: call} +} + +// MockAttestationServiceProcessMessageCall wrap *gomock.Call +type MockAttestationServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockAttestationServiceProcessMessageCall) Return(arg0 error) *MockAttestationServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockAttestationServiceProcessMessageCall) Do(f func(context.Context, *uint64, *solid.Attestation) error) *MockAttestationServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockAttestationServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *solid.Attestation) error) *MockAttestationServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/blob_sidecars_service_mock.go b/cl/phase1/network/services/mock_services/blob_sidecars_service_mock.go index d41d99975bf..c27b577b97e 100644 --- a/cl/phase1/network/services/mock_services/blob_sidecars_service_mock.go +++ b/cl/phase1/network/services/mock_services/blob_sidecars_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/blob_sidecars_service_mock.go -package=mock_services . BlobSidecarsService +// mockgen -typed=true -destination=./mock_services/blob_sidecars_service_mock.go -package=mock_services . BlobSidecarsService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockBlobSidecarsService) ProcessMessage(arg0 context.Context, arg1 *uin } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockBlobSidecarsServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockBlobSidecarsServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockBlobSidecarsServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockBlobSidecarsService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockBlobSidecarsService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockBlobSidecarsServiceProcessMessageCall{Call: call} +} + +// MockBlobSidecarsServiceProcessMessageCall wrap *gomock.Call +type MockBlobSidecarsServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBlobSidecarsServiceProcessMessageCall) Return(arg0 error) *MockBlobSidecarsServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBlobSidecarsServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.BlobSidecar) error) *MockBlobSidecarsServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBlobSidecarsServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.BlobSidecar) error) *MockBlobSidecarsServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/block_service_mock.go b/cl/phase1/network/services/mock_services/block_service_mock.go index 7048e341363..22014d316bb 100644 --- a/cl/phase1/network/services/mock_services/block_service_mock.go +++ b/cl/phase1/network/services/mock_services/block_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/block_service_mock.go -package=mock_services . BlockService +// mockgen -typed=true -destination=./mock_services/block_service_mock.go -package=mock_services . BlockService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockBlockService) ProcessMessage(arg0 context.Context, arg1 *uint64, ar } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockBlockServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockBlockServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockBlockServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockBlockService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockBlockService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockBlockServiceProcessMessageCall{Call: call} +} + +// MockBlockServiceProcessMessageCall wrap *gomock.Call +type MockBlockServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBlockServiceProcessMessageCall) Return(arg0 error) *MockBlockServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBlockServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.SignedBeaconBlock) error) *MockBlockServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBlockServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.SignedBeaconBlock) error) *MockBlockServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/bls_to_execution_change_service_mock.go b/cl/phase1/network/services/mock_services/bls_to_execution_change_service_mock.go index 3e84bfd082d..3fad375a124 100644 --- a/cl/phase1/network/services/mock_services/bls_to_execution_change_service_mock.go +++ b/cl/phase1/network/services/mock_services/bls_to_execution_change_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/bls_to_execution_change_service_mock.go -package=mock_services . BLSToExecutionChangeService +// mockgen -typed=true -destination=./mock_services/bls_to_execution_change_service_mock.go -package=mock_services . BLSToExecutionChangeService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockBLSToExecutionChangeService) ProcessMessage(arg0 context.Context, a } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockBLSToExecutionChangeServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockBLSToExecutionChangeServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockBLSToExecutionChangeServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockBLSToExecutionChangeService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockBLSToExecutionChangeService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockBLSToExecutionChangeServiceProcessMessageCall{Call: call} +} + +// MockBLSToExecutionChangeServiceProcessMessageCall wrap *gomock.Call +type MockBLSToExecutionChangeServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockBLSToExecutionChangeServiceProcessMessageCall) Return(arg0 error) *MockBLSToExecutionChangeServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockBLSToExecutionChangeServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.SignedBLSToExecutionChange) error) *MockBLSToExecutionChangeServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockBLSToExecutionChangeServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.SignedBLSToExecutionChange) error) *MockBLSToExecutionChangeServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/proposer_slashing_service_mock.go b/cl/phase1/network/services/mock_services/proposer_slashing_service_mock.go index e2cbcda1b73..d1f41e6aea6 100644 --- a/cl/phase1/network/services/mock_services/proposer_slashing_service_mock.go +++ b/cl/phase1/network/services/mock_services/proposer_slashing_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/proposer_slashing_service_mock.go -package=mock_services . ProposerSlashingService +// mockgen -typed=true -destination=./mock_services/proposer_slashing_service_mock.go -package=mock_services . ProposerSlashingService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockProposerSlashingService) ProcessMessage(arg0 context.Context, arg1 } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockProposerSlashingServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockProposerSlashingServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockProposerSlashingServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockProposerSlashingService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockProposerSlashingService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockProposerSlashingServiceProcessMessageCall{Call: call} +} + +// MockProposerSlashingServiceProcessMessageCall wrap *gomock.Call +type MockProposerSlashingServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockProposerSlashingServiceProcessMessageCall) Return(arg0 error) *MockProposerSlashingServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockProposerSlashingServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.ProposerSlashing) error) *MockProposerSlashingServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockProposerSlashingServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.ProposerSlashing) error) *MockProposerSlashingServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/sync_committee_messages_service_mock.go b/cl/phase1/network/services/mock_services/sync_committee_messages_service_mock.go index 735e8d8566c..37cde072f81 100644 --- a/cl/phase1/network/services/mock_services/sync_committee_messages_service_mock.go +++ b/cl/phase1/network/services/mock_services/sync_committee_messages_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/sync_committee_messages_service_mock.go -package=mock_services . SyncCommitteeMessagesService +// mockgen -typed=true -destination=./mock_services/sync_committee_messages_service_mock.go -package=mock_services . SyncCommitteeMessagesService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockSyncCommitteeMessagesService) ProcessMessage(arg0 context.Context, } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockSyncCommitteeMessagesServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockSyncCommitteeMessagesServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockSyncCommitteeMessagesServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockSyncCommitteeMessagesService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockSyncCommitteeMessagesService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockSyncCommitteeMessagesServiceProcessMessageCall{Call: call} +} + +// MockSyncCommitteeMessagesServiceProcessMessageCall wrap *gomock.Call +type MockSyncCommitteeMessagesServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncCommitteeMessagesServiceProcessMessageCall) Return(arg0 error) *MockSyncCommitteeMessagesServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncCommitteeMessagesServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.SyncCommitteeMessage) error) *MockSyncCommitteeMessagesServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncCommitteeMessagesServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.SyncCommitteeMessage) error) *MockSyncCommitteeMessagesServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/sync_contribution_service_mock.go b/cl/phase1/network/services/mock_services/sync_contribution_service_mock.go index cec3f1b1bfe..937b86a4db5 100644 --- a/cl/phase1/network/services/mock_services/sync_contribution_service_mock.go +++ b/cl/phase1/network/services/mock_services/sync_contribution_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/sync_contribution_service_mock.go -package=mock_services . SyncContributionService +// mockgen -typed=true -destination=./mock_services/sync_contribution_service_mock.go -package=mock_services . SyncContributionService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockSyncContributionService) ProcessMessage(arg0 context.Context, arg1 } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockSyncContributionServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockSyncContributionServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockSyncContributionServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockSyncContributionService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockSyncContributionService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockSyncContributionServiceProcessMessageCall{Call: call} +} + +// MockSyncContributionServiceProcessMessageCall wrap *gomock.Call +type MockSyncContributionServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncContributionServiceProcessMessageCall) Return(arg0 error) *MockSyncContributionServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncContributionServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.SignedContributionAndProof) error) *MockSyncContributionServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncContributionServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.SignedContributionAndProof) error) *MockSyncContributionServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/phase1/network/services/mock_services/voluntary_exit_service_mock.go b/cl/phase1/network/services/mock_services/voluntary_exit_service_mock.go index 5c57cc4d592..3f8bd68d28c 100644 --- a/cl/phase1/network/services/mock_services/voluntary_exit_service_mock.go +++ b/cl/phase1/network/services/mock_services/voluntary_exit_service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/voluntary_exit_service_mock.go -package=mock_services . VoluntaryExitService +// mockgen -typed=true -destination=./mock_services/voluntary_exit_service_mock.go -package=mock_services . VoluntaryExitService // // Package mock_services is a generated GoMock package. @@ -49,7 +49,31 @@ func (m *MockVoluntaryExitService) ProcessMessage(arg0 context.Context, arg1 *ui } // ProcessMessage indicates an expected call of ProcessMessage. -func (mr *MockVoluntaryExitServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockVoluntaryExitServiceMockRecorder) ProcessMessage(arg0, arg1, arg2 any) *MockVoluntaryExitServiceProcessMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockVoluntaryExitService)(nil).ProcessMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessMessage", reflect.TypeOf((*MockVoluntaryExitService)(nil).ProcessMessage), arg0, arg1, arg2) + return &MockVoluntaryExitServiceProcessMessageCall{Call: call} +} + +// MockVoluntaryExitServiceProcessMessageCall wrap *gomock.Call +type MockVoluntaryExitServiceProcessMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockVoluntaryExitServiceProcessMessageCall) Return(arg0 error) *MockVoluntaryExitServiceProcessMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockVoluntaryExitServiceProcessMessageCall) Do(f func(context.Context, *uint64, *cltypes.SignedVoluntaryExit) error) *MockVoluntaryExitServiceProcessMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockVoluntaryExitServiceProcessMessageCall) DoAndReturn(f func(context.Context, *uint64, *cltypes.SignedVoluntaryExit) error) *MockVoluntaryExitServiceProcessMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/utils/eth_clock/ethereum_clock.go b/cl/utils/eth_clock/ethereum_clock.go index 5548e30995c..eaf5aca5e5c 100644 --- a/cl/utils/eth_clock/ethereum_clock.go +++ b/cl/utils/eth_clock/ethereum_clock.go @@ -12,7 +12,7 @@ import ( var maximumClockDisparity = 500 * time.Millisecond -//go:generate mockgen -source=./ethereum_clock.go -destination=./ethereum_clock_mock.go -package=eth_clock . EthereumClock +//go:generate mockgen -typed=true -source=./ethereum_clock.go -destination=./ethereum_clock_mock.go -package=eth_clock . EthereumClock type EthereumClock interface { GetSlotTime(slot uint64) time.Time GetCurrentSlot() uint64 diff --git a/cl/utils/eth_clock/ethereum_clock_mock.go b/cl/utils/eth_clock/ethereum_clock_mock.go index 43b103d649f..ab444a50e4f 100644 --- a/cl/utils/eth_clock/ethereum_clock_mock.go +++ b/cl/utils/eth_clock/ethereum_clock_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -source=./ethereum_clock.go -destination=./ethereum_clock_mock.go -package=eth_clock . EthereumClock +// mockgen -typed=true -source=./ethereum_clock.go -destination=./ethereum_clock_mock.go -package=eth_clock . EthereumClock // // Package eth_clock is a generated GoMock package. @@ -51,9 +51,33 @@ func (m *MockEthereumClock) ComputeForkDigestForVersion(currentVersion common.By } // ComputeForkDigestForVersion indicates an expected call of ComputeForkDigestForVersion. -func (mr *MockEthereumClockMockRecorder) ComputeForkDigestForVersion(currentVersion any) *gomock.Call { +func (mr *MockEthereumClockMockRecorder) ComputeForkDigestForVersion(currentVersion any) *MockEthereumClockComputeForkDigestForVersionCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ComputeForkDigestForVersion", reflect.TypeOf((*MockEthereumClock)(nil).ComputeForkDigestForVersion), currentVersion) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ComputeForkDigestForVersion", reflect.TypeOf((*MockEthereumClock)(nil).ComputeForkDigestForVersion), currentVersion) + return &MockEthereumClockComputeForkDigestForVersionCall{Call: call} +} + +// MockEthereumClockComputeForkDigestForVersionCall wrap *gomock.Call +type MockEthereumClockComputeForkDigestForVersionCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockComputeForkDigestForVersionCall) Return(digest common.Bytes4, err error) *MockEthereumClockComputeForkDigestForVersionCall { + c.Call = c.Call.Return(digest, err) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockComputeForkDigestForVersionCall) Do(f func(common.Bytes4) (common.Bytes4, error)) *MockEthereumClockComputeForkDigestForVersionCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockComputeForkDigestForVersionCall) DoAndReturn(f func(common.Bytes4) (common.Bytes4, error)) *MockEthereumClockComputeForkDigestForVersionCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CurrentForkDigest mocks base method. @@ -66,9 +90,33 @@ func (m *MockEthereumClock) CurrentForkDigest() (common.Bytes4, error) { } // CurrentForkDigest indicates an expected call of CurrentForkDigest. -func (mr *MockEthereumClockMockRecorder) CurrentForkDigest() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) CurrentForkDigest() *MockEthereumClockCurrentForkDigestCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentForkDigest", reflect.TypeOf((*MockEthereumClock)(nil).CurrentForkDigest)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentForkDigest", reflect.TypeOf((*MockEthereumClock)(nil).CurrentForkDigest)) + return &MockEthereumClockCurrentForkDigestCall{Call: call} +} + +// MockEthereumClockCurrentForkDigestCall wrap *gomock.Call +type MockEthereumClockCurrentForkDigestCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockCurrentForkDigestCall) Return(arg0 common.Bytes4, arg1 error) *MockEthereumClockCurrentForkDigestCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockCurrentForkDigestCall) Do(f func() (common.Bytes4, error)) *MockEthereumClockCurrentForkDigestCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockCurrentForkDigestCall) DoAndReturn(f func() (common.Bytes4, error)) *MockEthereumClockCurrentForkDigestCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ForkId mocks base method. @@ -81,9 +129,33 @@ func (m *MockEthereumClock) ForkId() ([]byte, error) { } // ForkId indicates an expected call of ForkId. -func (mr *MockEthereumClockMockRecorder) ForkId() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) ForkId() *MockEthereumClockForkIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ForkId", reflect.TypeOf((*MockEthereumClock)(nil).ForkId)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ForkId", reflect.TypeOf((*MockEthereumClock)(nil).ForkId)) + return &MockEthereumClockForkIdCall{Call: call} +} + +// MockEthereumClockForkIdCall wrap *gomock.Call +type MockEthereumClockForkIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockForkIdCall) Return(arg0 []byte, arg1 error) *MockEthereumClockForkIdCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockForkIdCall) Do(f func() ([]byte, error)) *MockEthereumClockForkIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockForkIdCall) DoAndReturn(f func() ([]byte, error)) *MockEthereumClockForkIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GenesisTime mocks base method. @@ -95,9 +167,33 @@ func (m *MockEthereumClock) GenesisTime() uint64 { } // GenesisTime indicates an expected call of GenesisTime. -func (mr *MockEthereumClockMockRecorder) GenesisTime() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) GenesisTime() *MockEthereumClockGenesisTimeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenesisTime", reflect.TypeOf((*MockEthereumClock)(nil).GenesisTime)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenesisTime", reflect.TypeOf((*MockEthereumClock)(nil).GenesisTime)) + return &MockEthereumClockGenesisTimeCall{Call: call} +} + +// MockEthereumClockGenesisTimeCall wrap *gomock.Call +type MockEthereumClockGenesisTimeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockGenesisTimeCall) Return(arg0 uint64) *MockEthereumClockGenesisTimeCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockGenesisTimeCall) Do(f func() uint64) *MockEthereumClockGenesisTimeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockGenesisTimeCall) DoAndReturn(f func() uint64) *MockEthereumClockGenesisTimeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GenesisValidatorsRoot mocks base method. @@ -109,9 +205,33 @@ func (m *MockEthereumClock) GenesisValidatorsRoot() common.Hash { } // GenesisValidatorsRoot indicates an expected call of GenesisValidatorsRoot. -func (mr *MockEthereumClockMockRecorder) GenesisValidatorsRoot() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) GenesisValidatorsRoot() *MockEthereumClockGenesisValidatorsRootCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenesisValidatorsRoot", reflect.TypeOf((*MockEthereumClock)(nil).GenesisValidatorsRoot)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GenesisValidatorsRoot", reflect.TypeOf((*MockEthereumClock)(nil).GenesisValidatorsRoot)) + return &MockEthereumClockGenesisValidatorsRootCall{Call: call} +} + +// MockEthereumClockGenesisValidatorsRootCall wrap *gomock.Call +type MockEthereumClockGenesisValidatorsRootCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockGenesisValidatorsRootCall) Return(arg0 common.Hash) *MockEthereumClockGenesisValidatorsRootCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockGenesisValidatorsRootCall) Do(f func() common.Hash) *MockEthereumClockGenesisValidatorsRootCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockGenesisValidatorsRootCall) DoAndReturn(f func() common.Hash) *MockEthereumClockGenesisValidatorsRootCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetCurrentEpoch mocks base method. @@ -123,9 +243,33 @@ func (m *MockEthereumClock) GetCurrentEpoch() uint64 { } // GetCurrentEpoch indicates an expected call of GetCurrentEpoch. -func (mr *MockEthereumClockMockRecorder) GetCurrentEpoch() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) GetCurrentEpoch() *MockEthereumClockGetCurrentEpochCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentEpoch", reflect.TypeOf((*MockEthereumClock)(nil).GetCurrentEpoch)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentEpoch", reflect.TypeOf((*MockEthereumClock)(nil).GetCurrentEpoch)) + return &MockEthereumClockGetCurrentEpochCall{Call: call} +} + +// MockEthereumClockGetCurrentEpochCall wrap *gomock.Call +type MockEthereumClockGetCurrentEpochCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockGetCurrentEpochCall) Return(arg0 uint64) *MockEthereumClockGetCurrentEpochCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockGetCurrentEpochCall) Do(f func() uint64) *MockEthereumClockGetCurrentEpochCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockGetCurrentEpochCall) DoAndReturn(f func() uint64) *MockEthereumClockGetCurrentEpochCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetCurrentSlot mocks base method. @@ -137,9 +281,33 @@ func (m *MockEthereumClock) GetCurrentSlot() uint64 { } // GetCurrentSlot indicates an expected call of GetCurrentSlot. -func (mr *MockEthereumClockMockRecorder) GetCurrentSlot() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) GetCurrentSlot() *MockEthereumClockGetCurrentSlotCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSlot", reflect.TypeOf((*MockEthereumClock)(nil).GetCurrentSlot)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSlot", reflect.TypeOf((*MockEthereumClock)(nil).GetCurrentSlot)) + return &MockEthereumClockGetCurrentSlotCall{Call: call} +} + +// MockEthereumClockGetCurrentSlotCall wrap *gomock.Call +type MockEthereumClockGetCurrentSlotCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockGetCurrentSlotCall) Return(arg0 uint64) *MockEthereumClockGetCurrentSlotCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockGetCurrentSlotCall) Do(f func() uint64) *MockEthereumClockGetCurrentSlotCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockGetCurrentSlotCall) DoAndReturn(f func() uint64) *MockEthereumClockGetCurrentSlotCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetSlotByTime mocks base method. @@ -151,9 +319,33 @@ func (m *MockEthereumClock) GetSlotByTime(time time.Time) uint64 { } // GetSlotByTime indicates an expected call of GetSlotByTime. -func (mr *MockEthereumClockMockRecorder) GetSlotByTime(time any) *gomock.Call { +func (mr *MockEthereumClockMockRecorder) GetSlotByTime(time any) *MockEthereumClockGetSlotByTimeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSlotByTime", reflect.TypeOf((*MockEthereumClock)(nil).GetSlotByTime), time) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSlotByTime", reflect.TypeOf((*MockEthereumClock)(nil).GetSlotByTime), time) + return &MockEthereumClockGetSlotByTimeCall{Call: call} +} + +// MockEthereumClockGetSlotByTimeCall wrap *gomock.Call +type MockEthereumClockGetSlotByTimeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockGetSlotByTimeCall) Return(arg0 uint64) *MockEthereumClockGetSlotByTimeCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockGetSlotByTimeCall) Do(f func(time.Time) uint64) *MockEthereumClockGetSlotByTimeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockGetSlotByTimeCall) DoAndReturn(f func(time.Time) uint64) *MockEthereumClockGetSlotByTimeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetSlotTime mocks base method. @@ -165,9 +357,33 @@ func (m *MockEthereumClock) GetSlotTime(slot uint64) time.Time { } // GetSlotTime indicates an expected call of GetSlotTime. -func (mr *MockEthereumClockMockRecorder) GetSlotTime(slot any) *gomock.Call { +func (mr *MockEthereumClockMockRecorder) GetSlotTime(slot any) *MockEthereumClockGetSlotTimeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSlotTime", reflect.TypeOf((*MockEthereumClock)(nil).GetSlotTime), slot) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSlotTime", reflect.TypeOf((*MockEthereumClock)(nil).GetSlotTime), slot) + return &MockEthereumClockGetSlotTimeCall{Call: call} +} + +// MockEthereumClockGetSlotTimeCall wrap *gomock.Call +type MockEthereumClockGetSlotTimeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockGetSlotTimeCall) Return(arg0 time.Time) *MockEthereumClockGetSlotTimeCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockGetSlotTimeCall) Do(f func(uint64) time.Time) *MockEthereumClockGetSlotTimeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockGetSlotTimeCall) DoAndReturn(f func(uint64) time.Time) *MockEthereumClockGetSlotTimeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // IsSlotCurrentSlotWithMaximumClockDisparity mocks base method. @@ -179,9 +395,33 @@ func (m *MockEthereumClock) IsSlotCurrentSlotWithMaximumClockDisparity(slot uint } // IsSlotCurrentSlotWithMaximumClockDisparity indicates an expected call of IsSlotCurrentSlotWithMaximumClockDisparity. -func (mr *MockEthereumClockMockRecorder) IsSlotCurrentSlotWithMaximumClockDisparity(slot any) *gomock.Call { +func (mr *MockEthereumClockMockRecorder) IsSlotCurrentSlotWithMaximumClockDisparity(slot any) *MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSlotCurrentSlotWithMaximumClockDisparity", reflect.TypeOf((*MockEthereumClock)(nil).IsSlotCurrentSlotWithMaximumClockDisparity), slot) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsSlotCurrentSlotWithMaximumClockDisparity", reflect.TypeOf((*MockEthereumClock)(nil).IsSlotCurrentSlotWithMaximumClockDisparity), slot) + return &MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall{Call: call} +} + +// MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall wrap *gomock.Call +type MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall) Return(arg0 bool) *MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall) Do(f func(uint64) bool) *MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall) DoAndReturn(f func(uint64) bool) *MockEthereumClockIsSlotCurrentSlotWithMaximumClockDisparityCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastFork mocks base method. @@ -194,9 +434,33 @@ func (m *MockEthereumClock) LastFork() (common.Bytes4, error) { } // LastFork indicates an expected call of LastFork. -func (mr *MockEthereumClockMockRecorder) LastFork() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) LastFork() *MockEthereumClockLastForkCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFork", reflect.TypeOf((*MockEthereumClock)(nil).LastFork)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFork", reflect.TypeOf((*MockEthereumClock)(nil).LastFork)) + return &MockEthereumClockLastForkCall{Call: call} +} + +// MockEthereumClockLastForkCall wrap *gomock.Call +type MockEthereumClockLastForkCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockLastForkCall) Return(arg0 common.Bytes4, arg1 error) *MockEthereumClockLastForkCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockLastForkCall) Do(f func() (common.Bytes4, error)) *MockEthereumClockLastForkCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockLastForkCall) DoAndReturn(f func() (common.Bytes4, error)) *MockEthereumClockLastForkCall { + c.Call = c.Call.DoAndReturn(f) + return c } // NextForkDigest mocks base method. @@ -209,9 +473,33 @@ func (m *MockEthereumClock) NextForkDigest() (common.Bytes4, error) { } // NextForkDigest indicates an expected call of NextForkDigest. -func (mr *MockEthereumClockMockRecorder) NextForkDigest() *gomock.Call { +func (mr *MockEthereumClockMockRecorder) NextForkDigest() *MockEthereumClockNextForkDigestCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextForkDigest", reflect.TypeOf((*MockEthereumClock)(nil).NextForkDigest)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NextForkDigest", reflect.TypeOf((*MockEthereumClock)(nil).NextForkDigest)) + return &MockEthereumClockNextForkDigestCall{Call: call} +} + +// MockEthereumClockNextForkDigestCall wrap *gomock.Call +type MockEthereumClockNextForkDigestCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockNextForkDigestCall) Return(arg0 common.Bytes4, arg1 error) *MockEthereumClockNextForkDigestCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockNextForkDigestCall) Do(f func() (common.Bytes4, error)) *MockEthereumClockNextForkDigestCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockNextForkDigestCall) DoAndReturn(f func() (common.Bytes4, error)) *MockEthereumClockNextForkDigestCall { + c.Call = c.Call.DoAndReturn(f) + return c } // StateVersionByForkDigest mocks base method. @@ -224,7 +512,31 @@ func (m *MockEthereumClock) StateVersionByForkDigest(arg0 common.Bytes4) (clpara } // StateVersionByForkDigest indicates an expected call of StateVersionByForkDigest. -func (mr *MockEthereumClockMockRecorder) StateVersionByForkDigest(arg0 any) *gomock.Call { +func (mr *MockEthereumClockMockRecorder) StateVersionByForkDigest(arg0 any) *MockEthereumClockStateVersionByForkDigestCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVersionByForkDigest", reflect.TypeOf((*MockEthereumClock)(nil).StateVersionByForkDigest), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateVersionByForkDigest", reflect.TypeOf((*MockEthereumClock)(nil).StateVersionByForkDigest), arg0) + return &MockEthereumClockStateVersionByForkDigestCall{Call: call} +} + +// MockEthereumClockStateVersionByForkDigestCall wrap *gomock.Call +type MockEthereumClockStateVersionByForkDigestCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockEthereumClockStateVersionByForkDigestCall) Return(arg0 clparams.StateVersion, arg1 error) *MockEthereumClockStateVersionByForkDigestCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockEthereumClockStateVersionByForkDigestCall) Do(f func(common.Bytes4) (clparams.StateVersion, error)) *MockEthereumClockStateVersionByForkDigestCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockEthereumClockStateVersionByForkDigestCall) DoAndReturn(f func(common.Bytes4) (clparams.StateVersion, error)) *MockEthereumClockStateVersionByForkDigestCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/validator/committee_subscription/interface.go b/cl/validator/committee_subscription/interface.go index 6cc6056df28..43ffac4074a 100644 --- a/cl/validator/committee_subscription/interface.go +++ b/cl/validator/committee_subscription/interface.go @@ -7,7 +7,7 @@ import ( "github.com/ledgerwatch/erigon/cl/cltypes/solid" ) -//go:generate mockgen -destination=./mock_services/committee_subscribe_mock.go -package=mock_services . CommitteeSubscribe +//go:generate mockgen -typed=true -destination=./mock_services/committee_subscribe_mock.go -package=mock_services . CommitteeSubscribe type CommitteeSubscribe interface { AddAttestationSubscription(ctx context.Context, p *cltypes.BeaconCommitteeSubscription) error CheckAggregateAttestation(att *solid.Attestation) error diff --git a/cl/validator/committee_subscription/mock_services/committee_subscribe_mock.go b/cl/validator/committee_subscription/mock_services/committee_subscribe_mock.go index 913fd6bb11a..bfdfee3dc12 100644 --- a/cl/validator/committee_subscription/mock_services/committee_subscribe_mock.go +++ b/cl/validator/committee_subscription/mock_services/committee_subscribe_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mock_services/committee_subscribe_mock.go -package=mock_services . CommitteeSubscribe +// mockgen -typed=true -destination=./mock_services/committee_subscribe_mock.go -package=mock_services . CommitteeSubscribe // // Package mock_services is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockCommitteeSubscribe) AddAttestationSubscription(arg0 context.Context } // AddAttestationSubscription indicates an expected call of AddAttestationSubscription. -func (mr *MockCommitteeSubscribeMockRecorder) AddAttestationSubscription(arg0, arg1 any) *gomock.Call { +func (mr *MockCommitteeSubscribeMockRecorder) AddAttestationSubscription(arg0, arg1 any) *MockCommitteeSubscribeAddAttestationSubscriptionCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAttestationSubscription", reflect.TypeOf((*MockCommitteeSubscribe)(nil).AddAttestationSubscription), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddAttestationSubscription", reflect.TypeOf((*MockCommitteeSubscribe)(nil).AddAttestationSubscription), arg0, arg1) + return &MockCommitteeSubscribeAddAttestationSubscriptionCall{Call: call} +} + +// MockCommitteeSubscribeAddAttestationSubscriptionCall wrap *gomock.Call +type MockCommitteeSubscribeAddAttestationSubscriptionCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCommitteeSubscribeAddAttestationSubscriptionCall) Return(arg0 error) *MockCommitteeSubscribeAddAttestationSubscriptionCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCommitteeSubscribeAddAttestationSubscriptionCall) Do(f func(context.Context, *cltypes.BeaconCommitteeSubscription) error) *MockCommitteeSubscribeAddAttestationSubscriptionCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCommitteeSubscribeAddAttestationSubscriptionCall) DoAndReturn(f func(context.Context, *cltypes.BeaconCommitteeSubscription) error) *MockCommitteeSubscribeAddAttestationSubscriptionCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CheckAggregateAttestation mocks base method. @@ -64,7 +88,31 @@ func (m *MockCommitteeSubscribe) CheckAggregateAttestation(arg0 *solid.Attestati } // CheckAggregateAttestation indicates an expected call of CheckAggregateAttestation. -func (mr *MockCommitteeSubscribeMockRecorder) CheckAggregateAttestation(arg0 any) *gomock.Call { +func (mr *MockCommitteeSubscribeMockRecorder) CheckAggregateAttestation(arg0 any) *MockCommitteeSubscribeCheckAggregateAttestationCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckAggregateAttestation", reflect.TypeOf((*MockCommitteeSubscribe)(nil).CheckAggregateAttestation), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckAggregateAttestation", reflect.TypeOf((*MockCommitteeSubscribe)(nil).CheckAggregateAttestation), arg0) + return &MockCommitteeSubscribeCheckAggregateAttestationCall{Call: call} +} + +// MockCommitteeSubscribeCheckAggregateAttestationCall wrap *gomock.Call +type MockCommitteeSubscribeCheckAggregateAttestationCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCommitteeSubscribeCheckAggregateAttestationCall) Return(arg0 error) *MockCommitteeSubscribeCheckAggregateAttestationCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCommitteeSubscribeCheckAggregateAttestationCall) Do(f func(*solid.Attestation) error) *MockCommitteeSubscribeCheckAggregateAttestationCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCommitteeSubscribeCheckAggregateAttestationCall) DoAndReturn(f func(*solid.Attestation) error) *MockCommitteeSubscribeCheckAggregateAttestationCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/cl/validator/sync_contribution_pool/interface.go b/cl/validator/sync_contribution_pool/interface.go index 13e10a41acc..db021b333db 100644 --- a/cl/validator/sync_contribution_pool/interface.go +++ b/cl/validator/sync_contribution_pool/interface.go @@ -9,7 +9,7 @@ import ( // SyncContributionPool is an interface for managing sync committee contributions and messages. // it keeps a store of sync committee contributions, if new messages are received they are aggregated with pre-existing contributions. -//go:generate mockgen -destination=mock_services/sync_contribution_pool_mock.go -package=mock_services . SyncContributionPool +//go:generate mockgen -typed=true -destination=mock_services/sync_contribution_pool_mock.go -package=mock_services . SyncContributionPool type SyncContributionPool interface { // AddSyncContribution adds a sync committee contribution to the pool. AddSyncContribution(headState *state.CachingBeaconState, contribution *cltypes.Contribution) error diff --git a/cl/validator/sync_contribution_pool/mock_services/sync_contribution_pool_mock.go b/cl/validator/sync_contribution_pool/mock_services/sync_contribution_pool_mock.go index 28d195388d3..37950068065 100644 --- a/cl/validator/sync_contribution_pool/mock_services/sync_contribution_pool_mock.go +++ b/cl/validator/sync_contribution_pool/mock_services/sync_contribution_pool_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=mock_services/sync_contribution_pool_mock.go -package=mock_services . SyncContributionPool +// mockgen -typed=true -destination=mock_services/sync_contribution_pool_mock.go -package=mock_services . SyncContributionPool // // Package mock_services is a generated GoMock package. @@ -50,9 +50,33 @@ func (m *MockSyncContributionPool) AddSyncCommitteeMessage(arg0 *state.CachingBe } // AddSyncCommitteeMessage indicates an expected call of AddSyncCommitteeMessage. -func (mr *MockSyncContributionPoolMockRecorder) AddSyncCommitteeMessage(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockSyncContributionPoolMockRecorder) AddSyncCommitteeMessage(arg0, arg1, arg2 any) *MockSyncContributionPoolAddSyncCommitteeMessageCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSyncCommitteeMessage", reflect.TypeOf((*MockSyncContributionPool)(nil).AddSyncCommitteeMessage), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSyncCommitteeMessage", reflect.TypeOf((*MockSyncContributionPool)(nil).AddSyncCommitteeMessage), arg0, arg1, arg2) + return &MockSyncContributionPoolAddSyncCommitteeMessageCall{Call: call} +} + +// MockSyncContributionPoolAddSyncCommitteeMessageCall wrap *gomock.Call +type MockSyncContributionPoolAddSyncCommitteeMessageCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncContributionPoolAddSyncCommitteeMessageCall) Return(arg0 error) *MockSyncContributionPoolAddSyncCommitteeMessageCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncContributionPoolAddSyncCommitteeMessageCall) Do(f func(*state.CachingBeaconState, uint64, *cltypes.SyncCommitteeMessage) error) *MockSyncContributionPoolAddSyncCommitteeMessageCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncContributionPoolAddSyncCommitteeMessageCall) DoAndReturn(f func(*state.CachingBeaconState, uint64, *cltypes.SyncCommitteeMessage) error) *MockSyncContributionPoolAddSyncCommitteeMessageCall { + c.Call = c.Call.DoAndReturn(f) + return c } // AddSyncContribution mocks base method. @@ -64,9 +88,33 @@ func (m *MockSyncContributionPool) AddSyncContribution(arg0 *state.CachingBeacon } // AddSyncContribution indicates an expected call of AddSyncContribution. -func (mr *MockSyncContributionPoolMockRecorder) AddSyncContribution(arg0, arg1 any) *gomock.Call { +func (mr *MockSyncContributionPoolMockRecorder) AddSyncContribution(arg0, arg1 any) *MockSyncContributionPoolAddSyncContributionCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSyncContribution", reflect.TypeOf((*MockSyncContributionPool)(nil).AddSyncContribution), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddSyncContribution", reflect.TypeOf((*MockSyncContributionPool)(nil).AddSyncContribution), arg0, arg1) + return &MockSyncContributionPoolAddSyncContributionCall{Call: call} +} + +// MockSyncContributionPoolAddSyncContributionCall wrap *gomock.Call +type MockSyncContributionPoolAddSyncContributionCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncContributionPoolAddSyncContributionCall) Return(arg0 error) *MockSyncContributionPoolAddSyncContributionCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncContributionPoolAddSyncContributionCall) Do(f func(*state.CachingBeaconState, *cltypes.Contribution) error) *MockSyncContributionPoolAddSyncContributionCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncContributionPoolAddSyncContributionCall) DoAndReturn(f func(*state.CachingBeaconState, *cltypes.Contribution) error) *MockSyncContributionPoolAddSyncContributionCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetSyncAggregate mocks base method. @@ -79,9 +127,33 @@ func (m *MockSyncContributionPool) GetSyncAggregate(arg0 uint64, arg1 common.Has } // GetSyncAggregate indicates an expected call of GetSyncAggregate. -func (mr *MockSyncContributionPoolMockRecorder) GetSyncAggregate(arg0, arg1 any) *gomock.Call { +func (mr *MockSyncContributionPoolMockRecorder) GetSyncAggregate(arg0, arg1 any) *MockSyncContributionPoolGetSyncAggregateCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncAggregate", reflect.TypeOf((*MockSyncContributionPool)(nil).GetSyncAggregate), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncAggregate", reflect.TypeOf((*MockSyncContributionPool)(nil).GetSyncAggregate), arg0, arg1) + return &MockSyncContributionPoolGetSyncAggregateCall{Call: call} +} + +// MockSyncContributionPoolGetSyncAggregateCall wrap *gomock.Call +type MockSyncContributionPoolGetSyncAggregateCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncContributionPoolGetSyncAggregateCall) Return(arg0 *cltypes.SyncAggregate, arg1 error) *MockSyncContributionPoolGetSyncAggregateCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncContributionPoolGetSyncAggregateCall) Do(f func(uint64, common.Hash) (*cltypes.SyncAggregate, error)) *MockSyncContributionPoolGetSyncAggregateCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncContributionPoolGetSyncAggregateCall) DoAndReturn(f func(uint64, common.Hash) (*cltypes.SyncAggregate, error)) *MockSyncContributionPoolGetSyncAggregateCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetSyncContribution mocks base method. @@ -93,7 +165,31 @@ func (m *MockSyncContributionPool) GetSyncContribution(arg0, arg1 uint64, arg2 c } // GetSyncContribution indicates an expected call of GetSyncContribution. -func (mr *MockSyncContributionPoolMockRecorder) GetSyncContribution(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockSyncContributionPoolMockRecorder) GetSyncContribution(arg0, arg1, arg2 any) *MockSyncContributionPoolGetSyncContributionCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncContribution", reflect.TypeOf((*MockSyncContributionPool)(nil).GetSyncContribution), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncContribution", reflect.TypeOf((*MockSyncContributionPool)(nil).GetSyncContribution), arg0, arg1, arg2) + return &MockSyncContributionPoolGetSyncContributionCall{Call: call} +} + +// MockSyncContributionPoolGetSyncContributionCall wrap *gomock.Call +type MockSyncContributionPoolGetSyncContributionCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSyncContributionPoolGetSyncContributionCall) Return(arg0 *cltypes.Contribution) *MockSyncContributionPoolGetSyncContributionCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSyncContributionPoolGetSyncContributionCall) Do(f func(uint64, uint64, common.Hash) *cltypes.Contribution) *MockSyncContributionPoolGetSyncContributionCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSyncContributionPoolGetSyncContributionCall) DoAndReturn(f func(uint64, uint64, common.Hash) *cltypes.Contribution) *MockSyncContributionPoolGetSyncContributionCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/consensus/chain_header_reader_mock.go b/consensus/chain_header_reader_mock.go index 1d20eb10d3f..e5312734761 100644 --- a/consensus/chain_header_reader_mock.go +++ b/consensus/chain_header_reader_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./chain_header_reader_mock.go -package=consensus . ChainHeaderReader +// mockgen -typed=true -destination=./chain_header_reader_mock.go -package=consensus . ChainHeaderReader // // Package consensus is a generated GoMock package. @@ -51,9 +51,33 @@ func (m *MockChainHeaderReader) BorSpan(arg0 uint64) []byte { } // BorSpan indicates an expected call of BorSpan. -func (mr *MockChainHeaderReaderMockRecorder) BorSpan(arg0 any) *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) BorSpan(arg0 any) *MockChainHeaderReaderBorSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BorSpan", reflect.TypeOf((*MockChainHeaderReader)(nil).BorSpan), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BorSpan", reflect.TypeOf((*MockChainHeaderReader)(nil).BorSpan), arg0) + return &MockChainHeaderReaderBorSpanCall{Call: call} +} + +// MockChainHeaderReaderBorSpanCall wrap *gomock.Call +type MockChainHeaderReaderBorSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderBorSpanCall) Return(arg0 []byte) *MockChainHeaderReaderBorSpanCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderBorSpanCall) Do(f func(uint64) []byte) *MockChainHeaderReaderBorSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderBorSpanCall) DoAndReturn(f func(uint64) []byte) *MockChainHeaderReaderBorSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Config mocks base method. @@ -65,9 +89,33 @@ func (m *MockChainHeaderReader) Config() *chain.Config { } // Config indicates an expected call of Config. -func (mr *MockChainHeaderReaderMockRecorder) Config() *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) Config() *MockChainHeaderReaderConfigCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Config", reflect.TypeOf((*MockChainHeaderReader)(nil).Config)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Config", reflect.TypeOf((*MockChainHeaderReader)(nil).Config)) + return &MockChainHeaderReaderConfigCall{Call: call} +} + +// MockChainHeaderReaderConfigCall wrap *gomock.Call +type MockChainHeaderReaderConfigCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderConfigCall) Return(arg0 *chain.Config) *MockChainHeaderReaderConfigCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderConfigCall) Do(f func() *chain.Config) *MockChainHeaderReaderConfigCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderConfigCall) DoAndReturn(f func() *chain.Config) *MockChainHeaderReaderConfigCall { + c.Call = c.Call.DoAndReturn(f) + return c } // CurrentHeader mocks base method. @@ -79,9 +127,33 @@ func (m *MockChainHeaderReader) CurrentHeader() *types.Header { } // CurrentHeader indicates an expected call of CurrentHeader. -func (mr *MockChainHeaderReaderMockRecorder) CurrentHeader() *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) CurrentHeader() *MockChainHeaderReaderCurrentHeaderCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentHeader", reflect.TypeOf((*MockChainHeaderReader)(nil).CurrentHeader)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CurrentHeader", reflect.TypeOf((*MockChainHeaderReader)(nil).CurrentHeader)) + return &MockChainHeaderReaderCurrentHeaderCall{Call: call} +} + +// MockChainHeaderReaderCurrentHeaderCall wrap *gomock.Call +type MockChainHeaderReaderCurrentHeaderCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderCurrentHeaderCall) Return(arg0 *types.Header) *MockChainHeaderReaderCurrentHeaderCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderCurrentHeaderCall) Do(f func() *types.Header) *MockChainHeaderReaderCurrentHeaderCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderCurrentHeaderCall) DoAndReturn(f func() *types.Header) *MockChainHeaderReaderCurrentHeaderCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FrozenBlocks mocks base method. @@ -93,9 +165,33 @@ func (m *MockChainHeaderReader) FrozenBlocks() uint64 { } // FrozenBlocks indicates an expected call of FrozenBlocks. -func (mr *MockChainHeaderReaderMockRecorder) FrozenBlocks() *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) FrozenBlocks() *MockChainHeaderReaderFrozenBlocksCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FrozenBlocks", reflect.TypeOf((*MockChainHeaderReader)(nil).FrozenBlocks)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FrozenBlocks", reflect.TypeOf((*MockChainHeaderReader)(nil).FrozenBlocks)) + return &MockChainHeaderReaderFrozenBlocksCall{Call: call} +} + +// MockChainHeaderReaderFrozenBlocksCall wrap *gomock.Call +type MockChainHeaderReaderFrozenBlocksCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderFrozenBlocksCall) Return(arg0 uint64) *MockChainHeaderReaderFrozenBlocksCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderFrozenBlocksCall) Do(f func() uint64) *MockChainHeaderReaderFrozenBlocksCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderFrozenBlocksCall) DoAndReturn(f func() uint64) *MockChainHeaderReaderFrozenBlocksCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetHeader mocks base method. @@ -107,9 +203,33 @@ func (m *MockChainHeaderReader) GetHeader(arg0 common.Hash, arg1 uint64) *types. } // GetHeader indicates an expected call of GetHeader. -func (mr *MockChainHeaderReaderMockRecorder) GetHeader(arg0, arg1 any) *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) GetHeader(arg0, arg1 any) *MockChainHeaderReaderGetHeaderCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeader), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeader", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeader), arg0, arg1) + return &MockChainHeaderReaderGetHeaderCall{Call: call} +} + +// MockChainHeaderReaderGetHeaderCall wrap *gomock.Call +type MockChainHeaderReaderGetHeaderCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderGetHeaderCall) Return(arg0 *types.Header) *MockChainHeaderReaderGetHeaderCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderGetHeaderCall) Do(f func(common.Hash, uint64) *types.Header) *MockChainHeaderReaderGetHeaderCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderGetHeaderCall) DoAndReturn(f func(common.Hash, uint64) *types.Header) *MockChainHeaderReaderGetHeaderCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetHeaderByHash mocks base method. @@ -121,9 +241,33 @@ func (m *MockChainHeaderReader) GetHeaderByHash(arg0 common.Hash) *types.Header } // GetHeaderByHash indicates an expected call of GetHeaderByHash. -func (mr *MockChainHeaderReaderMockRecorder) GetHeaderByHash(arg0 any) *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) GetHeaderByHash(arg0 any) *MockChainHeaderReaderGetHeaderByHashCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByHash", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeaderByHash), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByHash", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeaderByHash), arg0) + return &MockChainHeaderReaderGetHeaderByHashCall{Call: call} +} + +// MockChainHeaderReaderGetHeaderByHashCall wrap *gomock.Call +type MockChainHeaderReaderGetHeaderByHashCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderGetHeaderByHashCall) Return(arg0 *types.Header) *MockChainHeaderReaderGetHeaderByHashCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderGetHeaderByHashCall) Do(f func(common.Hash) *types.Header) *MockChainHeaderReaderGetHeaderByHashCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderGetHeaderByHashCall) DoAndReturn(f func(common.Hash) *types.Header) *MockChainHeaderReaderGetHeaderByHashCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetHeaderByNumber mocks base method. @@ -135,9 +279,33 @@ func (m *MockChainHeaderReader) GetHeaderByNumber(arg0 uint64) *types.Header { } // GetHeaderByNumber indicates an expected call of GetHeaderByNumber. -func (mr *MockChainHeaderReaderMockRecorder) GetHeaderByNumber(arg0 any) *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) GetHeaderByNumber(arg0 any) *MockChainHeaderReaderGetHeaderByNumberCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByNumber", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeaderByNumber), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHeaderByNumber", reflect.TypeOf((*MockChainHeaderReader)(nil).GetHeaderByNumber), arg0) + return &MockChainHeaderReaderGetHeaderByNumberCall{Call: call} +} + +// MockChainHeaderReaderGetHeaderByNumberCall wrap *gomock.Call +type MockChainHeaderReaderGetHeaderByNumberCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderGetHeaderByNumberCall) Return(arg0 *types.Header) *MockChainHeaderReaderGetHeaderByNumberCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderGetHeaderByNumberCall) Do(f func(uint64) *types.Header) *MockChainHeaderReaderGetHeaderByNumberCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderGetHeaderByNumberCall) DoAndReturn(f func(uint64) *types.Header) *MockChainHeaderReaderGetHeaderByNumberCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetTd mocks base method. @@ -149,7 +317,31 @@ func (m *MockChainHeaderReader) GetTd(arg0 common.Hash, arg1 uint64) *big.Int { } // GetTd indicates an expected call of GetTd. -func (mr *MockChainHeaderReaderMockRecorder) GetTd(arg0, arg1 any) *gomock.Call { +func (mr *MockChainHeaderReaderMockRecorder) GetTd(arg0, arg1 any) *MockChainHeaderReaderGetTdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTd", reflect.TypeOf((*MockChainHeaderReader)(nil).GetTd), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTd", reflect.TypeOf((*MockChainHeaderReader)(nil).GetTd), arg0, arg1) + return &MockChainHeaderReaderGetTdCall{Call: call} +} + +// MockChainHeaderReaderGetTdCall wrap *gomock.Call +type MockChainHeaderReaderGetTdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockChainHeaderReaderGetTdCall) Return(arg0 *big.Int) *MockChainHeaderReaderGetTdCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockChainHeaderReaderGetTdCall) Do(f func(common.Hash, uint64) *big.Int) *MockChainHeaderReaderGetTdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockChainHeaderReaderGetTdCall) DoAndReturn(f func(common.Hash, uint64) *big.Int) *MockChainHeaderReaderGetTdCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/consensus/consensus.go b/consensus/consensus.go index 409eb20981c..334b7f85a1f 100644 --- a/consensus/consensus.go +++ b/consensus/consensus.go @@ -34,7 +34,7 @@ import ( // ChainHeaderReader defines a small collection of methods needed to access the local // blockchain during header verification. // -//go:generate mockgen -destination=./chain_header_reader_mock.go -package=consensus . ChainHeaderReader +//go:generate mockgen -typed=true -destination=./chain_header_reader_mock.go -package=consensus . ChainHeaderReader type ChainHeaderReader interface { // Config retrieves the blockchain's chain configuration. Config() *chain.Config diff --git a/erigon-lib/direct/sentry_client.go b/erigon-lib/direct/sentry_client.go index baab93d87a8..9655d062654 100644 --- a/erigon-lib/direct/sentry_client.go +++ b/erigon-lib/direct/sentry_client.go @@ -100,7 +100,7 @@ var ProtoIds = map[uint]map[sentry.MessageId]struct{}{ }, } -//go:generate mockgen -destination=./sentry_client_mock.go -package=direct . SentryClient +//go:generate mockgen -typed=true -destination=./sentry_client_mock.go -package=direct . SentryClient type SentryClient interface { sentry.SentryClient Protocol() uint diff --git a/erigon-lib/direct/sentry_client_mock.go b/erigon-lib/direct/sentry_client_mock.go index bc5ab2f3f46..3cf18f11298 100644 --- a/erigon-lib/direct/sentry_client_mock.go +++ b/erigon-lib/direct/sentry_client_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./sentry_client_mock.go -package=direct . SentryClient +// mockgen -typed=true -destination=./sentry_client_mock.go -package=direct . SentryClient // // Package direct is a generated GoMock package. @@ -57,10 +57,34 @@ func (m *MockSentryClient) AddPeer(arg0 context.Context, arg1 *sentry.AddPeerReq } // AddPeer indicates an expected call of AddPeer. -func (mr *MockSentryClientMockRecorder) AddPeer(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) AddPeer(arg0, arg1 any, arg2 ...any) *MockSentryClientAddPeerCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddPeer", reflect.TypeOf((*MockSentryClient)(nil).AddPeer), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AddPeer", reflect.TypeOf((*MockSentryClient)(nil).AddPeer), varargs...) + return &MockSentryClientAddPeerCall{Call: call} +} + +// MockSentryClientAddPeerCall wrap *gomock.Call +type MockSentryClientAddPeerCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientAddPeerCall) Return(arg0 *sentry.AddPeerReply, arg1 error) *MockSentryClientAddPeerCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientAddPeerCall) Do(f func(context.Context, *sentry.AddPeerRequest, ...grpc.CallOption) (*sentry.AddPeerReply, error)) *MockSentryClientAddPeerCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientAddPeerCall) DoAndReturn(f func(context.Context, *sentry.AddPeerRequest, ...grpc.CallOption) (*sentry.AddPeerReply, error)) *MockSentryClientAddPeerCall { + c.Call = c.Call.DoAndReturn(f) + return c } // HandShake mocks base method. @@ -77,10 +101,34 @@ func (m *MockSentryClient) HandShake(arg0 context.Context, arg1 *emptypb.Empty, } // HandShake indicates an expected call of HandShake. -func (mr *MockSentryClientMockRecorder) HandShake(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) HandShake(arg0, arg1 any, arg2 ...any) *MockSentryClientHandShakeCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandShake", reflect.TypeOf((*MockSentryClient)(nil).HandShake), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandShake", reflect.TypeOf((*MockSentryClient)(nil).HandShake), varargs...) + return &MockSentryClientHandShakeCall{Call: call} +} + +// MockSentryClientHandShakeCall wrap *gomock.Call +type MockSentryClientHandShakeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientHandShakeCall) Return(arg0 *sentry.HandShakeReply, arg1 error) *MockSentryClientHandShakeCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientHandShakeCall) Do(f func(context.Context, *emptypb.Empty, ...grpc.CallOption) (*sentry.HandShakeReply, error)) *MockSentryClientHandShakeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientHandShakeCall) DoAndReturn(f func(context.Context, *emptypb.Empty, ...grpc.CallOption) (*sentry.HandShakeReply, error)) *MockSentryClientHandShakeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MarkDisconnected mocks base method. @@ -90,9 +138,33 @@ func (m *MockSentryClient) MarkDisconnected() { } // MarkDisconnected indicates an expected call of MarkDisconnected. -func (mr *MockSentryClientMockRecorder) MarkDisconnected() *gomock.Call { +func (mr *MockSentryClientMockRecorder) MarkDisconnected() *MockSentryClientMarkDisconnectedCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkDisconnected", reflect.TypeOf((*MockSentryClient)(nil).MarkDisconnected)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MarkDisconnected", reflect.TypeOf((*MockSentryClient)(nil).MarkDisconnected)) + return &MockSentryClientMarkDisconnectedCall{Call: call} +} + +// MockSentryClientMarkDisconnectedCall wrap *gomock.Call +type MockSentryClientMarkDisconnectedCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientMarkDisconnectedCall) Return() *MockSentryClientMarkDisconnectedCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientMarkDisconnectedCall) Do(f func()) *MockSentryClientMarkDisconnectedCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientMarkDisconnectedCall) DoAndReturn(f func()) *MockSentryClientMarkDisconnectedCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Messages mocks base method. @@ -109,10 +181,34 @@ func (m *MockSentryClient) Messages(arg0 context.Context, arg1 *sentry.MessagesR } // Messages indicates an expected call of Messages. -func (mr *MockSentryClientMockRecorder) Messages(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) Messages(arg0, arg1 any, arg2 ...any) *MockSentryClientMessagesCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Messages", reflect.TypeOf((*MockSentryClient)(nil).Messages), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Messages", reflect.TypeOf((*MockSentryClient)(nil).Messages), varargs...) + return &MockSentryClientMessagesCall{Call: call} +} + +// MockSentryClientMessagesCall wrap *gomock.Call +type MockSentryClientMessagesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientMessagesCall) Return(arg0 sentry.Sentry_MessagesClient, arg1 error) *MockSentryClientMessagesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientMessagesCall) Do(f func(context.Context, *sentry.MessagesRequest, ...grpc.CallOption) (sentry.Sentry_MessagesClient, error)) *MockSentryClientMessagesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientMessagesCall) DoAndReturn(f func(context.Context, *sentry.MessagesRequest, ...grpc.CallOption) (sentry.Sentry_MessagesClient, error)) *MockSentryClientMessagesCall { + c.Call = c.Call.DoAndReturn(f) + return c } // NodeInfo mocks base method. @@ -129,10 +225,34 @@ func (m *MockSentryClient) NodeInfo(arg0 context.Context, arg1 *emptypb.Empty, a } // NodeInfo indicates an expected call of NodeInfo. -func (mr *MockSentryClientMockRecorder) NodeInfo(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) NodeInfo(arg0, arg1 any, arg2 ...any) *MockSentryClientNodeInfoCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeInfo", reflect.TypeOf((*MockSentryClient)(nil).NodeInfo), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NodeInfo", reflect.TypeOf((*MockSentryClient)(nil).NodeInfo), varargs...) + return &MockSentryClientNodeInfoCall{Call: call} +} + +// MockSentryClientNodeInfoCall wrap *gomock.Call +type MockSentryClientNodeInfoCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientNodeInfoCall) Return(arg0 *types.NodeInfoReply, arg1 error) *MockSentryClientNodeInfoCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientNodeInfoCall) Do(f func(context.Context, *emptypb.Empty, ...grpc.CallOption) (*types.NodeInfoReply, error)) *MockSentryClientNodeInfoCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientNodeInfoCall) DoAndReturn(f func(context.Context, *emptypb.Empty, ...grpc.CallOption) (*types.NodeInfoReply, error)) *MockSentryClientNodeInfoCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PeerById mocks base method. @@ -149,10 +269,34 @@ func (m *MockSentryClient) PeerById(arg0 context.Context, arg1 *sentry.PeerByIdR } // PeerById indicates an expected call of PeerById. -func (mr *MockSentryClientMockRecorder) PeerById(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) PeerById(arg0, arg1 any, arg2 ...any) *MockSentryClientPeerByIdCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerById", reflect.TypeOf((*MockSentryClient)(nil).PeerById), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerById", reflect.TypeOf((*MockSentryClient)(nil).PeerById), varargs...) + return &MockSentryClientPeerByIdCall{Call: call} +} + +// MockSentryClientPeerByIdCall wrap *gomock.Call +type MockSentryClientPeerByIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientPeerByIdCall) Return(arg0 *sentry.PeerByIdReply, arg1 error) *MockSentryClientPeerByIdCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientPeerByIdCall) Do(f func(context.Context, *sentry.PeerByIdRequest, ...grpc.CallOption) (*sentry.PeerByIdReply, error)) *MockSentryClientPeerByIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientPeerByIdCall) DoAndReturn(f func(context.Context, *sentry.PeerByIdRequest, ...grpc.CallOption) (*sentry.PeerByIdReply, error)) *MockSentryClientPeerByIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PeerCount mocks base method. @@ -169,10 +313,34 @@ func (m *MockSentryClient) PeerCount(arg0 context.Context, arg1 *sentry.PeerCoun } // PeerCount indicates an expected call of PeerCount. -func (mr *MockSentryClientMockRecorder) PeerCount(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) PeerCount(arg0, arg1 any, arg2 ...any) *MockSentryClientPeerCountCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerCount", reflect.TypeOf((*MockSentryClient)(nil).PeerCount), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerCount", reflect.TypeOf((*MockSentryClient)(nil).PeerCount), varargs...) + return &MockSentryClientPeerCountCall{Call: call} +} + +// MockSentryClientPeerCountCall wrap *gomock.Call +type MockSentryClientPeerCountCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientPeerCountCall) Return(arg0 *sentry.PeerCountReply, arg1 error) *MockSentryClientPeerCountCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientPeerCountCall) Do(f func(context.Context, *sentry.PeerCountRequest, ...grpc.CallOption) (*sentry.PeerCountReply, error)) *MockSentryClientPeerCountCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientPeerCountCall) DoAndReturn(f func(context.Context, *sentry.PeerCountRequest, ...grpc.CallOption) (*sentry.PeerCountReply, error)) *MockSentryClientPeerCountCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PeerEvents mocks base method. @@ -189,10 +357,34 @@ func (m *MockSentryClient) PeerEvents(arg0 context.Context, arg1 *sentry.PeerEve } // PeerEvents indicates an expected call of PeerEvents. -func (mr *MockSentryClientMockRecorder) PeerEvents(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) PeerEvents(arg0, arg1 any, arg2 ...any) *MockSentryClientPeerEventsCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerEvents", reflect.TypeOf((*MockSentryClient)(nil).PeerEvents), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerEvents", reflect.TypeOf((*MockSentryClient)(nil).PeerEvents), varargs...) + return &MockSentryClientPeerEventsCall{Call: call} +} + +// MockSentryClientPeerEventsCall wrap *gomock.Call +type MockSentryClientPeerEventsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientPeerEventsCall) Return(arg0 sentry.Sentry_PeerEventsClient, arg1 error) *MockSentryClientPeerEventsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientPeerEventsCall) Do(f func(context.Context, *sentry.PeerEventsRequest, ...grpc.CallOption) (sentry.Sentry_PeerEventsClient, error)) *MockSentryClientPeerEventsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientPeerEventsCall) DoAndReturn(f func(context.Context, *sentry.PeerEventsRequest, ...grpc.CallOption) (sentry.Sentry_PeerEventsClient, error)) *MockSentryClientPeerEventsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PeerMinBlock mocks base method. @@ -209,10 +401,34 @@ func (m *MockSentryClient) PeerMinBlock(arg0 context.Context, arg1 *sentry.PeerM } // PeerMinBlock indicates an expected call of PeerMinBlock. -func (mr *MockSentryClientMockRecorder) PeerMinBlock(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) PeerMinBlock(arg0, arg1 any, arg2 ...any) *MockSentryClientPeerMinBlockCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerMinBlock", reflect.TypeOf((*MockSentryClient)(nil).PeerMinBlock), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerMinBlock", reflect.TypeOf((*MockSentryClient)(nil).PeerMinBlock), varargs...) + return &MockSentryClientPeerMinBlockCall{Call: call} +} + +// MockSentryClientPeerMinBlockCall wrap *gomock.Call +type MockSentryClientPeerMinBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientPeerMinBlockCall) Return(arg0 *emptypb.Empty, arg1 error) *MockSentryClientPeerMinBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientPeerMinBlockCall) Do(f func(context.Context, *sentry.PeerMinBlockRequest, ...grpc.CallOption) (*emptypb.Empty, error)) *MockSentryClientPeerMinBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientPeerMinBlockCall) DoAndReturn(f func(context.Context, *sentry.PeerMinBlockRequest, ...grpc.CallOption) (*emptypb.Empty, error)) *MockSentryClientPeerMinBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Peers mocks base method. @@ -229,10 +445,34 @@ func (m *MockSentryClient) Peers(arg0 context.Context, arg1 *emptypb.Empty, arg2 } // Peers indicates an expected call of Peers. -func (mr *MockSentryClientMockRecorder) Peers(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) Peers(arg0, arg1 any, arg2 ...any) *MockSentryClientPeersCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockSentryClient)(nil).Peers), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockSentryClient)(nil).Peers), varargs...) + return &MockSentryClientPeersCall{Call: call} +} + +// MockSentryClientPeersCall wrap *gomock.Call +type MockSentryClientPeersCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientPeersCall) Return(arg0 *sentry.PeersReply, arg1 error) *MockSentryClientPeersCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientPeersCall) Do(f func(context.Context, *emptypb.Empty, ...grpc.CallOption) (*sentry.PeersReply, error)) *MockSentryClientPeersCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientPeersCall) DoAndReturn(f func(context.Context, *emptypb.Empty, ...grpc.CallOption) (*sentry.PeersReply, error)) *MockSentryClientPeersCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PenalizePeer mocks base method. @@ -249,10 +489,34 @@ func (m *MockSentryClient) PenalizePeer(arg0 context.Context, arg1 *sentry.Penal } // PenalizePeer indicates an expected call of PenalizePeer. -func (mr *MockSentryClientMockRecorder) PenalizePeer(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) PenalizePeer(arg0, arg1 any, arg2 ...any) *MockSentryClientPenalizePeerCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PenalizePeer", reflect.TypeOf((*MockSentryClient)(nil).PenalizePeer), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PenalizePeer", reflect.TypeOf((*MockSentryClient)(nil).PenalizePeer), varargs...) + return &MockSentryClientPenalizePeerCall{Call: call} +} + +// MockSentryClientPenalizePeerCall wrap *gomock.Call +type MockSentryClientPenalizePeerCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientPenalizePeerCall) Return(arg0 *emptypb.Empty, arg1 error) *MockSentryClientPenalizePeerCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientPenalizePeerCall) Do(f func(context.Context, *sentry.PenalizePeerRequest, ...grpc.CallOption) (*emptypb.Empty, error)) *MockSentryClientPenalizePeerCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientPenalizePeerCall) DoAndReturn(f func(context.Context, *sentry.PenalizePeerRequest, ...grpc.CallOption) (*emptypb.Empty, error)) *MockSentryClientPenalizePeerCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Protocol mocks base method. @@ -264,9 +528,33 @@ func (m *MockSentryClient) Protocol() uint { } // Protocol indicates an expected call of Protocol. -func (mr *MockSentryClientMockRecorder) Protocol() *gomock.Call { +func (mr *MockSentryClientMockRecorder) Protocol() *MockSentryClientProtocolCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Protocol", reflect.TypeOf((*MockSentryClient)(nil).Protocol)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Protocol", reflect.TypeOf((*MockSentryClient)(nil).Protocol)) + return &MockSentryClientProtocolCall{Call: call} +} + +// MockSentryClientProtocolCall wrap *gomock.Call +type MockSentryClientProtocolCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientProtocolCall) Return(arg0 uint) *MockSentryClientProtocolCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientProtocolCall) Do(f func() uint) *MockSentryClientProtocolCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientProtocolCall) DoAndReturn(f func() uint) *MockSentryClientProtocolCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Ready mocks base method. @@ -278,9 +566,33 @@ func (m *MockSentryClient) Ready() bool { } // Ready indicates an expected call of Ready. -func (mr *MockSentryClientMockRecorder) Ready() *gomock.Call { +func (mr *MockSentryClientMockRecorder) Ready() *MockSentryClientReadyCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ready", reflect.TypeOf((*MockSentryClient)(nil).Ready)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Ready", reflect.TypeOf((*MockSentryClient)(nil).Ready)) + return &MockSentryClientReadyCall{Call: call} +} + +// MockSentryClientReadyCall wrap *gomock.Call +type MockSentryClientReadyCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientReadyCall) Return(arg0 bool) *MockSentryClientReadyCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientReadyCall) Do(f func() bool) *MockSentryClientReadyCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientReadyCall) DoAndReturn(f func() bool) *MockSentryClientReadyCall { + c.Call = c.Call.DoAndReturn(f) + return c } // SendMessageById mocks base method. @@ -297,10 +609,34 @@ func (m *MockSentryClient) SendMessageById(arg0 context.Context, arg1 *sentry.Se } // SendMessageById indicates an expected call of SendMessageById. -func (mr *MockSentryClientMockRecorder) SendMessageById(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) SendMessageById(arg0, arg1 any, arg2 ...any) *MockSentryClientSendMessageByIdCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageById", reflect.TypeOf((*MockSentryClient)(nil).SendMessageById), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageById", reflect.TypeOf((*MockSentryClient)(nil).SendMessageById), varargs...) + return &MockSentryClientSendMessageByIdCall{Call: call} +} + +// MockSentryClientSendMessageByIdCall wrap *gomock.Call +type MockSentryClientSendMessageByIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientSendMessageByIdCall) Return(arg0 *sentry.SentPeers, arg1 error) *MockSentryClientSendMessageByIdCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientSendMessageByIdCall) Do(f func(context.Context, *sentry.SendMessageByIdRequest, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageByIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientSendMessageByIdCall) DoAndReturn(f func(context.Context, *sentry.SendMessageByIdRequest, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageByIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // SendMessageByMinBlock mocks base method. @@ -317,10 +653,34 @@ func (m *MockSentryClient) SendMessageByMinBlock(arg0 context.Context, arg1 *sen } // SendMessageByMinBlock indicates an expected call of SendMessageByMinBlock. -func (mr *MockSentryClientMockRecorder) SendMessageByMinBlock(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) SendMessageByMinBlock(arg0, arg1 any, arg2 ...any) *MockSentryClientSendMessageByMinBlockCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageByMinBlock", reflect.TypeOf((*MockSentryClient)(nil).SendMessageByMinBlock), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageByMinBlock", reflect.TypeOf((*MockSentryClient)(nil).SendMessageByMinBlock), varargs...) + return &MockSentryClientSendMessageByMinBlockCall{Call: call} +} + +// MockSentryClientSendMessageByMinBlockCall wrap *gomock.Call +type MockSentryClientSendMessageByMinBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientSendMessageByMinBlockCall) Return(arg0 *sentry.SentPeers, arg1 error) *MockSentryClientSendMessageByMinBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientSendMessageByMinBlockCall) Do(f func(context.Context, *sentry.SendMessageByMinBlockRequest, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageByMinBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientSendMessageByMinBlockCall) DoAndReturn(f func(context.Context, *sentry.SendMessageByMinBlockRequest, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageByMinBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // SendMessageToAll mocks base method. @@ -337,10 +697,34 @@ func (m *MockSentryClient) SendMessageToAll(arg0 context.Context, arg1 *sentry.O } // SendMessageToAll indicates an expected call of SendMessageToAll. -func (mr *MockSentryClientMockRecorder) SendMessageToAll(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) SendMessageToAll(arg0, arg1 any, arg2 ...any) *MockSentryClientSendMessageToAllCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageToAll", reflect.TypeOf((*MockSentryClient)(nil).SendMessageToAll), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageToAll", reflect.TypeOf((*MockSentryClient)(nil).SendMessageToAll), varargs...) + return &MockSentryClientSendMessageToAllCall{Call: call} +} + +// MockSentryClientSendMessageToAllCall wrap *gomock.Call +type MockSentryClientSendMessageToAllCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientSendMessageToAllCall) Return(arg0 *sentry.SentPeers, arg1 error) *MockSentryClientSendMessageToAllCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientSendMessageToAllCall) Do(f func(context.Context, *sentry.OutboundMessageData, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageToAllCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientSendMessageToAllCall) DoAndReturn(f func(context.Context, *sentry.OutboundMessageData, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageToAllCall { + c.Call = c.Call.DoAndReturn(f) + return c } // SendMessageToRandomPeers mocks base method. @@ -357,10 +741,34 @@ func (m *MockSentryClient) SendMessageToRandomPeers(arg0 context.Context, arg1 * } // SendMessageToRandomPeers indicates an expected call of SendMessageToRandomPeers. -func (mr *MockSentryClientMockRecorder) SendMessageToRandomPeers(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) SendMessageToRandomPeers(arg0, arg1 any, arg2 ...any) *MockSentryClientSendMessageToRandomPeersCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageToRandomPeers", reflect.TypeOf((*MockSentryClient)(nil).SendMessageToRandomPeers), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendMessageToRandomPeers", reflect.TypeOf((*MockSentryClient)(nil).SendMessageToRandomPeers), varargs...) + return &MockSentryClientSendMessageToRandomPeersCall{Call: call} +} + +// MockSentryClientSendMessageToRandomPeersCall wrap *gomock.Call +type MockSentryClientSendMessageToRandomPeersCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientSendMessageToRandomPeersCall) Return(arg0 *sentry.SentPeers, arg1 error) *MockSentryClientSendMessageToRandomPeersCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientSendMessageToRandomPeersCall) Do(f func(context.Context, *sentry.SendMessageToRandomPeersRequest, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageToRandomPeersCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientSendMessageToRandomPeersCall) DoAndReturn(f func(context.Context, *sentry.SendMessageToRandomPeersRequest, ...grpc.CallOption) (*sentry.SentPeers, error)) *MockSentryClientSendMessageToRandomPeersCall { + c.Call = c.Call.DoAndReturn(f) + return c } // SetStatus mocks base method. @@ -377,8 +785,32 @@ func (m *MockSentryClient) SetStatus(arg0 context.Context, arg1 *sentry.StatusDa } // SetStatus indicates an expected call of SetStatus. -func (mr *MockSentryClientMockRecorder) SetStatus(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockSentryClientMockRecorder) SetStatus(arg0, arg1 any, arg2 ...any) *MockSentryClientSetStatusCall { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStatus", reflect.TypeOf((*MockSentryClient)(nil).SetStatus), varargs...) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetStatus", reflect.TypeOf((*MockSentryClient)(nil).SetStatus), varargs...) + return &MockSentryClientSetStatusCall{Call: call} +} + +// MockSentryClientSetStatusCall wrap *gomock.Call +type MockSentryClientSetStatusCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSentryClientSetStatusCall) Return(arg0 *sentry.SetStatusReply, arg1 error) *MockSentryClientSetStatusCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSentryClientSetStatusCall) Do(f func(context.Context, *sentry.StatusData, ...grpc.CallOption) (*sentry.SetStatusReply, error)) *MockSentryClientSetStatusCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSentryClientSetStatusCall) DoAndReturn(f func(context.Context, *sentry.StatusData, ...grpc.CallOption) (*sentry.SetStatusReply, error)) *MockSentryClientSetStatusCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/erigon-lib/kv/remotedbserver/remotedbserver.go b/erigon-lib/kv/remotedbserver/remotedbserver.go index 3b07acda367..59f3b58e678 100644 --- a/erigon-lib/kv/remotedbserver/remotedbserver.go +++ b/erigon-lib/kv/remotedbserver/remotedbserver.go @@ -91,7 +91,7 @@ type threadSafeTx struct { sync.Mutex } -//go:generate mockgen -destination=./snapshots_mock.go -package=remotedbserver . Snapshots +//go:generate mockgen -typed=true -destination=./snapshots_mock.go -package=remotedbserver . Snapshots type Snapshots interface { Files() []string } diff --git a/erigon-lib/kv/remotedbserver/snapshots_mock.go b/erigon-lib/kv/remotedbserver/snapshots_mock.go index e6c489240ec..cdd66394fec 100644 --- a/erigon-lib/kv/remotedbserver/snapshots_mock.go +++ b/erigon-lib/kv/remotedbserver/snapshots_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./snapshots_mock.go -package=remotedbserver . Snapshots +// mockgen -typed=true -destination=./snapshots_mock.go -package=remotedbserver . Snapshots // // Package remotedbserver is a generated GoMock package. @@ -47,7 +47,31 @@ func (m *MockSnapshots) Files() []string { } // Files indicates an expected call of Files. -func (mr *MockSnapshotsMockRecorder) Files() *gomock.Call { +func (mr *MockSnapshotsMockRecorder) Files() *MockSnapshotsFilesCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Files", reflect.TypeOf((*MockSnapshots)(nil).Files)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Files", reflect.TypeOf((*MockSnapshots)(nil).Files)) + return &MockSnapshotsFilesCall{Call: call} +} + +// MockSnapshotsFilesCall wrap *gomock.Call +type MockSnapshotsFilesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSnapshotsFilesCall) Return(arg0 []string) *MockSnapshotsFilesCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSnapshotsFilesCall) Do(f func() []string) *MockSnapshotsFilesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSnapshotsFilesCall) DoAndReturn(f func() []string) *MockSnapshotsFilesCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/bor/spanner.go b/polygon/bor/spanner.go index eb98b2ea29d..6d895b283f1 100644 --- a/polygon/bor/spanner.go +++ b/polygon/bor/spanner.go @@ -16,7 +16,7 @@ import ( "github.com/ledgerwatch/erigon/rlp" ) -//go:generate mockgen -destination=./spanner_mock.go -package=bor . Spanner +//go:generate mockgen -typed=true -destination=./spanner_mock.go -package=bor . Spanner type Spanner interface { GetCurrentSpan(syscall consensus.SystemCall) (*heimdall.Span, error) GetCurrentValidators(spanId uint64, signer libcommon.Address, chain consensus.ChainHeaderReader) ([]*valset.Validator, error) diff --git a/polygon/bor/spanner_mock.go b/polygon/bor/spanner_mock.go index 2d10d6974e3..185ded6cc7c 100644 --- a/polygon/bor/spanner_mock.go +++ b/polygon/bor/spanner_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./spanner_mock.go -package=bor . Spanner +// mockgen -typed=true -destination=./spanner_mock.go -package=bor . Spanner // // Package bor is a generated GoMock package. @@ -51,9 +51,33 @@ func (m *MockSpanner) CommitSpan(arg0 heimdall.Span, arg1 consensus.SystemCall) } // CommitSpan indicates an expected call of CommitSpan. -func (mr *MockSpannerMockRecorder) CommitSpan(arg0, arg1 any) *gomock.Call { +func (mr *MockSpannerMockRecorder) CommitSpan(arg0, arg1 any) *MockSpannerCommitSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitSpan", reflect.TypeOf((*MockSpanner)(nil).CommitSpan), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CommitSpan", reflect.TypeOf((*MockSpanner)(nil).CommitSpan), arg0, arg1) + return &MockSpannerCommitSpanCall{Call: call} +} + +// MockSpannerCommitSpanCall wrap *gomock.Call +type MockSpannerCommitSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpannerCommitSpanCall) Return(arg0 error) *MockSpannerCommitSpanCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpannerCommitSpanCall) Do(f func(heimdall.Span, consensus.SystemCall) error) *MockSpannerCommitSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpannerCommitSpanCall) DoAndReturn(f func(heimdall.Span, consensus.SystemCall) error) *MockSpannerCommitSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetCurrentProducers mocks base method. @@ -66,9 +90,33 @@ func (m *MockSpanner) GetCurrentProducers(arg0 uint64, arg1 common.Address, arg2 } // GetCurrentProducers indicates an expected call of GetCurrentProducers. -func (mr *MockSpannerMockRecorder) GetCurrentProducers(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockSpannerMockRecorder) GetCurrentProducers(arg0, arg1, arg2 any) *MockSpannerGetCurrentProducersCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentProducers", reflect.TypeOf((*MockSpanner)(nil).GetCurrentProducers), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentProducers", reflect.TypeOf((*MockSpanner)(nil).GetCurrentProducers), arg0, arg1, arg2) + return &MockSpannerGetCurrentProducersCall{Call: call} +} + +// MockSpannerGetCurrentProducersCall wrap *gomock.Call +type MockSpannerGetCurrentProducersCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpannerGetCurrentProducersCall) Return(arg0 []*valset.Validator, arg1 error) *MockSpannerGetCurrentProducersCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpannerGetCurrentProducersCall) Do(f func(uint64, common.Address, consensus.ChainHeaderReader) ([]*valset.Validator, error)) *MockSpannerGetCurrentProducersCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpannerGetCurrentProducersCall) DoAndReturn(f func(uint64, common.Address, consensus.ChainHeaderReader) ([]*valset.Validator, error)) *MockSpannerGetCurrentProducersCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetCurrentSpan mocks base method. @@ -81,9 +129,33 @@ func (m *MockSpanner) GetCurrentSpan(arg0 consensus.SystemCall) (*heimdall.Span, } // GetCurrentSpan indicates an expected call of GetCurrentSpan. -func (mr *MockSpannerMockRecorder) GetCurrentSpan(arg0 any) *gomock.Call { +func (mr *MockSpannerMockRecorder) GetCurrentSpan(arg0 any) *MockSpannerGetCurrentSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSpan", reflect.TypeOf((*MockSpanner)(nil).GetCurrentSpan), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentSpan", reflect.TypeOf((*MockSpanner)(nil).GetCurrentSpan), arg0) + return &MockSpannerGetCurrentSpanCall{Call: call} +} + +// MockSpannerGetCurrentSpanCall wrap *gomock.Call +type MockSpannerGetCurrentSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpannerGetCurrentSpanCall) Return(arg0 *heimdall.Span, arg1 error) *MockSpannerGetCurrentSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpannerGetCurrentSpanCall) Do(f func(consensus.SystemCall) (*heimdall.Span, error)) *MockSpannerGetCurrentSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpannerGetCurrentSpanCall) DoAndReturn(f func(consensus.SystemCall) (*heimdall.Span, error)) *MockSpannerGetCurrentSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetCurrentValidators mocks base method. @@ -96,7 +168,31 @@ func (m *MockSpanner) GetCurrentValidators(arg0 uint64, arg1 common.Address, arg } // GetCurrentValidators indicates an expected call of GetCurrentValidators. -func (mr *MockSpannerMockRecorder) GetCurrentValidators(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockSpannerMockRecorder) GetCurrentValidators(arg0, arg1, arg2 any) *MockSpannerGetCurrentValidatorsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentValidators", reflect.TypeOf((*MockSpanner)(nil).GetCurrentValidators), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCurrentValidators", reflect.TypeOf((*MockSpanner)(nil).GetCurrentValidators), arg0, arg1, arg2) + return &MockSpannerGetCurrentValidatorsCall{Call: call} +} + +// MockSpannerGetCurrentValidatorsCall wrap *gomock.Call +type MockSpannerGetCurrentValidatorsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpannerGetCurrentValidatorsCall) Return(arg0 []*valset.Validator, arg1 error) *MockSpannerGetCurrentValidatorsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpannerGetCurrentValidatorsCall) Do(f func(uint64, common.Address, consensus.ChainHeaderReader) ([]*valset.Validator, error)) *MockSpannerGetCurrentValidatorsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpannerGetCurrentValidatorsCall) DoAndReturn(f func(uint64, common.Address, consensus.ChainHeaderReader) ([]*valset.Validator, error)) *MockSpannerGetCurrentValidatorsCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/heimdall/client.go b/polygon/heimdall/client.go index 3f495e3afcb..a5e659fba16 100644 --- a/polygon/heimdall/client.go +++ b/polygon/heimdall/client.go @@ -37,7 +37,7 @@ const ( maxRetries = 5 ) -//go:generate mockgen -destination=./client_mock.go -package=heimdall . HeimdallClient +//go:generate mockgen -typed=true -destination=./client_mock.go -package=heimdall . HeimdallClient type HeimdallClient interface { FetchStateSyncEvents(ctx context.Context, fromId uint64, to time.Time, limit int) ([]*EventRecordWithTime, error) FetchStateSyncEvent(ctx context.Context, id uint64) (*EventRecordWithTime, error) @@ -80,7 +80,7 @@ type Request struct { start time.Time } -//go:generate mockgen -destination=./http_client_mock.go -package=heimdall . HttpClient +//go:generate mockgen -typed=true -destination=./http_client_mock.go -package=heimdall . HttpClient type HttpClient interface { Do(req *http.Request) (*http.Response, error) CloseIdleConnections() diff --git a/polygon/heimdall/client_mock.go b/polygon/heimdall/client_mock.go index 35280dcb83c..7d3d81c2b06 100644 --- a/polygon/heimdall/client_mock.go +++ b/polygon/heimdall/client_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./client_mock.go -package=heimdall . HeimdallClient +// mockgen -typed=true -destination=./client_mock.go -package=heimdall . HeimdallClient // // Package heimdall is a generated GoMock package. @@ -47,9 +47,33 @@ func (m *MockHeimdallClient) Close() { } // Close indicates an expected call of Close. -func (mr *MockHeimdallClientMockRecorder) Close() *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) Close() *MockHeimdallClientCloseCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockHeimdallClient)(nil).Close)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Close", reflect.TypeOf((*MockHeimdallClient)(nil).Close)) + return &MockHeimdallClientCloseCall{Call: call} +} + +// MockHeimdallClientCloseCall wrap *gomock.Call +type MockHeimdallClientCloseCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientCloseCall) Return() *MockHeimdallClientCloseCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientCloseCall) Do(f func()) *MockHeimdallClientCloseCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientCloseCall) DoAndReturn(f func()) *MockHeimdallClientCloseCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchCheckpoint mocks base method. @@ -62,9 +86,33 @@ func (m *MockHeimdallClient) FetchCheckpoint(arg0 context.Context, arg1 int64) ( } // FetchCheckpoint indicates an expected call of FetchCheckpoint. -func (mr *MockHeimdallClientMockRecorder) FetchCheckpoint(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchCheckpoint(arg0, arg1 any) *MockHeimdallClientFetchCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoint", reflect.TypeOf((*MockHeimdallClient)(nil).FetchCheckpoint), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoint", reflect.TypeOf((*MockHeimdallClient)(nil).FetchCheckpoint), arg0, arg1) + return &MockHeimdallClientFetchCheckpointCall{Call: call} +} + +// MockHeimdallClientFetchCheckpointCall wrap *gomock.Call +type MockHeimdallClientFetchCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockHeimdallClientFetchCheckpointCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchCheckpointCall) Do(f func(context.Context, int64) (*Checkpoint, error)) *MockHeimdallClientFetchCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchCheckpointCall) DoAndReturn(f func(context.Context, int64) (*Checkpoint, error)) *MockHeimdallClientFetchCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchCheckpointCount mocks base method. @@ -77,9 +125,33 @@ func (m *MockHeimdallClient) FetchCheckpointCount(arg0 context.Context) (int64, } // FetchCheckpointCount indicates an expected call of FetchCheckpointCount. -func (mr *MockHeimdallClientMockRecorder) FetchCheckpointCount(arg0 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchCheckpointCount(arg0 any) *MockHeimdallClientFetchCheckpointCountCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpointCount", reflect.TypeOf((*MockHeimdallClient)(nil).FetchCheckpointCount), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpointCount", reflect.TypeOf((*MockHeimdallClient)(nil).FetchCheckpointCount), arg0) + return &MockHeimdallClientFetchCheckpointCountCall{Call: call} +} + +// MockHeimdallClientFetchCheckpointCountCall wrap *gomock.Call +type MockHeimdallClientFetchCheckpointCountCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchCheckpointCountCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchCheckpointCountCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchCheckpointCountCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchCheckpointCountCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchCheckpointCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchCheckpointCountCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchCheckpoints mocks base method. @@ -92,9 +164,33 @@ func (m *MockHeimdallClient) FetchCheckpoints(arg0 context.Context, arg1, arg2 u } // FetchCheckpoints indicates an expected call of FetchCheckpoints. -func (mr *MockHeimdallClientMockRecorder) FetchCheckpoints(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchCheckpoints(arg0, arg1, arg2 any) *MockHeimdallClientFetchCheckpointsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoints", reflect.TypeOf((*MockHeimdallClient)(nil).FetchCheckpoints), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoints", reflect.TypeOf((*MockHeimdallClient)(nil).FetchCheckpoints), arg0, arg1, arg2) + return &MockHeimdallClientFetchCheckpointsCall{Call: call} +} + +// MockHeimdallClientFetchCheckpointsCall wrap *gomock.Call +type MockHeimdallClientFetchCheckpointsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchCheckpointsCall) Return(arg0 Checkpoints, arg1 error) *MockHeimdallClientFetchCheckpointsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchCheckpointsCall) Do(f func(context.Context, uint64, uint64) (Checkpoints, error)) *MockHeimdallClientFetchCheckpointsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchCheckpointsCall) DoAndReturn(f func(context.Context, uint64, uint64) (Checkpoints, error)) *MockHeimdallClientFetchCheckpointsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchLastNoAckMilestone mocks base method. @@ -107,9 +203,33 @@ func (m *MockHeimdallClient) FetchLastNoAckMilestone(arg0 context.Context) (stri } // FetchLastNoAckMilestone indicates an expected call of FetchLastNoAckMilestone. -func (mr *MockHeimdallClientMockRecorder) FetchLastNoAckMilestone(arg0 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchLastNoAckMilestone(arg0 any) *MockHeimdallClientFetchLastNoAckMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLastNoAckMilestone", reflect.TypeOf((*MockHeimdallClient)(nil).FetchLastNoAckMilestone), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLastNoAckMilestone", reflect.TypeOf((*MockHeimdallClient)(nil).FetchLastNoAckMilestone), arg0) + return &MockHeimdallClientFetchLastNoAckMilestoneCall{Call: call} +} + +// MockHeimdallClientFetchLastNoAckMilestoneCall wrap *gomock.Call +type MockHeimdallClientFetchLastNoAckMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) Return(arg0 string, arg1 error) *MockHeimdallClientFetchLastNoAckMilestoneCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) Do(f func(context.Context) (string, error)) *MockHeimdallClientFetchLastNoAckMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchLastNoAckMilestoneCall) DoAndReturn(f func(context.Context) (string, error)) *MockHeimdallClientFetchLastNoAckMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchLatestSpan mocks base method. @@ -122,9 +242,33 @@ func (m *MockHeimdallClient) FetchLatestSpan(arg0 context.Context) (*Span, error } // FetchLatestSpan indicates an expected call of FetchLatestSpan. -func (mr *MockHeimdallClientMockRecorder) FetchLatestSpan(arg0 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchLatestSpan(arg0 any) *MockHeimdallClientFetchLatestSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLatestSpan", reflect.TypeOf((*MockHeimdallClient)(nil).FetchLatestSpan), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLatestSpan", reflect.TypeOf((*MockHeimdallClient)(nil).FetchLatestSpan), arg0) + return &MockHeimdallClientFetchLatestSpanCall{Call: call} +} + +// MockHeimdallClientFetchLatestSpanCall wrap *gomock.Call +type MockHeimdallClientFetchLatestSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchLatestSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallClientFetchLatestSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchLatestSpanCall) Do(f func(context.Context) (*Span, error)) *MockHeimdallClientFetchLatestSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchLatestSpanCall) DoAndReturn(f func(context.Context) (*Span, error)) *MockHeimdallClientFetchLatestSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchMilestone mocks base method. @@ -137,9 +281,33 @@ func (m *MockHeimdallClient) FetchMilestone(arg0 context.Context, arg1 int64) (* } // FetchMilestone indicates an expected call of FetchMilestone. -func (mr *MockHeimdallClientMockRecorder) FetchMilestone(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchMilestone(arg0, arg1 any) *MockHeimdallClientFetchMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestone", reflect.TypeOf((*MockHeimdallClient)(nil).FetchMilestone), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestone", reflect.TypeOf((*MockHeimdallClient)(nil).FetchMilestone), arg0, arg1) + return &MockHeimdallClientFetchMilestoneCall{Call: call} +} + +// MockHeimdallClientFetchMilestoneCall wrap *gomock.Call +type MockHeimdallClientFetchMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockHeimdallClientFetchMilestoneCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchMilestoneCall) Do(f func(context.Context, int64) (*Milestone, error)) *MockHeimdallClientFetchMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchMilestoneCall) DoAndReturn(f func(context.Context, int64) (*Milestone, error)) *MockHeimdallClientFetchMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchMilestoneCount mocks base method. @@ -152,9 +320,33 @@ func (m *MockHeimdallClient) FetchMilestoneCount(arg0 context.Context) (int64, e } // FetchMilestoneCount indicates an expected call of FetchMilestoneCount. -func (mr *MockHeimdallClientMockRecorder) FetchMilestoneCount(arg0 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchMilestoneCount(arg0 any) *MockHeimdallClientFetchMilestoneCountCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestoneCount", reflect.TypeOf((*MockHeimdallClient)(nil).FetchMilestoneCount), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestoneCount", reflect.TypeOf((*MockHeimdallClient)(nil).FetchMilestoneCount), arg0) + return &MockHeimdallClientFetchMilestoneCountCall{Call: call} +} + +// MockHeimdallClientFetchMilestoneCountCall wrap *gomock.Call +type MockHeimdallClientFetchMilestoneCountCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchMilestoneCountCall) Return(arg0 int64, arg1 error) *MockHeimdallClientFetchMilestoneCountCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchMilestoneCountCall) Do(f func(context.Context) (int64, error)) *MockHeimdallClientFetchMilestoneCountCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchMilestoneCountCall) DoAndReturn(f func(context.Context) (int64, error)) *MockHeimdallClientFetchMilestoneCountCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchMilestoneID mocks base method. @@ -166,9 +358,33 @@ func (m *MockHeimdallClient) FetchMilestoneID(arg0 context.Context, arg1 string) } // FetchMilestoneID indicates an expected call of FetchMilestoneID. -func (mr *MockHeimdallClientMockRecorder) FetchMilestoneID(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchMilestoneID(arg0, arg1 any) *MockHeimdallClientFetchMilestoneIDCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestoneID", reflect.TypeOf((*MockHeimdallClient)(nil).FetchMilestoneID), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestoneID", reflect.TypeOf((*MockHeimdallClient)(nil).FetchMilestoneID), arg0, arg1) + return &MockHeimdallClientFetchMilestoneIDCall{Call: call} +} + +// MockHeimdallClientFetchMilestoneIDCall wrap *gomock.Call +type MockHeimdallClientFetchMilestoneIDCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchMilestoneIDCall) Return(arg0 error) *MockHeimdallClientFetchMilestoneIDCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchMilestoneIDCall) Do(f func(context.Context, string) error) *MockHeimdallClientFetchMilestoneIDCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchMilestoneIDCall) DoAndReturn(f func(context.Context, string) error) *MockHeimdallClientFetchMilestoneIDCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchNoAckMilestone mocks base method. @@ -180,9 +396,33 @@ func (m *MockHeimdallClient) FetchNoAckMilestone(arg0 context.Context, arg1 stri } // FetchNoAckMilestone indicates an expected call of FetchNoAckMilestone. -func (mr *MockHeimdallClientMockRecorder) FetchNoAckMilestone(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchNoAckMilestone(arg0, arg1 any) *MockHeimdallClientFetchNoAckMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchNoAckMilestone", reflect.TypeOf((*MockHeimdallClient)(nil).FetchNoAckMilestone), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchNoAckMilestone", reflect.TypeOf((*MockHeimdallClient)(nil).FetchNoAckMilestone), arg0, arg1) + return &MockHeimdallClientFetchNoAckMilestoneCall{Call: call} +} + +// MockHeimdallClientFetchNoAckMilestoneCall wrap *gomock.Call +type MockHeimdallClientFetchNoAckMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchNoAckMilestoneCall) Return(arg0 error) *MockHeimdallClientFetchNoAckMilestoneCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchNoAckMilestoneCall) Do(f func(context.Context, string) error) *MockHeimdallClientFetchNoAckMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchNoAckMilestoneCall) DoAndReturn(f func(context.Context, string) error) *MockHeimdallClientFetchNoAckMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchSpan mocks base method. @@ -195,9 +435,33 @@ func (m *MockHeimdallClient) FetchSpan(arg0 context.Context, arg1 uint64) (*Span } // FetchSpan indicates an expected call of FetchSpan. -func (mr *MockHeimdallClientMockRecorder) FetchSpan(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchSpan(arg0, arg1 any) *MockHeimdallClientFetchSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpan", reflect.TypeOf((*MockHeimdallClient)(nil).FetchSpan), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpan", reflect.TypeOf((*MockHeimdallClient)(nil).FetchSpan), arg0, arg1) + return &MockHeimdallClientFetchSpanCall{Call: call} +} + +// MockHeimdallClientFetchSpanCall wrap *gomock.Call +type MockHeimdallClientFetchSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallClientFetchSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchSpanCall) Do(f func(context.Context, uint64) (*Span, error)) *MockHeimdallClientFetchSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchSpanCall) DoAndReturn(f func(context.Context, uint64) (*Span, error)) *MockHeimdallClientFetchSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchStateSyncEvent mocks base method. @@ -210,9 +474,33 @@ func (m *MockHeimdallClient) FetchStateSyncEvent(arg0 context.Context, arg1 uint } // FetchStateSyncEvent indicates an expected call of FetchStateSyncEvent. -func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvent(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvent(arg0, arg1 any) *MockHeimdallClientFetchStateSyncEventCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchStateSyncEvent", reflect.TypeOf((*MockHeimdallClient)(nil).FetchStateSyncEvent), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchStateSyncEvent", reflect.TypeOf((*MockHeimdallClient)(nil).FetchStateSyncEvent), arg0, arg1) + return &MockHeimdallClientFetchStateSyncEventCall{Call: call} +} + +// MockHeimdallClientFetchStateSyncEventCall wrap *gomock.Call +type MockHeimdallClientFetchStateSyncEventCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchStateSyncEventCall) Return(arg0 *EventRecordWithTime, arg1 error) *MockHeimdallClientFetchStateSyncEventCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchStateSyncEventCall) Do(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchStateSyncEventCall) DoAndReturn(f func(context.Context, uint64) (*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchStateSyncEvents mocks base method. @@ -225,7 +513,31 @@ func (m *MockHeimdallClient) FetchStateSyncEvents(arg0 context.Context, arg1 uin } // FetchStateSyncEvents indicates an expected call of FetchStateSyncEvents. -func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvents(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockHeimdallClientMockRecorder) FetchStateSyncEvents(arg0, arg1, arg2, arg3 any) *MockHeimdallClientFetchStateSyncEventsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchStateSyncEvents", reflect.TypeOf((*MockHeimdallClient)(nil).FetchStateSyncEvents), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchStateSyncEvents", reflect.TypeOf((*MockHeimdallClient)(nil).FetchStateSyncEvents), arg0, arg1, arg2, arg3) + return &MockHeimdallClientFetchStateSyncEventsCall{Call: call} +} + +// MockHeimdallClientFetchStateSyncEventsCall wrap *gomock.Call +type MockHeimdallClientFetchStateSyncEventsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallClientFetchStateSyncEventsCall) Return(arg0 []*EventRecordWithTime, arg1 error) *MockHeimdallClientFetchStateSyncEventsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallClientFetchStateSyncEventsCall) Do(f func(context.Context, uint64, time.Time, int) ([]*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallClientFetchStateSyncEventsCall) DoAndReturn(f func(context.Context, uint64, time.Time, int) ([]*EventRecordWithTime, error)) *MockHeimdallClientFetchStateSyncEventsCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/heimdall/heimdall.go b/polygon/heimdall/heimdall.go index fe7a58ef435..62ae01d60ca 100644 --- a/polygon/heimdall/heimdall.go +++ b/polygon/heimdall/heimdall.go @@ -13,7 +13,7 @@ import ( // Heimdall is a wrapper of Heimdall HTTP API // -//go:generate mockgen -destination=./heimdall_mock.go -package=heimdall . Heimdall +//go:generate mockgen -typed=true -destination=./heimdall_mock.go -package=heimdall . Heimdall type Heimdall interface { LastCheckpointId(ctx context.Context, store CheckpointStore) (CheckpointId, bool, error) LastMilestoneId(ctx context.Context, store MilestoneStore) (MilestoneId, bool, error) diff --git a/polygon/heimdall/heimdall_mock.go b/polygon/heimdall/heimdall_mock.go index c91159c2e02..421f5979dd5 100644 --- a/polygon/heimdall/heimdall_mock.go +++ b/polygon/heimdall/heimdall_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./heimdall_mock.go -package=heimdall . Heimdall +// mockgen -typed=true -destination=./heimdall_mock.go -package=heimdall . Heimdall // // Package heimdall is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockHeimdall) FetchCheckpoints(arg0 context.Context, arg1 CheckpointSto } // FetchCheckpoints indicates an expected call of FetchCheckpoints. -func (mr *MockHeimdallMockRecorder) FetchCheckpoints(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) FetchCheckpoints(arg0, arg1, arg2, arg3 any) *MockHeimdallFetchCheckpointsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoints", reflect.TypeOf((*MockHeimdall)(nil).FetchCheckpoints), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoints", reflect.TypeOf((*MockHeimdall)(nil).FetchCheckpoints), arg0, arg1, arg2, arg3) + return &MockHeimdallFetchCheckpointsCall{Call: call} +} + +// MockHeimdallFetchCheckpointsCall wrap *gomock.Call +type MockHeimdallFetchCheckpointsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallFetchCheckpointsCall) Return(arg0 []*Checkpoint, arg1 error) *MockHeimdallFetchCheckpointsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallFetchCheckpointsCall) Do(f func(context.Context, CheckpointStore, CheckpointId, CheckpointId) ([]*Checkpoint, error)) *MockHeimdallFetchCheckpointsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallFetchCheckpointsCall) DoAndReturn(f func(context.Context, CheckpointStore, CheckpointId, CheckpointId) ([]*Checkpoint, error)) *MockHeimdallFetchCheckpointsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchCheckpointsFromBlock mocks base method. @@ -64,9 +88,33 @@ func (m *MockHeimdall) FetchCheckpointsFromBlock(arg0 context.Context, arg1 Chec } // FetchCheckpointsFromBlock indicates an expected call of FetchCheckpointsFromBlock. -func (mr *MockHeimdallMockRecorder) FetchCheckpointsFromBlock(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) FetchCheckpointsFromBlock(arg0, arg1, arg2 any) *MockHeimdallFetchCheckpointsFromBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpointsFromBlock", reflect.TypeOf((*MockHeimdall)(nil).FetchCheckpointsFromBlock), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpointsFromBlock", reflect.TypeOf((*MockHeimdall)(nil).FetchCheckpointsFromBlock), arg0, arg1, arg2) + return &MockHeimdallFetchCheckpointsFromBlockCall{Call: call} +} + +// MockHeimdallFetchCheckpointsFromBlockCall wrap *gomock.Call +type MockHeimdallFetchCheckpointsFromBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallFetchCheckpointsFromBlockCall) Return(arg0 Waypoints, arg1 error) *MockHeimdallFetchCheckpointsFromBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallFetchCheckpointsFromBlockCall) Do(f func(context.Context, CheckpointStore, uint64) (Waypoints, error)) *MockHeimdallFetchCheckpointsFromBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallFetchCheckpointsFromBlockCall) DoAndReturn(f func(context.Context, CheckpointStore, uint64) (Waypoints, error)) *MockHeimdallFetchCheckpointsFromBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchLatestSpan mocks base method. @@ -79,9 +127,33 @@ func (m *MockHeimdall) FetchLatestSpan(arg0 context.Context, arg1 SpanStore) (*S } // FetchLatestSpan indicates an expected call of FetchLatestSpan. -func (mr *MockHeimdallMockRecorder) FetchLatestSpan(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) FetchLatestSpan(arg0, arg1 any) *MockHeimdallFetchLatestSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLatestSpan", reflect.TypeOf((*MockHeimdall)(nil).FetchLatestSpan), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLatestSpan", reflect.TypeOf((*MockHeimdall)(nil).FetchLatestSpan), arg0, arg1) + return &MockHeimdallFetchLatestSpanCall{Call: call} +} + +// MockHeimdallFetchLatestSpanCall wrap *gomock.Call +type MockHeimdallFetchLatestSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallFetchLatestSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallFetchLatestSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallFetchLatestSpanCall) Do(f func(context.Context, SpanStore) (*Span, error)) *MockHeimdallFetchLatestSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallFetchLatestSpanCall) DoAndReturn(f func(context.Context, SpanStore) (*Span, error)) *MockHeimdallFetchLatestSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchMilestones mocks base method. @@ -94,9 +166,33 @@ func (m *MockHeimdall) FetchMilestones(arg0 context.Context, arg1 MilestoneStore } // FetchMilestones indicates an expected call of FetchMilestones. -func (mr *MockHeimdallMockRecorder) FetchMilestones(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) FetchMilestones(arg0, arg1, arg2, arg3 any) *MockHeimdallFetchMilestonesCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestones", reflect.TypeOf((*MockHeimdall)(nil).FetchMilestones), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestones", reflect.TypeOf((*MockHeimdall)(nil).FetchMilestones), arg0, arg1, arg2, arg3) + return &MockHeimdallFetchMilestonesCall{Call: call} +} + +// MockHeimdallFetchMilestonesCall wrap *gomock.Call +type MockHeimdallFetchMilestonesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallFetchMilestonesCall) Return(arg0 []*Milestone, arg1 error) *MockHeimdallFetchMilestonesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallFetchMilestonesCall) Do(f func(context.Context, MilestoneStore, MilestoneId, MilestoneId) ([]*Milestone, error)) *MockHeimdallFetchMilestonesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallFetchMilestonesCall) DoAndReturn(f func(context.Context, MilestoneStore, MilestoneId, MilestoneId) ([]*Milestone, error)) *MockHeimdallFetchMilestonesCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchMilestonesFromBlock mocks base method. @@ -109,9 +205,33 @@ func (m *MockHeimdall) FetchMilestonesFromBlock(arg0 context.Context, arg1 Miles } // FetchMilestonesFromBlock indicates an expected call of FetchMilestonesFromBlock. -func (mr *MockHeimdallMockRecorder) FetchMilestonesFromBlock(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) FetchMilestonesFromBlock(arg0, arg1, arg2 any) *MockHeimdallFetchMilestonesFromBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestonesFromBlock", reflect.TypeOf((*MockHeimdall)(nil).FetchMilestonesFromBlock), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestonesFromBlock", reflect.TypeOf((*MockHeimdall)(nil).FetchMilestonesFromBlock), arg0, arg1, arg2) + return &MockHeimdallFetchMilestonesFromBlockCall{Call: call} +} + +// MockHeimdallFetchMilestonesFromBlockCall wrap *gomock.Call +type MockHeimdallFetchMilestonesFromBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallFetchMilestonesFromBlockCall) Return(arg0 Waypoints, arg1 error) *MockHeimdallFetchMilestonesFromBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallFetchMilestonesFromBlockCall) Do(f func(context.Context, MilestoneStore, uint64) (Waypoints, error)) *MockHeimdallFetchMilestonesFromBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallFetchMilestonesFromBlockCall) DoAndReturn(f func(context.Context, MilestoneStore, uint64) (Waypoints, error)) *MockHeimdallFetchMilestonesFromBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchSpans mocks base method. @@ -124,9 +244,33 @@ func (m *MockHeimdall) FetchSpans(arg0 context.Context, arg1 SpanStore, arg2, ar } // FetchSpans indicates an expected call of FetchSpans. -func (mr *MockHeimdallMockRecorder) FetchSpans(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) FetchSpans(arg0, arg1, arg2, arg3 any) *MockHeimdallFetchSpansCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpans", reflect.TypeOf((*MockHeimdall)(nil).FetchSpans), arg0, arg1, arg2, arg3) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpans", reflect.TypeOf((*MockHeimdall)(nil).FetchSpans), arg0, arg1, arg2, arg3) + return &MockHeimdallFetchSpansCall{Call: call} +} + +// MockHeimdallFetchSpansCall wrap *gomock.Call +type MockHeimdallFetchSpansCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallFetchSpansCall) Return(arg0 []*Span, arg1 error) *MockHeimdallFetchSpansCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallFetchSpansCall) Do(f func(context.Context, SpanStore, SpanId, SpanId) ([]*Span, error)) *MockHeimdallFetchSpansCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallFetchSpansCall) DoAndReturn(f func(context.Context, SpanStore, SpanId, SpanId) ([]*Span, error)) *MockHeimdallFetchSpansCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchSpansFromBlock mocks base method. @@ -139,9 +283,33 @@ func (m *MockHeimdall) FetchSpansFromBlock(arg0 context.Context, arg1 SpanStore, } // FetchSpansFromBlock indicates an expected call of FetchSpansFromBlock. -func (mr *MockHeimdallMockRecorder) FetchSpansFromBlock(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) FetchSpansFromBlock(arg0, arg1, arg2 any) *MockHeimdallFetchSpansFromBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpansFromBlock", reflect.TypeOf((*MockHeimdall)(nil).FetchSpansFromBlock), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpansFromBlock", reflect.TypeOf((*MockHeimdall)(nil).FetchSpansFromBlock), arg0, arg1, arg2) + return &MockHeimdallFetchSpansFromBlockCall{Call: call} +} + +// MockHeimdallFetchSpansFromBlockCall wrap *gomock.Call +type MockHeimdallFetchSpansFromBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallFetchSpansFromBlockCall) Return(arg0 []*Span, arg1 error) *MockHeimdallFetchSpansFromBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallFetchSpansFromBlockCall) Do(f func(context.Context, SpanStore, uint64) ([]*Span, error)) *MockHeimdallFetchSpansFromBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallFetchSpansFromBlockCall) DoAndReturn(f func(context.Context, SpanStore, uint64) ([]*Span, error)) *MockHeimdallFetchSpansFromBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastCheckpointId mocks base method. @@ -155,9 +323,33 @@ func (m *MockHeimdall) LastCheckpointId(arg0 context.Context, arg1 CheckpointSto } // LastCheckpointId indicates an expected call of LastCheckpointId. -func (mr *MockHeimdallMockRecorder) LastCheckpointId(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) LastCheckpointId(arg0, arg1 any) *MockHeimdallLastCheckpointIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockHeimdall)(nil).LastCheckpointId), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockHeimdall)(nil).LastCheckpointId), arg0, arg1) + return &MockHeimdallLastCheckpointIdCall{Call: call} +} + +// MockHeimdallLastCheckpointIdCall wrap *gomock.Call +type MockHeimdallLastCheckpointIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallLastCheckpointIdCall) Return(arg0 CheckpointId, arg1 bool, arg2 error) *MockHeimdallLastCheckpointIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallLastCheckpointIdCall) Do(f func(context.Context, CheckpointStore) (CheckpointId, bool, error)) *MockHeimdallLastCheckpointIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallLastCheckpointIdCall) DoAndReturn(f func(context.Context, CheckpointStore) (CheckpointId, bool, error)) *MockHeimdallLastCheckpointIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastMilestoneId mocks base method. @@ -171,9 +363,33 @@ func (m *MockHeimdall) LastMilestoneId(arg0 context.Context, arg1 MilestoneStore } // LastMilestoneId indicates an expected call of LastMilestoneId. -func (mr *MockHeimdallMockRecorder) LastMilestoneId(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) LastMilestoneId(arg0, arg1 any) *MockHeimdallLastMilestoneIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockHeimdall)(nil).LastMilestoneId), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockHeimdall)(nil).LastMilestoneId), arg0, arg1) + return &MockHeimdallLastMilestoneIdCall{Call: call} +} + +// MockHeimdallLastMilestoneIdCall wrap *gomock.Call +type MockHeimdallLastMilestoneIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallLastMilestoneIdCall) Return(arg0 MilestoneId, arg1 bool, arg2 error) *MockHeimdallLastMilestoneIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallLastMilestoneIdCall) Do(f func(context.Context, MilestoneStore) (MilestoneId, bool, error)) *MockHeimdallLastMilestoneIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallLastMilestoneIdCall) DoAndReturn(f func(context.Context, MilestoneStore) (MilestoneId, bool, error)) *MockHeimdallLastMilestoneIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastSpanId mocks base method. @@ -187,9 +403,33 @@ func (m *MockHeimdall) LastSpanId(arg0 context.Context, arg1 SpanStore) (SpanId, } // LastSpanId indicates an expected call of LastSpanId. -func (mr *MockHeimdallMockRecorder) LastSpanId(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) LastSpanId(arg0, arg1 any) *MockHeimdallLastSpanIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockHeimdall)(nil).LastSpanId), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockHeimdall)(nil).LastSpanId), arg0, arg1) + return &MockHeimdallLastSpanIdCall{Call: call} +} + +// MockHeimdallLastSpanIdCall wrap *gomock.Call +type MockHeimdallLastSpanIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallLastSpanIdCall) Return(arg0 SpanId, arg1 bool, arg2 error) *MockHeimdallLastSpanIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallLastSpanIdCall) Do(f func(context.Context, SpanStore) (SpanId, bool, error)) *MockHeimdallLastSpanIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallLastSpanIdCall) DoAndReturn(f func(context.Context, SpanStore) (SpanId, bool, error)) *MockHeimdallLastSpanIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // OnCheckpointEvent mocks base method. @@ -201,9 +441,33 @@ func (m *MockHeimdall) OnCheckpointEvent(arg0 context.Context, arg1 CheckpointSt } // OnCheckpointEvent indicates an expected call of OnCheckpointEvent. -func (mr *MockHeimdallMockRecorder) OnCheckpointEvent(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) OnCheckpointEvent(arg0, arg1, arg2 any) *MockHeimdallOnCheckpointEventCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnCheckpointEvent", reflect.TypeOf((*MockHeimdall)(nil).OnCheckpointEvent), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnCheckpointEvent", reflect.TypeOf((*MockHeimdall)(nil).OnCheckpointEvent), arg0, arg1, arg2) + return &MockHeimdallOnCheckpointEventCall{Call: call} +} + +// MockHeimdallOnCheckpointEventCall wrap *gomock.Call +type MockHeimdallOnCheckpointEventCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallOnCheckpointEventCall) Return(arg0 error) *MockHeimdallOnCheckpointEventCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallOnCheckpointEventCall) Do(f func(context.Context, CheckpointStore, func(*Checkpoint)) error) *MockHeimdallOnCheckpointEventCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallOnCheckpointEventCall) DoAndReturn(f func(context.Context, CheckpointStore, func(*Checkpoint)) error) *MockHeimdallOnCheckpointEventCall { + c.Call = c.Call.DoAndReturn(f) + return c } // OnMilestoneEvent mocks base method. @@ -215,9 +479,33 @@ func (m *MockHeimdall) OnMilestoneEvent(arg0 context.Context, arg1 MilestoneStor } // OnMilestoneEvent indicates an expected call of OnMilestoneEvent. -func (mr *MockHeimdallMockRecorder) OnMilestoneEvent(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) OnMilestoneEvent(arg0, arg1, arg2 any) *MockHeimdallOnMilestoneEventCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnMilestoneEvent", reflect.TypeOf((*MockHeimdall)(nil).OnMilestoneEvent), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnMilestoneEvent", reflect.TypeOf((*MockHeimdall)(nil).OnMilestoneEvent), arg0, arg1, arg2) + return &MockHeimdallOnMilestoneEventCall{Call: call} +} + +// MockHeimdallOnMilestoneEventCall wrap *gomock.Call +type MockHeimdallOnMilestoneEventCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallOnMilestoneEventCall) Return(arg0 error) *MockHeimdallOnMilestoneEventCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallOnMilestoneEventCall) Do(f func(context.Context, MilestoneStore, func(*Milestone)) error) *MockHeimdallOnMilestoneEventCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallOnMilestoneEventCall) DoAndReturn(f func(context.Context, MilestoneStore, func(*Milestone)) error) *MockHeimdallOnMilestoneEventCall { + c.Call = c.Call.DoAndReturn(f) + return c } // OnSpanEvent mocks base method. @@ -229,7 +517,31 @@ func (m *MockHeimdall) OnSpanEvent(arg0 context.Context, arg1 SpanStore, arg2 fu } // OnSpanEvent indicates an expected call of OnSpanEvent. -func (mr *MockHeimdallMockRecorder) OnSpanEvent(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallMockRecorder) OnSpanEvent(arg0, arg1, arg2 any) *MockHeimdallOnSpanEventCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnSpanEvent", reflect.TypeOf((*MockHeimdall)(nil).OnSpanEvent), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnSpanEvent", reflect.TypeOf((*MockHeimdall)(nil).OnSpanEvent), arg0, arg1, arg2) + return &MockHeimdallOnSpanEventCall{Call: call} +} + +// MockHeimdallOnSpanEventCall wrap *gomock.Call +type MockHeimdallOnSpanEventCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallOnSpanEventCall) Return(arg0 error) *MockHeimdallOnSpanEventCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallOnSpanEventCall) Do(f func(context.Context, SpanStore, func(*Span)) error) *MockHeimdallOnSpanEventCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallOnSpanEventCall) DoAndReturn(f func(context.Context, SpanStore, func(*Span)) error) *MockHeimdallOnSpanEventCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/heimdall/heimdall_no_store.go b/polygon/heimdall/heimdall_no_store.go index d0b26903167..a795952de18 100644 --- a/polygon/heimdall/heimdall_no_store.go +++ b/polygon/heimdall/heimdall_no_store.go @@ -6,7 +6,7 @@ import ( "github.com/ledgerwatch/log/v3" ) -//go:generate mockgen -destination=./heimdall_no_store_mock.go -package=heimdall . HeimdallNoStore +//go:generate mockgen -typed=true -destination=./heimdall_no_store_mock.go -package=heimdall . HeimdallNoStore type HeimdallNoStore interface { LastCheckpointId(ctx context.Context) (CheckpointId, bool, error) LastMilestoneId(ctx context.Context) (MilestoneId, bool, error) diff --git a/polygon/heimdall/heimdall_no_store_mock.go b/polygon/heimdall/heimdall_no_store_mock.go index 66d3c38705b..9cc8a9a4293 100644 --- a/polygon/heimdall/heimdall_no_store_mock.go +++ b/polygon/heimdall/heimdall_no_store_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./heimdall_no_store_mock.go -package=heimdall . HeimdallNoStore +// mockgen -typed=true -destination=./heimdall_no_store_mock.go -package=heimdall . HeimdallNoStore // // Package heimdall is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockHeimdallNoStore) FetchCheckpoints(arg0 context.Context, arg1, arg2 } // FetchCheckpoints indicates an expected call of FetchCheckpoints. -func (mr *MockHeimdallNoStoreMockRecorder) FetchCheckpoints(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) FetchCheckpoints(arg0, arg1, arg2 any) *MockHeimdallNoStoreFetchCheckpointsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoints", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchCheckpoints), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpoints", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchCheckpoints), arg0, arg1, arg2) + return &MockHeimdallNoStoreFetchCheckpointsCall{Call: call} +} + +// MockHeimdallNoStoreFetchCheckpointsCall wrap *gomock.Call +type MockHeimdallNoStoreFetchCheckpointsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreFetchCheckpointsCall) Return(arg0 []*Checkpoint, arg1 error) *MockHeimdallNoStoreFetchCheckpointsCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreFetchCheckpointsCall) Do(f func(context.Context, CheckpointId, CheckpointId) ([]*Checkpoint, error)) *MockHeimdallNoStoreFetchCheckpointsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreFetchCheckpointsCall) DoAndReturn(f func(context.Context, CheckpointId, CheckpointId) ([]*Checkpoint, error)) *MockHeimdallNoStoreFetchCheckpointsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchCheckpointsFromBlock mocks base method. @@ -64,9 +88,33 @@ func (m *MockHeimdallNoStore) FetchCheckpointsFromBlock(arg0 context.Context, ar } // FetchCheckpointsFromBlock indicates an expected call of FetchCheckpointsFromBlock. -func (mr *MockHeimdallNoStoreMockRecorder) FetchCheckpointsFromBlock(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) FetchCheckpointsFromBlock(arg0, arg1 any) *MockHeimdallNoStoreFetchCheckpointsFromBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpointsFromBlock", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchCheckpointsFromBlock), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchCheckpointsFromBlock", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchCheckpointsFromBlock), arg0, arg1) + return &MockHeimdallNoStoreFetchCheckpointsFromBlockCall{Call: call} +} + +// MockHeimdallNoStoreFetchCheckpointsFromBlockCall wrap *gomock.Call +type MockHeimdallNoStoreFetchCheckpointsFromBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreFetchCheckpointsFromBlockCall) Return(arg0 Waypoints, arg1 error) *MockHeimdallNoStoreFetchCheckpointsFromBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreFetchCheckpointsFromBlockCall) Do(f func(context.Context, uint64) (Waypoints, error)) *MockHeimdallNoStoreFetchCheckpointsFromBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreFetchCheckpointsFromBlockCall) DoAndReturn(f func(context.Context, uint64) (Waypoints, error)) *MockHeimdallNoStoreFetchCheckpointsFromBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchLatestSpan mocks base method. @@ -79,9 +127,33 @@ func (m *MockHeimdallNoStore) FetchLatestSpan(arg0 context.Context) (*Span, erro } // FetchLatestSpan indicates an expected call of FetchLatestSpan. -func (mr *MockHeimdallNoStoreMockRecorder) FetchLatestSpan(arg0 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) FetchLatestSpan(arg0 any) *MockHeimdallNoStoreFetchLatestSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLatestSpan", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchLatestSpan), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchLatestSpan", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchLatestSpan), arg0) + return &MockHeimdallNoStoreFetchLatestSpanCall{Call: call} +} + +// MockHeimdallNoStoreFetchLatestSpanCall wrap *gomock.Call +type MockHeimdallNoStoreFetchLatestSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreFetchLatestSpanCall) Return(arg0 *Span, arg1 error) *MockHeimdallNoStoreFetchLatestSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreFetchLatestSpanCall) Do(f func(context.Context) (*Span, error)) *MockHeimdallNoStoreFetchLatestSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreFetchLatestSpanCall) DoAndReturn(f func(context.Context) (*Span, error)) *MockHeimdallNoStoreFetchLatestSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchMilestones mocks base method. @@ -94,9 +166,33 @@ func (m *MockHeimdallNoStore) FetchMilestones(arg0 context.Context, arg1, arg2 M } // FetchMilestones indicates an expected call of FetchMilestones. -func (mr *MockHeimdallNoStoreMockRecorder) FetchMilestones(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) FetchMilestones(arg0, arg1, arg2 any) *MockHeimdallNoStoreFetchMilestonesCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestones", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchMilestones), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestones", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchMilestones), arg0, arg1, arg2) + return &MockHeimdallNoStoreFetchMilestonesCall{Call: call} +} + +// MockHeimdallNoStoreFetchMilestonesCall wrap *gomock.Call +type MockHeimdallNoStoreFetchMilestonesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreFetchMilestonesCall) Return(arg0 []*Milestone, arg1 error) *MockHeimdallNoStoreFetchMilestonesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreFetchMilestonesCall) Do(f func(context.Context, MilestoneId, MilestoneId) ([]*Milestone, error)) *MockHeimdallNoStoreFetchMilestonesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreFetchMilestonesCall) DoAndReturn(f func(context.Context, MilestoneId, MilestoneId) ([]*Milestone, error)) *MockHeimdallNoStoreFetchMilestonesCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchMilestonesFromBlock mocks base method. @@ -109,9 +205,33 @@ func (m *MockHeimdallNoStore) FetchMilestonesFromBlock(arg0 context.Context, arg } // FetchMilestonesFromBlock indicates an expected call of FetchMilestonesFromBlock. -func (mr *MockHeimdallNoStoreMockRecorder) FetchMilestonesFromBlock(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) FetchMilestonesFromBlock(arg0, arg1 any) *MockHeimdallNoStoreFetchMilestonesFromBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestonesFromBlock", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchMilestonesFromBlock), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchMilestonesFromBlock", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchMilestonesFromBlock), arg0, arg1) + return &MockHeimdallNoStoreFetchMilestonesFromBlockCall{Call: call} +} + +// MockHeimdallNoStoreFetchMilestonesFromBlockCall wrap *gomock.Call +type MockHeimdallNoStoreFetchMilestonesFromBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreFetchMilestonesFromBlockCall) Return(arg0 Waypoints, arg1 error) *MockHeimdallNoStoreFetchMilestonesFromBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreFetchMilestonesFromBlockCall) Do(f func(context.Context, uint64) (Waypoints, error)) *MockHeimdallNoStoreFetchMilestonesFromBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreFetchMilestonesFromBlockCall) DoAndReturn(f func(context.Context, uint64) (Waypoints, error)) *MockHeimdallNoStoreFetchMilestonesFromBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchSpans mocks base method. @@ -124,9 +244,33 @@ func (m *MockHeimdallNoStore) FetchSpans(arg0 context.Context, arg1, arg2 SpanId } // FetchSpans indicates an expected call of FetchSpans. -func (mr *MockHeimdallNoStoreMockRecorder) FetchSpans(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) FetchSpans(arg0, arg1, arg2 any) *MockHeimdallNoStoreFetchSpansCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpans", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchSpans), arg0, arg1, arg2) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpans", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchSpans), arg0, arg1, arg2) + return &MockHeimdallNoStoreFetchSpansCall{Call: call} +} + +// MockHeimdallNoStoreFetchSpansCall wrap *gomock.Call +type MockHeimdallNoStoreFetchSpansCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreFetchSpansCall) Return(arg0 []*Span, arg1 error) *MockHeimdallNoStoreFetchSpansCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreFetchSpansCall) Do(f func(context.Context, SpanId, SpanId) ([]*Span, error)) *MockHeimdallNoStoreFetchSpansCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreFetchSpansCall) DoAndReturn(f func(context.Context, SpanId, SpanId) ([]*Span, error)) *MockHeimdallNoStoreFetchSpansCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchSpansFromBlock mocks base method. @@ -139,9 +283,33 @@ func (m *MockHeimdallNoStore) FetchSpansFromBlock(arg0 context.Context, arg1 uin } // FetchSpansFromBlock indicates an expected call of FetchSpansFromBlock. -func (mr *MockHeimdallNoStoreMockRecorder) FetchSpansFromBlock(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) FetchSpansFromBlock(arg0, arg1 any) *MockHeimdallNoStoreFetchSpansFromBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpansFromBlock", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchSpansFromBlock), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchSpansFromBlock", reflect.TypeOf((*MockHeimdallNoStore)(nil).FetchSpansFromBlock), arg0, arg1) + return &MockHeimdallNoStoreFetchSpansFromBlockCall{Call: call} +} + +// MockHeimdallNoStoreFetchSpansFromBlockCall wrap *gomock.Call +type MockHeimdallNoStoreFetchSpansFromBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreFetchSpansFromBlockCall) Return(arg0 []*Span, arg1 error) *MockHeimdallNoStoreFetchSpansFromBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreFetchSpansFromBlockCall) Do(f func(context.Context, uint64) ([]*Span, error)) *MockHeimdallNoStoreFetchSpansFromBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreFetchSpansFromBlockCall) DoAndReturn(f func(context.Context, uint64) ([]*Span, error)) *MockHeimdallNoStoreFetchSpansFromBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastCheckpointId mocks base method. @@ -155,9 +323,33 @@ func (m *MockHeimdallNoStore) LastCheckpointId(arg0 context.Context) (Checkpoint } // LastCheckpointId indicates an expected call of LastCheckpointId. -func (mr *MockHeimdallNoStoreMockRecorder) LastCheckpointId(arg0 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) LastCheckpointId(arg0 any) *MockHeimdallNoStoreLastCheckpointIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockHeimdallNoStore)(nil).LastCheckpointId), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockHeimdallNoStore)(nil).LastCheckpointId), arg0) + return &MockHeimdallNoStoreLastCheckpointIdCall{Call: call} +} + +// MockHeimdallNoStoreLastCheckpointIdCall wrap *gomock.Call +type MockHeimdallNoStoreLastCheckpointIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreLastCheckpointIdCall) Return(arg0 CheckpointId, arg1 bool, arg2 error) *MockHeimdallNoStoreLastCheckpointIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreLastCheckpointIdCall) Do(f func(context.Context) (CheckpointId, bool, error)) *MockHeimdallNoStoreLastCheckpointIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreLastCheckpointIdCall) DoAndReturn(f func(context.Context) (CheckpointId, bool, error)) *MockHeimdallNoStoreLastCheckpointIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastMilestoneId mocks base method. @@ -171,9 +363,33 @@ func (m *MockHeimdallNoStore) LastMilestoneId(arg0 context.Context) (MilestoneId } // LastMilestoneId indicates an expected call of LastMilestoneId. -func (mr *MockHeimdallNoStoreMockRecorder) LastMilestoneId(arg0 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) LastMilestoneId(arg0 any) *MockHeimdallNoStoreLastMilestoneIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockHeimdallNoStore)(nil).LastMilestoneId), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockHeimdallNoStore)(nil).LastMilestoneId), arg0) + return &MockHeimdallNoStoreLastMilestoneIdCall{Call: call} +} + +// MockHeimdallNoStoreLastMilestoneIdCall wrap *gomock.Call +type MockHeimdallNoStoreLastMilestoneIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreLastMilestoneIdCall) Return(arg0 MilestoneId, arg1 bool, arg2 error) *MockHeimdallNoStoreLastMilestoneIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreLastMilestoneIdCall) Do(f func(context.Context) (MilestoneId, bool, error)) *MockHeimdallNoStoreLastMilestoneIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreLastMilestoneIdCall) DoAndReturn(f func(context.Context) (MilestoneId, bool, error)) *MockHeimdallNoStoreLastMilestoneIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastSpanId mocks base method. @@ -187,9 +403,33 @@ func (m *MockHeimdallNoStore) LastSpanId(arg0 context.Context) (SpanId, bool, er } // LastSpanId indicates an expected call of LastSpanId. -func (mr *MockHeimdallNoStoreMockRecorder) LastSpanId(arg0 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) LastSpanId(arg0 any) *MockHeimdallNoStoreLastSpanIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockHeimdallNoStore)(nil).LastSpanId), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockHeimdallNoStore)(nil).LastSpanId), arg0) + return &MockHeimdallNoStoreLastSpanIdCall{Call: call} +} + +// MockHeimdallNoStoreLastSpanIdCall wrap *gomock.Call +type MockHeimdallNoStoreLastSpanIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreLastSpanIdCall) Return(arg0 SpanId, arg1 bool, arg2 error) *MockHeimdallNoStoreLastSpanIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreLastSpanIdCall) Do(f func(context.Context) (SpanId, bool, error)) *MockHeimdallNoStoreLastSpanIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreLastSpanIdCall) DoAndReturn(f func(context.Context) (SpanId, bool, error)) *MockHeimdallNoStoreLastSpanIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // OnCheckpointEvent mocks base method. @@ -201,9 +441,33 @@ func (m *MockHeimdallNoStore) OnCheckpointEvent(arg0 context.Context, arg1 func( } // OnCheckpointEvent indicates an expected call of OnCheckpointEvent. -func (mr *MockHeimdallNoStoreMockRecorder) OnCheckpointEvent(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) OnCheckpointEvent(arg0, arg1 any) *MockHeimdallNoStoreOnCheckpointEventCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnCheckpointEvent", reflect.TypeOf((*MockHeimdallNoStore)(nil).OnCheckpointEvent), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnCheckpointEvent", reflect.TypeOf((*MockHeimdallNoStore)(nil).OnCheckpointEvent), arg0, arg1) + return &MockHeimdallNoStoreOnCheckpointEventCall{Call: call} +} + +// MockHeimdallNoStoreOnCheckpointEventCall wrap *gomock.Call +type MockHeimdallNoStoreOnCheckpointEventCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreOnCheckpointEventCall) Return(arg0 error) *MockHeimdallNoStoreOnCheckpointEventCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreOnCheckpointEventCall) Do(f func(context.Context, func(*Checkpoint)) error) *MockHeimdallNoStoreOnCheckpointEventCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreOnCheckpointEventCall) DoAndReturn(f func(context.Context, func(*Checkpoint)) error) *MockHeimdallNoStoreOnCheckpointEventCall { + c.Call = c.Call.DoAndReturn(f) + return c } // OnMilestoneEvent mocks base method. @@ -215,9 +479,33 @@ func (m *MockHeimdallNoStore) OnMilestoneEvent(arg0 context.Context, arg1 func(* } // OnMilestoneEvent indicates an expected call of OnMilestoneEvent. -func (mr *MockHeimdallNoStoreMockRecorder) OnMilestoneEvent(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) OnMilestoneEvent(arg0, arg1 any) *MockHeimdallNoStoreOnMilestoneEventCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnMilestoneEvent", reflect.TypeOf((*MockHeimdallNoStore)(nil).OnMilestoneEvent), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnMilestoneEvent", reflect.TypeOf((*MockHeimdallNoStore)(nil).OnMilestoneEvent), arg0, arg1) + return &MockHeimdallNoStoreOnMilestoneEventCall{Call: call} +} + +// MockHeimdallNoStoreOnMilestoneEventCall wrap *gomock.Call +type MockHeimdallNoStoreOnMilestoneEventCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreOnMilestoneEventCall) Return(arg0 error) *MockHeimdallNoStoreOnMilestoneEventCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreOnMilestoneEventCall) Do(f func(context.Context, func(*Milestone)) error) *MockHeimdallNoStoreOnMilestoneEventCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreOnMilestoneEventCall) DoAndReturn(f func(context.Context, func(*Milestone)) error) *MockHeimdallNoStoreOnMilestoneEventCall { + c.Call = c.Call.DoAndReturn(f) + return c } // OnSpanEvent mocks base method. @@ -229,7 +517,31 @@ func (m *MockHeimdallNoStore) OnSpanEvent(arg0 context.Context, arg1 func(*Span) } // OnSpanEvent indicates an expected call of OnSpanEvent. -func (mr *MockHeimdallNoStoreMockRecorder) OnSpanEvent(arg0, arg1 any) *gomock.Call { +func (mr *MockHeimdallNoStoreMockRecorder) OnSpanEvent(arg0, arg1 any) *MockHeimdallNoStoreOnSpanEventCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnSpanEvent", reflect.TypeOf((*MockHeimdallNoStore)(nil).OnSpanEvent), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnSpanEvent", reflect.TypeOf((*MockHeimdallNoStore)(nil).OnSpanEvent), arg0, arg1) + return &MockHeimdallNoStoreOnSpanEventCall{Call: call} +} + +// MockHeimdallNoStoreOnSpanEventCall wrap *gomock.Call +type MockHeimdallNoStoreOnSpanEventCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHeimdallNoStoreOnSpanEventCall) Return(arg0 error) *MockHeimdallNoStoreOnSpanEventCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHeimdallNoStoreOnSpanEventCall) Do(f func(context.Context, func(*Span)) error) *MockHeimdallNoStoreOnSpanEventCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHeimdallNoStoreOnSpanEventCall) DoAndReturn(f func(context.Context, func(*Span)) error) *MockHeimdallNoStoreOnSpanEventCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/heimdall/http_client_mock.go b/polygon/heimdall/http_client_mock.go index bd332b87f02..b62ff955323 100644 --- a/polygon/heimdall/http_client_mock.go +++ b/polygon/heimdall/http_client_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./http_client_mock.go -package=heimdall . HttpClient +// mockgen -typed=true -destination=./http_client_mock.go -package=heimdall . HttpClient // // Package heimdall is a generated GoMock package. @@ -46,9 +46,33 @@ func (m *MockHttpClient) CloseIdleConnections() { } // CloseIdleConnections indicates an expected call of CloseIdleConnections. -func (mr *MockHttpClientMockRecorder) CloseIdleConnections() *gomock.Call { +func (mr *MockHttpClientMockRecorder) CloseIdleConnections() *MockHttpClientCloseIdleConnectionsCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseIdleConnections", reflect.TypeOf((*MockHttpClient)(nil).CloseIdleConnections)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CloseIdleConnections", reflect.TypeOf((*MockHttpClient)(nil).CloseIdleConnections)) + return &MockHttpClientCloseIdleConnectionsCall{Call: call} +} + +// MockHttpClientCloseIdleConnectionsCall wrap *gomock.Call +type MockHttpClientCloseIdleConnectionsCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHttpClientCloseIdleConnectionsCall) Return() *MockHttpClientCloseIdleConnectionsCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHttpClientCloseIdleConnectionsCall) Do(f func()) *MockHttpClientCloseIdleConnectionsCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHttpClientCloseIdleConnectionsCall) DoAndReturn(f func()) *MockHttpClientCloseIdleConnectionsCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Do mocks base method. @@ -61,7 +85,31 @@ func (m *MockHttpClient) Do(arg0 *http.Request) (*http.Response, error) { } // Do indicates an expected call of Do. -func (mr *MockHttpClientMockRecorder) Do(arg0 any) *gomock.Call { +func (mr *MockHttpClientMockRecorder) Do(arg0 any) *MockHttpClientDoCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockHttpClient)(nil).Do), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Do", reflect.TypeOf((*MockHttpClient)(nil).Do), arg0) + return &MockHttpClientDoCall{Call: call} +} + +// MockHttpClientDoCall wrap *gomock.Call +type MockHttpClientDoCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockHttpClientDoCall) Return(arg0 *http.Response, arg1 error) *MockHttpClientDoCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockHttpClientDoCall) Do(f func(*http.Request) (*http.Response, error)) *MockHttpClientDoCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockHttpClientDoCall) DoAndReturn(f func(*http.Request) (*http.Response, error)) *MockHttpClientDoCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/heimdall/storage.go b/polygon/heimdall/storage.go index 479bd405725..5931fe13a28 100644 --- a/polygon/heimdall/storage.go +++ b/polygon/heimdall/storage.go @@ -11,7 +11,7 @@ import ( ) // Generate all mocks in file -//go:generate mockgen -destination=./storage_mock.go -package=heimdall -source=./storage.go +//go:generate mockgen -typed=true -destination=./storage_mock.go -package=heimdall -source=./storage.go type SpanReader interface { LastSpanId(ctx context.Context) (SpanId, bool, error) diff --git a/polygon/heimdall/storage_mock.go b/polygon/heimdall/storage_mock.go index f7c630d1ffd..1bae0ae2b2a 100644 --- a/polygon/heimdall/storage_mock.go +++ b/polygon/heimdall/storage_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./storage_mock.go -package=heimdall -source=./storage.go +// mockgen -typed=true -destination=./storage_mock.go -package=heimdall -source=./storage.go // // Package heimdall is a generated GoMock package. @@ -52,9 +52,33 @@ func (m *MockSpanReader) GetSpan(ctx context.Context, spanId SpanId) (*Span, err } // GetSpan indicates an expected call of GetSpan. -func (mr *MockSpanReaderMockRecorder) GetSpan(ctx, spanId any) *gomock.Call { +func (mr *MockSpanReaderMockRecorder) GetSpan(ctx, spanId any) *MockSpanReaderGetSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSpan", reflect.TypeOf((*MockSpanReader)(nil).GetSpan), ctx, spanId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSpan", reflect.TypeOf((*MockSpanReader)(nil).GetSpan), ctx, spanId) + return &MockSpanReaderGetSpanCall{Call: call} +} + +// MockSpanReaderGetSpanCall wrap *gomock.Call +type MockSpanReaderGetSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpanReaderGetSpanCall) Return(arg0 *Span, arg1 error) *MockSpanReaderGetSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpanReaderGetSpanCall) Do(f func(context.Context, SpanId) (*Span, error)) *MockSpanReaderGetSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpanReaderGetSpanCall) DoAndReturn(f func(context.Context, SpanId) (*Span, error)) *MockSpanReaderGetSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastSpanId mocks base method. @@ -68,9 +92,33 @@ func (m *MockSpanReader) LastSpanId(ctx context.Context) (SpanId, bool, error) { } // LastSpanId indicates an expected call of LastSpanId. -func (mr *MockSpanReaderMockRecorder) LastSpanId(ctx any) *gomock.Call { +func (mr *MockSpanReaderMockRecorder) LastSpanId(ctx any) *MockSpanReaderLastSpanIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockSpanReader)(nil).LastSpanId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockSpanReader)(nil).LastSpanId), ctx) + return &MockSpanReaderLastSpanIdCall{Call: call} +} + +// MockSpanReaderLastSpanIdCall wrap *gomock.Call +type MockSpanReaderLastSpanIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpanReaderLastSpanIdCall) Return(arg0 SpanId, arg1 bool, arg2 error) *MockSpanReaderLastSpanIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpanReaderLastSpanIdCall) Do(f func(context.Context) (SpanId, bool, error)) *MockSpanReaderLastSpanIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpanReaderLastSpanIdCall) DoAndReturn(f func(context.Context) (SpanId, bool, error)) *MockSpanReaderLastSpanIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockSpanWriter is a mock of SpanWriter interface. @@ -105,9 +153,33 @@ func (m *MockSpanWriter) PutSpan(ctx context.Context, span *Span) error { } // PutSpan indicates an expected call of PutSpan. -func (mr *MockSpanWriterMockRecorder) PutSpan(ctx, span any) *gomock.Call { +func (mr *MockSpanWriterMockRecorder) PutSpan(ctx, span any) *MockSpanWriterPutSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutSpan", reflect.TypeOf((*MockSpanWriter)(nil).PutSpan), ctx, span) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutSpan", reflect.TypeOf((*MockSpanWriter)(nil).PutSpan), ctx, span) + return &MockSpanWriterPutSpanCall{Call: call} +} + +// MockSpanWriterPutSpanCall wrap *gomock.Call +type MockSpanWriterPutSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpanWriterPutSpanCall) Return(arg0 error) *MockSpanWriterPutSpanCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpanWriterPutSpanCall) Do(f func(context.Context, *Span) error) *MockSpanWriterPutSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpanWriterPutSpanCall) DoAndReturn(f func(context.Context, *Span) error) *MockSpanWriterPutSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockSpanStore is a mock of SpanStore interface. @@ -143,9 +215,33 @@ func (m *MockSpanStore) GetSpan(ctx context.Context, spanId SpanId) (*Span, erro } // GetSpan indicates an expected call of GetSpan. -func (mr *MockSpanStoreMockRecorder) GetSpan(ctx, spanId any) *gomock.Call { +func (mr *MockSpanStoreMockRecorder) GetSpan(ctx, spanId any) *MockSpanStoreGetSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSpan", reflect.TypeOf((*MockSpanStore)(nil).GetSpan), ctx, spanId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSpan", reflect.TypeOf((*MockSpanStore)(nil).GetSpan), ctx, spanId) + return &MockSpanStoreGetSpanCall{Call: call} +} + +// MockSpanStoreGetSpanCall wrap *gomock.Call +type MockSpanStoreGetSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpanStoreGetSpanCall) Return(arg0 *Span, arg1 error) *MockSpanStoreGetSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpanStoreGetSpanCall) Do(f func(context.Context, SpanId) (*Span, error)) *MockSpanStoreGetSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpanStoreGetSpanCall) DoAndReturn(f func(context.Context, SpanId) (*Span, error)) *MockSpanStoreGetSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastSpanId mocks base method. @@ -159,9 +255,33 @@ func (m *MockSpanStore) LastSpanId(ctx context.Context) (SpanId, bool, error) { } // LastSpanId indicates an expected call of LastSpanId. -func (mr *MockSpanStoreMockRecorder) LastSpanId(ctx any) *gomock.Call { +func (mr *MockSpanStoreMockRecorder) LastSpanId(ctx any) *MockSpanStoreLastSpanIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockSpanStore)(nil).LastSpanId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockSpanStore)(nil).LastSpanId), ctx) + return &MockSpanStoreLastSpanIdCall{Call: call} +} + +// MockSpanStoreLastSpanIdCall wrap *gomock.Call +type MockSpanStoreLastSpanIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpanStoreLastSpanIdCall) Return(arg0 SpanId, arg1 bool, arg2 error) *MockSpanStoreLastSpanIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpanStoreLastSpanIdCall) Do(f func(context.Context) (SpanId, bool, error)) *MockSpanStoreLastSpanIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpanStoreLastSpanIdCall) DoAndReturn(f func(context.Context) (SpanId, bool, error)) *MockSpanStoreLastSpanIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutSpan mocks base method. @@ -173,9 +293,33 @@ func (m *MockSpanStore) PutSpan(ctx context.Context, span *Span) error { } // PutSpan indicates an expected call of PutSpan. -func (mr *MockSpanStoreMockRecorder) PutSpan(ctx, span any) *gomock.Call { +func (mr *MockSpanStoreMockRecorder) PutSpan(ctx, span any) *MockSpanStorePutSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutSpan", reflect.TypeOf((*MockSpanStore)(nil).PutSpan), ctx, span) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutSpan", reflect.TypeOf((*MockSpanStore)(nil).PutSpan), ctx, span) + return &MockSpanStorePutSpanCall{Call: call} +} + +// MockSpanStorePutSpanCall wrap *gomock.Call +type MockSpanStorePutSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockSpanStorePutSpanCall) Return(arg0 error) *MockSpanStorePutSpanCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockSpanStorePutSpanCall) Do(f func(context.Context, *Span) error) *MockSpanStorePutSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockSpanStorePutSpanCall) DoAndReturn(f func(context.Context, *Span) error) *MockSpanStorePutSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockMilestoneReader is a mock of MilestoneReader interface. @@ -211,9 +355,33 @@ func (m *MockMilestoneReader) GetMilestone(ctx context.Context, milestoneId Mile } // GetMilestone indicates an expected call of GetMilestone. -func (mr *MockMilestoneReaderMockRecorder) GetMilestone(ctx, milestoneId any) *gomock.Call { +func (mr *MockMilestoneReaderMockRecorder) GetMilestone(ctx, milestoneId any) *MockMilestoneReaderGetMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMilestone", reflect.TypeOf((*MockMilestoneReader)(nil).GetMilestone), ctx, milestoneId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMilestone", reflect.TypeOf((*MockMilestoneReader)(nil).GetMilestone), ctx, milestoneId) + return &MockMilestoneReaderGetMilestoneCall{Call: call} +} + +// MockMilestoneReaderGetMilestoneCall wrap *gomock.Call +type MockMilestoneReaderGetMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockMilestoneReaderGetMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockMilestoneReaderGetMilestoneCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockMilestoneReaderGetMilestoneCall) Do(f func(context.Context, MilestoneId) (*Milestone, error)) *MockMilestoneReaderGetMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockMilestoneReaderGetMilestoneCall) DoAndReturn(f func(context.Context, MilestoneId) (*Milestone, error)) *MockMilestoneReaderGetMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastMilestoneId mocks base method. @@ -227,9 +395,33 @@ func (m *MockMilestoneReader) LastMilestoneId(ctx context.Context) (MilestoneId, } // LastMilestoneId indicates an expected call of LastMilestoneId. -func (mr *MockMilestoneReaderMockRecorder) LastMilestoneId(ctx any) *gomock.Call { +func (mr *MockMilestoneReaderMockRecorder) LastMilestoneId(ctx any) *MockMilestoneReaderLastMilestoneIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockMilestoneReader)(nil).LastMilestoneId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockMilestoneReader)(nil).LastMilestoneId), ctx) + return &MockMilestoneReaderLastMilestoneIdCall{Call: call} +} + +// MockMilestoneReaderLastMilestoneIdCall wrap *gomock.Call +type MockMilestoneReaderLastMilestoneIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockMilestoneReaderLastMilestoneIdCall) Return(arg0 MilestoneId, arg1 bool, arg2 error) *MockMilestoneReaderLastMilestoneIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockMilestoneReaderLastMilestoneIdCall) Do(f func(context.Context) (MilestoneId, bool, error)) *MockMilestoneReaderLastMilestoneIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockMilestoneReaderLastMilestoneIdCall) DoAndReturn(f func(context.Context) (MilestoneId, bool, error)) *MockMilestoneReaderLastMilestoneIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockMilestoneWriter is a mock of MilestoneWriter interface. @@ -264,9 +456,33 @@ func (m *MockMilestoneWriter) PutMilestone(ctx context.Context, milestoneId Mile } // PutMilestone indicates an expected call of PutMilestone. -func (mr *MockMilestoneWriterMockRecorder) PutMilestone(ctx, milestoneId, milestone any) *gomock.Call { +func (mr *MockMilestoneWriterMockRecorder) PutMilestone(ctx, milestoneId, milestone any) *MockMilestoneWriterPutMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMilestone", reflect.TypeOf((*MockMilestoneWriter)(nil).PutMilestone), ctx, milestoneId, milestone) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMilestone", reflect.TypeOf((*MockMilestoneWriter)(nil).PutMilestone), ctx, milestoneId, milestone) + return &MockMilestoneWriterPutMilestoneCall{Call: call} +} + +// MockMilestoneWriterPutMilestoneCall wrap *gomock.Call +type MockMilestoneWriterPutMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockMilestoneWriterPutMilestoneCall) Return(arg0 error) *MockMilestoneWriterPutMilestoneCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockMilestoneWriterPutMilestoneCall) Do(f func(context.Context, MilestoneId, *Milestone) error) *MockMilestoneWriterPutMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockMilestoneWriterPutMilestoneCall) DoAndReturn(f func(context.Context, MilestoneId, *Milestone) error) *MockMilestoneWriterPutMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockMilestoneStore is a mock of MilestoneStore interface. @@ -302,9 +518,33 @@ func (m *MockMilestoneStore) GetMilestone(ctx context.Context, milestoneId Miles } // GetMilestone indicates an expected call of GetMilestone. -func (mr *MockMilestoneStoreMockRecorder) GetMilestone(ctx, milestoneId any) *gomock.Call { +func (mr *MockMilestoneStoreMockRecorder) GetMilestone(ctx, milestoneId any) *MockMilestoneStoreGetMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMilestone", reflect.TypeOf((*MockMilestoneStore)(nil).GetMilestone), ctx, milestoneId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMilestone", reflect.TypeOf((*MockMilestoneStore)(nil).GetMilestone), ctx, milestoneId) + return &MockMilestoneStoreGetMilestoneCall{Call: call} +} + +// MockMilestoneStoreGetMilestoneCall wrap *gomock.Call +type MockMilestoneStoreGetMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockMilestoneStoreGetMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockMilestoneStoreGetMilestoneCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockMilestoneStoreGetMilestoneCall) Do(f func(context.Context, MilestoneId) (*Milestone, error)) *MockMilestoneStoreGetMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockMilestoneStoreGetMilestoneCall) DoAndReturn(f func(context.Context, MilestoneId) (*Milestone, error)) *MockMilestoneStoreGetMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastMilestoneId mocks base method. @@ -318,9 +558,33 @@ func (m *MockMilestoneStore) LastMilestoneId(ctx context.Context) (MilestoneId, } // LastMilestoneId indicates an expected call of LastMilestoneId. -func (mr *MockMilestoneStoreMockRecorder) LastMilestoneId(ctx any) *gomock.Call { +func (mr *MockMilestoneStoreMockRecorder) LastMilestoneId(ctx any) *MockMilestoneStoreLastMilestoneIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockMilestoneStore)(nil).LastMilestoneId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockMilestoneStore)(nil).LastMilestoneId), ctx) + return &MockMilestoneStoreLastMilestoneIdCall{Call: call} +} + +// MockMilestoneStoreLastMilestoneIdCall wrap *gomock.Call +type MockMilestoneStoreLastMilestoneIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockMilestoneStoreLastMilestoneIdCall) Return(arg0 MilestoneId, arg1 bool, arg2 error) *MockMilestoneStoreLastMilestoneIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockMilestoneStoreLastMilestoneIdCall) Do(f func(context.Context) (MilestoneId, bool, error)) *MockMilestoneStoreLastMilestoneIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockMilestoneStoreLastMilestoneIdCall) DoAndReturn(f func(context.Context) (MilestoneId, bool, error)) *MockMilestoneStoreLastMilestoneIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutMilestone mocks base method. @@ -332,9 +596,33 @@ func (m *MockMilestoneStore) PutMilestone(ctx context.Context, milestoneId Miles } // PutMilestone indicates an expected call of PutMilestone. -func (mr *MockMilestoneStoreMockRecorder) PutMilestone(ctx, milestoneId, milestone any) *gomock.Call { +func (mr *MockMilestoneStoreMockRecorder) PutMilestone(ctx, milestoneId, milestone any) *MockMilestoneStorePutMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMilestone", reflect.TypeOf((*MockMilestoneStore)(nil).PutMilestone), ctx, milestoneId, milestone) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMilestone", reflect.TypeOf((*MockMilestoneStore)(nil).PutMilestone), ctx, milestoneId, milestone) + return &MockMilestoneStorePutMilestoneCall{Call: call} +} + +// MockMilestoneStorePutMilestoneCall wrap *gomock.Call +type MockMilestoneStorePutMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockMilestoneStorePutMilestoneCall) Return(arg0 error) *MockMilestoneStorePutMilestoneCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockMilestoneStorePutMilestoneCall) Do(f func(context.Context, MilestoneId, *Milestone) error) *MockMilestoneStorePutMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockMilestoneStorePutMilestoneCall) DoAndReturn(f func(context.Context, MilestoneId, *Milestone) error) *MockMilestoneStorePutMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockCheckpointReader is a mock of CheckpointReader interface. @@ -370,9 +658,33 @@ func (m *MockCheckpointReader) GetCheckpoint(ctx context.Context, checkpointId C } // GetCheckpoint indicates an expected call of GetCheckpoint. -func (mr *MockCheckpointReaderMockRecorder) GetCheckpoint(ctx, checkpointId any) *gomock.Call { +func (mr *MockCheckpointReaderMockRecorder) GetCheckpoint(ctx, checkpointId any) *MockCheckpointReaderGetCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckpoint", reflect.TypeOf((*MockCheckpointReader)(nil).GetCheckpoint), ctx, checkpointId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckpoint", reflect.TypeOf((*MockCheckpointReader)(nil).GetCheckpoint), ctx, checkpointId) + return &MockCheckpointReaderGetCheckpointCall{Call: call} +} + +// MockCheckpointReaderGetCheckpointCall wrap *gomock.Call +type MockCheckpointReaderGetCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCheckpointReaderGetCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockCheckpointReaderGetCheckpointCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCheckpointReaderGetCheckpointCall) Do(f func(context.Context, CheckpointId) (*Checkpoint, error)) *MockCheckpointReaderGetCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCheckpointReaderGetCheckpointCall) DoAndReturn(f func(context.Context, CheckpointId) (*Checkpoint, error)) *MockCheckpointReaderGetCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastCheckpointId mocks base method. @@ -386,9 +698,33 @@ func (m *MockCheckpointReader) LastCheckpointId(ctx context.Context) (Checkpoint } // LastCheckpointId indicates an expected call of LastCheckpointId. -func (mr *MockCheckpointReaderMockRecorder) LastCheckpointId(ctx any) *gomock.Call { +func (mr *MockCheckpointReaderMockRecorder) LastCheckpointId(ctx any) *MockCheckpointReaderLastCheckpointIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockCheckpointReader)(nil).LastCheckpointId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockCheckpointReader)(nil).LastCheckpointId), ctx) + return &MockCheckpointReaderLastCheckpointIdCall{Call: call} +} + +// MockCheckpointReaderLastCheckpointIdCall wrap *gomock.Call +type MockCheckpointReaderLastCheckpointIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCheckpointReaderLastCheckpointIdCall) Return(arg0 CheckpointId, arg1 bool, arg2 error) *MockCheckpointReaderLastCheckpointIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCheckpointReaderLastCheckpointIdCall) Do(f func(context.Context) (CheckpointId, bool, error)) *MockCheckpointReaderLastCheckpointIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCheckpointReaderLastCheckpointIdCall) DoAndReturn(f func(context.Context) (CheckpointId, bool, error)) *MockCheckpointReaderLastCheckpointIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockCheckpointWriter is a mock of CheckpointWriter interface. @@ -423,9 +759,33 @@ func (m *MockCheckpointWriter) PutCheckpoint(ctx context.Context, checkpointId C } // PutCheckpoint indicates an expected call of PutCheckpoint. -func (mr *MockCheckpointWriterMockRecorder) PutCheckpoint(ctx, checkpointId, checkpoint any) *gomock.Call { +func (mr *MockCheckpointWriterMockRecorder) PutCheckpoint(ctx, checkpointId, checkpoint any) *MockCheckpointWriterPutCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCheckpoint", reflect.TypeOf((*MockCheckpointWriter)(nil).PutCheckpoint), ctx, checkpointId, checkpoint) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCheckpoint", reflect.TypeOf((*MockCheckpointWriter)(nil).PutCheckpoint), ctx, checkpointId, checkpoint) + return &MockCheckpointWriterPutCheckpointCall{Call: call} +} + +// MockCheckpointWriterPutCheckpointCall wrap *gomock.Call +type MockCheckpointWriterPutCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCheckpointWriterPutCheckpointCall) Return(arg0 error) *MockCheckpointWriterPutCheckpointCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCheckpointWriterPutCheckpointCall) Do(f func(context.Context, CheckpointId, *Checkpoint) error) *MockCheckpointWriterPutCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCheckpointWriterPutCheckpointCall) DoAndReturn(f func(context.Context, CheckpointId, *Checkpoint) error) *MockCheckpointWriterPutCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockCheckpointStore is a mock of CheckpointStore interface. @@ -461,9 +821,33 @@ func (m *MockCheckpointStore) GetCheckpoint(ctx context.Context, checkpointId Ch } // GetCheckpoint indicates an expected call of GetCheckpoint. -func (mr *MockCheckpointStoreMockRecorder) GetCheckpoint(ctx, checkpointId any) *gomock.Call { +func (mr *MockCheckpointStoreMockRecorder) GetCheckpoint(ctx, checkpointId any) *MockCheckpointStoreGetCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckpoint", reflect.TypeOf((*MockCheckpointStore)(nil).GetCheckpoint), ctx, checkpointId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckpoint", reflect.TypeOf((*MockCheckpointStore)(nil).GetCheckpoint), ctx, checkpointId) + return &MockCheckpointStoreGetCheckpointCall{Call: call} +} + +// MockCheckpointStoreGetCheckpointCall wrap *gomock.Call +type MockCheckpointStoreGetCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCheckpointStoreGetCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockCheckpointStoreGetCheckpointCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCheckpointStoreGetCheckpointCall) Do(f func(context.Context, CheckpointId) (*Checkpoint, error)) *MockCheckpointStoreGetCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCheckpointStoreGetCheckpointCall) DoAndReturn(f func(context.Context, CheckpointId) (*Checkpoint, error)) *MockCheckpointStoreGetCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastCheckpointId mocks base method. @@ -477,9 +861,33 @@ func (m *MockCheckpointStore) LastCheckpointId(ctx context.Context) (CheckpointI } // LastCheckpointId indicates an expected call of LastCheckpointId. -func (mr *MockCheckpointStoreMockRecorder) LastCheckpointId(ctx any) *gomock.Call { +func (mr *MockCheckpointStoreMockRecorder) LastCheckpointId(ctx any) *MockCheckpointStoreLastCheckpointIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockCheckpointStore)(nil).LastCheckpointId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockCheckpointStore)(nil).LastCheckpointId), ctx) + return &MockCheckpointStoreLastCheckpointIdCall{Call: call} +} + +// MockCheckpointStoreLastCheckpointIdCall wrap *gomock.Call +type MockCheckpointStoreLastCheckpointIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCheckpointStoreLastCheckpointIdCall) Return(arg0 CheckpointId, arg1 bool, arg2 error) *MockCheckpointStoreLastCheckpointIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCheckpointStoreLastCheckpointIdCall) Do(f func(context.Context) (CheckpointId, bool, error)) *MockCheckpointStoreLastCheckpointIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCheckpointStoreLastCheckpointIdCall) DoAndReturn(f func(context.Context) (CheckpointId, bool, error)) *MockCheckpointStoreLastCheckpointIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutCheckpoint mocks base method. @@ -491,9 +899,33 @@ func (m *MockCheckpointStore) PutCheckpoint(ctx context.Context, checkpointId Ch } // PutCheckpoint indicates an expected call of PutCheckpoint. -func (mr *MockCheckpointStoreMockRecorder) PutCheckpoint(ctx, checkpointId, checkpoint any) *gomock.Call { +func (mr *MockCheckpointStoreMockRecorder) PutCheckpoint(ctx, checkpointId, checkpoint any) *MockCheckpointStorePutCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCheckpoint", reflect.TypeOf((*MockCheckpointStore)(nil).PutCheckpoint), ctx, checkpointId, checkpoint) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCheckpoint", reflect.TypeOf((*MockCheckpointStore)(nil).PutCheckpoint), ctx, checkpointId, checkpoint) + return &MockCheckpointStorePutCheckpointCall{Call: call} +} + +// MockCheckpointStorePutCheckpointCall wrap *gomock.Call +type MockCheckpointStorePutCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCheckpointStorePutCheckpointCall) Return(arg0 error) *MockCheckpointStorePutCheckpointCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCheckpointStorePutCheckpointCall) Do(f func(context.Context, CheckpointId, *Checkpoint) error) *MockCheckpointStorePutCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCheckpointStorePutCheckpointCall) DoAndReturn(f func(context.Context, CheckpointId, *Checkpoint) error) *MockCheckpointStorePutCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MockStore is a mock of Store interface. @@ -529,9 +961,33 @@ func (m *MockStore) GetCheckpoint(ctx context.Context, checkpointId CheckpointId } // GetCheckpoint indicates an expected call of GetCheckpoint. -func (mr *MockStoreMockRecorder) GetCheckpoint(ctx, checkpointId any) *gomock.Call { +func (mr *MockStoreMockRecorder) GetCheckpoint(ctx, checkpointId any) *MockStoreGetCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckpoint", reflect.TypeOf((*MockStore)(nil).GetCheckpoint), ctx, checkpointId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckpoint", reflect.TypeOf((*MockStore)(nil).GetCheckpoint), ctx, checkpointId) + return &MockStoreGetCheckpointCall{Call: call} +} + +// MockStoreGetCheckpointCall wrap *gomock.Call +type MockStoreGetCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStoreGetCheckpointCall) Return(arg0 *Checkpoint, arg1 error) *MockStoreGetCheckpointCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStoreGetCheckpointCall) Do(f func(context.Context, CheckpointId) (*Checkpoint, error)) *MockStoreGetCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStoreGetCheckpointCall) DoAndReturn(f func(context.Context, CheckpointId) (*Checkpoint, error)) *MockStoreGetCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetMilestone mocks base method. @@ -544,9 +1000,33 @@ func (m *MockStore) GetMilestone(ctx context.Context, milestoneId MilestoneId) ( } // GetMilestone indicates an expected call of GetMilestone. -func (mr *MockStoreMockRecorder) GetMilestone(ctx, milestoneId any) *gomock.Call { +func (mr *MockStoreMockRecorder) GetMilestone(ctx, milestoneId any) *MockStoreGetMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMilestone", reflect.TypeOf((*MockStore)(nil).GetMilestone), ctx, milestoneId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMilestone", reflect.TypeOf((*MockStore)(nil).GetMilestone), ctx, milestoneId) + return &MockStoreGetMilestoneCall{Call: call} +} + +// MockStoreGetMilestoneCall wrap *gomock.Call +type MockStoreGetMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStoreGetMilestoneCall) Return(arg0 *Milestone, arg1 error) *MockStoreGetMilestoneCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStoreGetMilestoneCall) Do(f func(context.Context, MilestoneId) (*Milestone, error)) *MockStoreGetMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStoreGetMilestoneCall) DoAndReturn(f func(context.Context, MilestoneId) (*Milestone, error)) *MockStoreGetMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // GetSpan mocks base method. @@ -559,9 +1039,33 @@ func (m *MockStore) GetSpan(ctx context.Context, spanId SpanId) (*Span, error) { } // GetSpan indicates an expected call of GetSpan. -func (mr *MockStoreMockRecorder) GetSpan(ctx, spanId any) *gomock.Call { +func (mr *MockStoreMockRecorder) GetSpan(ctx, spanId any) *MockStoreGetSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSpan", reflect.TypeOf((*MockStore)(nil).GetSpan), ctx, spanId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSpan", reflect.TypeOf((*MockStore)(nil).GetSpan), ctx, spanId) + return &MockStoreGetSpanCall{Call: call} +} + +// MockStoreGetSpanCall wrap *gomock.Call +type MockStoreGetSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStoreGetSpanCall) Return(arg0 *Span, arg1 error) *MockStoreGetSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStoreGetSpanCall) Do(f func(context.Context, SpanId) (*Span, error)) *MockStoreGetSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStoreGetSpanCall) DoAndReturn(f func(context.Context, SpanId) (*Span, error)) *MockStoreGetSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastCheckpointId mocks base method. @@ -575,9 +1079,33 @@ func (m *MockStore) LastCheckpointId(ctx context.Context) (CheckpointId, bool, e } // LastCheckpointId indicates an expected call of LastCheckpointId. -func (mr *MockStoreMockRecorder) LastCheckpointId(ctx any) *gomock.Call { +func (mr *MockStoreMockRecorder) LastCheckpointId(ctx any) *MockStoreLastCheckpointIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockStore)(nil).LastCheckpointId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*MockStore)(nil).LastCheckpointId), ctx) + return &MockStoreLastCheckpointIdCall{Call: call} +} + +// MockStoreLastCheckpointIdCall wrap *gomock.Call +type MockStoreLastCheckpointIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStoreLastCheckpointIdCall) Return(arg0 CheckpointId, arg1 bool, arg2 error) *MockStoreLastCheckpointIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStoreLastCheckpointIdCall) Do(f func(context.Context) (CheckpointId, bool, error)) *MockStoreLastCheckpointIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStoreLastCheckpointIdCall) DoAndReturn(f func(context.Context) (CheckpointId, bool, error)) *MockStoreLastCheckpointIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastMilestoneId mocks base method. @@ -591,9 +1119,33 @@ func (m *MockStore) LastMilestoneId(ctx context.Context) (MilestoneId, bool, err } // LastMilestoneId indicates an expected call of LastMilestoneId. -func (mr *MockStoreMockRecorder) LastMilestoneId(ctx any) *gomock.Call { +func (mr *MockStoreMockRecorder) LastMilestoneId(ctx any) *MockStoreLastMilestoneIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockStore)(nil).LastMilestoneId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*MockStore)(nil).LastMilestoneId), ctx) + return &MockStoreLastMilestoneIdCall{Call: call} +} + +// MockStoreLastMilestoneIdCall wrap *gomock.Call +type MockStoreLastMilestoneIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStoreLastMilestoneIdCall) Return(arg0 MilestoneId, arg1 bool, arg2 error) *MockStoreLastMilestoneIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStoreLastMilestoneIdCall) Do(f func(context.Context) (MilestoneId, bool, error)) *MockStoreLastMilestoneIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStoreLastMilestoneIdCall) DoAndReturn(f func(context.Context) (MilestoneId, bool, error)) *MockStoreLastMilestoneIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastSpanId mocks base method. @@ -607,9 +1159,33 @@ func (m *MockStore) LastSpanId(ctx context.Context) (SpanId, bool, error) { } // LastSpanId indicates an expected call of LastSpanId. -func (mr *MockStoreMockRecorder) LastSpanId(ctx any) *gomock.Call { +func (mr *MockStoreMockRecorder) LastSpanId(ctx any) *MockStoreLastSpanIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockStore)(nil).LastSpanId), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*MockStore)(nil).LastSpanId), ctx) + return &MockStoreLastSpanIdCall{Call: call} +} + +// MockStoreLastSpanIdCall wrap *gomock.Call +type MockStoreLastSpanIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStoreLastSpanIdCall) Return(arg0 SpanId, arg1 bool, arg2 error) *MockStoreLastSpanIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStoreLastSpanIdCall) Do(f func(context.Context) (SpanId, bool, error)) *MockStoreLastSpanIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStoreLastSpanIdCall) DoAndReturn(f func(context.Context) (SpanId, bool, error)) *MockStoreLastSpanIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutCheckpoint mocks base method. @@ -621,9 +1197,33 @@ func (m *MockStore) PutCheckpoint(ctx context.Context, checkpointId CheckpointId } // PutCheckpoint indicates an expected call of PutCheckpoint. -func (mr *MockStoreMockRecorder) PutCheckpoint(ctx, checkpointId, checkpoint any) *gomock.Call { +func (mr *MockStoreMockRecorder) PutCheckpoint(ctx, checkpointId, checkpoint any) *MockStorePutCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCheckpoint", reflect.TypeOf((*MockStore)(nil).PutCheckpoint), ctx, checkpointId, checkpoint) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutCheckpoint", reflect.TypeOf((*MockStore)(nil).PutCheckpoint), ctx, checkpointId, checkpoint) + return &MockStorePutCheckpointCall{Call: call} +} + +// MockStorePutCheckpointCall wrap *gomock.Call +type MockStorePutCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorePutCheckpointCall) Return(arg0 error) *MockStorePutCheckpointCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorePutCheckpointCall) Do(f func(context.Context, CheckpointId, *Checkpoint) error) *MockStorePutCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorePutCheckpointCall) DoAndReturn(f func(context.Context, CheckpointId, *Checkpoint) error) *MockStorePutCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutMilestone mocks base method. @@ -635,9 +1235,33 @@ func (m *MockStore) PutMilestone(ctx context.Context, milestoneId MilestoneId, m } // PutMilestone indicates an expected call of PutMilestone. -func (mr *MockStoreMockRecorder) PutMilestone(ctx, milestoneId, milestone any) *gomock.Call { +func (mr *MockStoreMockRecorder) PutMilestone(ctx, milestoneId, milestone any) *MockStorePutMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMilestone", reflect.TypeOf((*MockStore)(nil).PutMilestone), ctx, milestoneId, milestone) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutMilestone", reflect.TypeOf((*MockStore)(nil).PutMilestone), ctx, milestoneId, milestone) + return &MockStorePutMilestoneCall{Call: call} +} + +// MockStorePutMilestoneCall wrap *gomock.Call +type MockStorePutMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorePutMilestoneCall) Return(arg0 error) *MockStorePutMilestoneCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorePutMilestoneCall) Do(f func(context.Context, MilestoneId, *Milestone) error) *MockStorePutMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorePutMilestoneCall) DoAndReturn(f func(context.Context, MilestoneId, *Milestone) error) *MockStorePutMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PutSpan mocks base method. @@ -649,9 +1273,33 @@ func (m *MockStore) PutSpan(ctx context.Context, span *Span) error { } // PutSpan indicates an expected call of PutSpan. -func (mr *MockStoreMockRecorder) PutSpan(ctx, span any) *gomock.Call { +func (mr *MockStoreMockRecorder) PutSpan(ctx, span any) *MockStorePutSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutSpan", reflect.TypeOf((*MockStore)(nil).PutSpan), ctx, span) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PutSpan", reflect.TypeOf((*MockStore)(nil).PutSpan), ctx, span) + return &MockStorePutSpanCall{Call: call} +} + +// MockStorePutSpanCall wrap *gomock.Call +type MockStorePutSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorePutSpanCall) Return(arg0 error) *MockStorePutSpanCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorePutSpanCall) Do(f func(context.Context, *Span) error) *MockStorePutSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorePutSpanCall) DoAndReturn(f func(context.Context, *Span) error) *MockStorePutSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Mockreader is a mock of reader interface. @@ -687,9 +1335,33 @@ func (m *Mockreader) BorStartEventID(ctx context.Context, tx kv.Tx, hash common. } // BorStartEventID indicates an expected call of BorStartEventID. -func (mr *MockreaderMockRecorder) BorStartEventID(ctx, tx, hash, blockNum any) *gomock.Call { +func (mr *MockreaderMockRecorder) BorStartEventID(ctx, tx, hash, blockNum any) *MockreaderBorStartEventIDCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BorStartEventID", reflect.TypeOf((*Mockreader)(nil).BorStartEventID), ctx, tx, hash, blockNum) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BorStartEventID", reflect.TypeOf((*Mockreader)(nil).BorStartEventID), ctx, tx, hash, blockNum) + return &MockreaderBorStartEventIDCall{Call: call} +} + +// MockreaderBorStartEventIDCall wrap *gomock.Call +type MockreaderBorStartEventIDCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderBorStartEventIDCall) Return(arg0 uint64, arg1 error) *MockreaderBorStartEventIDCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderBorStartEventIDCall) Do(f func(context.Context, kv.Tx, common.Hash, uint64) (uint64, error)) *MockreaderBorStartEventIDCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderBorStartEventIDCall) DoAndReturn(f func(context.Context, kv.Tx, common.Hash, uint64) (uint64, error)) *MockreaderBorStartEventIDCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Checkpoint mocks base method. @@ -702,9 +1374,33 @@ func (m *Mockreader) Checkpoint(ctx context.Context, tx kv.Getter, checkpointId } // Checkpoint indicates an expected call of Checkpoint. -func (mr *MockreaderMockRecorder) Checkpoint(ctx, tx, checkpointId any) *gomock.Call { +func (mr *MockreaderMockRecorder) Checkpoint(ctx, tx, checkpointId any) *MockreaderCheckpointCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Checkpoint", reflect.TypeOf((*Mockreader)(nil).Checkpoint), ctx, tx, checkpointId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Checkpoint", reflect.TypeOf((*Mockreader)(nil).Checkpoint), ctx, tx, checkpointId) + return &MockreaderCheckpointCall{Call: call} +} + +// MockreaderCheckpointCall wrap *gomock.Call +type MockreaderCheckpointCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderCheckpointCall) Return(arg0 []byte, arg1 error) *MockreaderCheckpointCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderCheckpointCall) Do(f func(context.Context, kv.Getter, uint64) ([]byte, error)) *MockreaderCheckpointCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderCheckpointCall) DoAndReturn(f func(context.Context, kv.Getter, uint64) ([]byte, error)) *MockreaderCheckpointCall { + c.Call = c.Call.DoAndReturn(f) + return c } // EventLookup mocks base method. @@ -718,9 +1414,33 @@ func (m *Mockreader) EventLookup(ctx context.Context, tx kv.Getter, txnHash comm } // EventLookup indicates an expected call of EventLookup. -func (mr *MockreaderMockRecorder) EventLookup(ctx, tx, txnHash any) *gomock.Call { +func (mr *MockreaderMockRecorder) EventLookup(ctx, tx, txnHash any) *MockreaderEventLookupCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventLookup", reflect.TypeOf((*Mockreader)(nil).EventLookup), ctx, tx, txnHash) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventLookup", reflect.TypeOf((*Mockreader)(nil).EventLookup), ctx, tx, txnHash) + return &MockreaderEventLookupCall{Call: call} +} + +// MockreaderEventLookupCall wrap *gomock.Call +type MockreaderEventLookupCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderEventLookupCall) Return(arg0 uint64, arg1 bool, arg2 error) *MockreaderEventLookupCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderEventLookupCall) Do(f func(context.Context, kv.Getter, common.Hash) (uint64, bool, error)) *MockreaderEventLookupCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderEventLookupCall) DoAndReturn(f func(context.Context, kv.Getter, common.Hash) (uint64, bool, error)) *MockreaderEventLookupCall { + c.Call = c.Call.DoAndReturn(f) + return c } // EventsByBlock mocks base method. @@ -733,9 +1453,33 @@ func (m *Mockreader) EventsByBlock(ctx context.Context, tx kv.Tx, hash common.Ha } // EventsByBlock indicates an expected call of EventsByBlock. -func (mr *MockreaderMockRecorder) EventsByBlock(ctx, tx, hash, blockNum any) *gomock.Call { +func (mr *MockreaderMockRecorder) EventsByBlock(ctx, tx, hash, blockNum any) *MockreaderEventsByBlockCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventsByBlock", reflect.TypeOf((*Mockreader)(nil).EventsByBlock), ctx, tx, hash, blockNum) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventsByBlock", reflect.TypeOf((*Mockreader)(nil).EventsByBlock), ctx, tx, hash, blockNum) + return &MockreaderEventsByBlockCall{Call: call} +} + +// MockreaderEventsByBlockCall wrap *gomock.Call +type MockreaderEventsByBlockCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderEventsByBlockCall) Return(arg0 []rlp.RawValue, arg1 error) *MockreaderEventsByBlockCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderEventsByBlockCall) Do(f func(context.Context, kv.Tx, common.Hash, uint64) ([]rlp.RawValue, error)) *MockreaderEventsByBlockCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderEventsByBlockCall) DoAndReturn(f func(context.Context, kv.Tx, common.Hash, uint64) ([]rlp.RawValue, error)) *MockreaderEventsByBlockCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastCheckpointId mocks base method. @@ -749,9 +1493,33 @@ func (m *Mockreader) LastCheckpointId(ctx context.Context, tx kv.Tx) (uint64, bo } // LastCheckpointId indicates an expected call of LastCheckpointId. -func (mr *MockreaderMockRecorder) LastCheckpointId(ctx, tx any) *gomock.Call { +func (mr *MockreaderMockRecorder) LastCheckpointId(ctx, tx any) *MockreaderLastCheckpointIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*Mockreader)(nil).LastCheckpointId), ctx, tx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastCheckpointId", reflect.TypeOf((*Mockreader)(nil).LastCheckpointId), ctx, tx) + return &MockreaderLastCheckpointIdCall{Call: call} +} + +// MockreaderLastCheckpointIdCall wrap *gomock.Call +type MockreaderLastCheckpointIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderLastCheckpointIdCall) Return(arg0 uint64, arg1 bool, arg2 error) *MockreaderLastCheckpointIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderLastCheckpointIdCall) Do(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastCheckpointIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderLastCheckpointIdCall) DoAndReturn(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastCheckpointIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastEventId mocks base method. @@ -765,9 +1533,33 @@ func (m *Mockreader) LastEventId(ctx context.Context, tx kv.Tx) (uint64, bool, e } // LastEventId indicates an expected call of LastEventId. -func (mr *MockreaderMockRecorder) LastEventId(ctx, tx any) *gomock.Call { +func (mr *MockreaderMockRecorder) LastEventId(ctx, tx any) *MockreaderLastEventIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastEventId", reflect.TypeOf((*Mockreader)(nil).LastEventId), ctx, tx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastEventId", reflect.TypeOf((*Mockreader)(nil).LastEventId), ctx, tx) + return &MockreaderLastEventIdCall{Call: call} +} + +// MockreaderLastEventIdCall wrap *gomock.Call +type MockreaderLastEventIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderLastEventIdCall) Return(arg0 uint64, arg1 bool, arg2 error) *MockreaderLastEventIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderLastEventIdCall) Do(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastEventIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderLastEventIdCall) DoAndReturn(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastEventIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastFrozenEventId mocks base method. @@ -779,9 +1571,33 @@ func (m *Mockreader) LastFrozenEventId() uint64 { } // LastFrozenEventId indicates an expected call of LastFrozenEventId. -func (mr *MockreaderMockRecorder) LastFrozenEventId() *gomock.Call { +func (mr *MockreaderMockRecorder) LastFrozenEventId() *MockreaderLastFrozenEventIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFrozenEventId", reflect.TypeOf((*Mockreader)(nil).LastFrozenEventId)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFrozenEventId", reflect.TypeOf((*Mockreader)(nil).LastFrozenEventId)) + return &MockreaderLastFrozenEventIdCall{Call: call} +} + +// MockreaderLastFrozenEventIdCall wrap *gomock.Call +type MockreaderLastFrozenEventIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderLastFrozenEventIdCall) Return(arg0 uint64) *MockreaderLastFrozenEventIdCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderLastFrozenEventIdCall) Do(f func() uint64) *MockreaderLastFrozenEventIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderLastFrozenEventIdCall) DoAndReturn(f func() uint64) *MockreaderLastFrozenEventIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastFrozenSpanId mocks base method. @@ -793,9 +1609,33 @@ func (m *Mockreader) LastFrozenSpanId() uint64 { } // LastFrozenSpanId indicates an expected call of LastFrozenSpanId. -func (mr *MockreaderMockRecorder) LastFrozenSpanId() *gomock.Call { +func (mr *MockreaderMockRecorder) LastFrozenSpanId() *MockreaderLastFrozenSpanIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFrozenSpanId", reflect.TypeOf((*Mockreader)(nil).LastFrozenSpanId)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastFrozenSpanId", reflect.TypeOf((*Mockreader)(nil).LastFrozenSpanId)) + return &MockreaderLastFrozenSpanIdCall{Call: call} +} + +// MockreaderLastFrozenSpanIdCall wrap *gomock.Call +type MockreaderLastFrozenSpanIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderLastFrozenSpanIdCall) Return(arg0 uint64) *MockreaderLastFrozenSpanIdCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderLastFrozenSpanIdCall) Do(f func() uint64) *MockreaderLastFrozenSpanIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderLastFrozenSpanIdCall) DoAndReturn(f func() uint64) *MockreaderLastFrozenSpanIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastMilestoneId mocks base method. @@ -809,9 +1649,33 @@ func (m *Mockreader) LastMilestoneId(ctx context.Context, tx kv.Tx) (uint64, boo } // LastMilestoneId indicates an expected call of LastMilestoneId. -func (mr *MockreaderMockRecorder) LastMilestoneId(ctx, tx any) *gomock.Call { +func (mr *MockreaderMockRecorder) LastMilestoneId(ctx, tx any) *MockreaderLastMilestoneIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*Mockreader)(nil).LastMilestoneId), ctx, tx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastMilestoneId", reflect.TypeOf((*Mockreader)(nil).LastMilestoneId), ctx, tx) + return &MockreaderLastMilestoneIdCall{Call: call} +} + +// MockreaderLastMilestoneIdCall wrap *gomock.Call +type MockreaderLastMilestoneIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderLastMilestoneIdCall) Return(arg0 uint64, arg1 bool, arg2 error) *MockreaderLastMilestoneIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderLastMilestoneIdCall) Do(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastMilestoneIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderLastMilestoneIdCall) DoAndReturn(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastMilestoneIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // LastSpanId mocks base method. @@ -825,9 +1689,33 @@ func (m *Mockreader) LastSpanId(ctx context.Context, tx kv.Tx) (uint64, bool, er } // LastSpanId indicates an expected call of LastSpanId. -func (mr *MockreaderMockRecorder) LastSpanId(ctx, tx any) *gomock.Call { +func (mr *MockreaderMockRecorder) LastSpanId(ctx, tx any) *MockreaderLastSpanIdCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*Mockreader)(nil).LastSpanId), ctx, tx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LastSpanId", reflect.TypeOf((*Mockreader)(nil).LastSpanId), ctx, tx) + return &MockreaderLastSpanIdCall{Call: call} +} + +// MockreaderLastSpanIdCall wrap *gomock.Call +type MockreaderLastSpanIdCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderLastSpanIdCall) Return(arg0 uint64, arg1 bool, arg2 error) *MockreaderLastSpanIdCall { + c.Call = c.Call.Return(arg0, arg1, arg2) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderLastSpanIdCall) Do(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastSpanIdCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderLastSpanIdCall) DoAndReturn(f func(context.Context, kv.Tx) (uint64, bool, error)) *MockreaderLastSpanIdCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Milestone mocks base method. @@ -840,9 +1728,33 @@ func (m *Mockreader) Milestone(ctx context.Context, tx kv.Getter, milestoneId ui } // Milestone indicates an expected call of Milestone. -func (mr *MockreaderMockRecorder) Milestone(ctx, tx, milestoneId any) *gomock.Call { +func (mr *MockreaderMockRecorder) Milestone(ctx, tx, milestoneId any) *MockreaderMilestoneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Milestone", reflect.TypeOf((*Mockreader)(nil).Milestone), ctx, tx, milestoneId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Milestone", reflect.TypeOf((*Mockreader)(nil).Milestone), ctx, tx, milestoneId) + return &MockreaderMilestoneCall{Call: call} +} + +// MockreaderMilestoneCall wrap *gomock.Call +type MockreaderMilestoneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderMilestoneCall) Return(arg0 []byte, arg1 error) *MockreaderMilestoneCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderMilestoneCall) Do(f func(context.Context, kv.Getter, uint64) ([]byte, error)) *MockreaderMilestoneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderMilestoneCall) DoAndReturn(f func(context.Context, kv.Getter, uint64) ([]byte, error)) *MockreaderMilestoneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Span mocks base method. @@ -855,7 +1767,31 @@ func (m *Mockreader) Span(ctx context.Context, tx kv.Getter, spanId uint64) ([]b } // Span indicates an expected call of Span. -func (mr *MockreaderMockRecorder) Span(ctx, tx, spanId any) *gomock.Call { +func (mr *MockreaderMockRecorder) Span(ctx, tx, spanId any) *MockreaderSpanCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Span", reflect.TypeOf((*Mockreader)(nil).Span), ctx, tx, spanId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Span", reflect.TypeOf((*Mockreader)(nil).Span), ctx, tx, spanId) + return &MockreaderSpanCall{Call: call} +} + +// MockreaderSpanCall wrap *gomock.Call +type MockreaderSpanCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockreaderSpanCall) Return(arg0 []byte, arg1 error) *MockreaderSpanCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockreaderSpanCall) Do(f func(context.Context, kv.Getter, uint64) ([]byte, error)) *MockreaderSpanCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockreaderSpanCall) DoAndReturn(f func(context.Context, kv.Getter, uint64) ([]byte, error)) *MockreaderSpanCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/p2p/service.go b/polygon/p2p/service.go index 06ecbf24c58..dfdf1135f16 100644 --- a/polygon/p2p/service.go +++ b/polygon/p2p/service.go @@ -10,7 +10,7 @@ import ( sentrymulticlient "github.com/ledgerwatch/erigon/p2p/sentry/sentry_multi_client" ) -//go:generate mockgen -source=./service.go -destination=./service_mock.go -package=p2p . Service +//go:generate mockgen -typed=true -source=./service.go -destination=./service_mock.go -package=p2p . Service type Service interface { Fetcher MessageListener diff --git a/polygon/p2p/service_mock.go b/polygon/p2p/service_mock.go index ab82cc415bc..563c46309a6 100644 --- a/polygon/p2p/service_mock.go +++ b/polygon/p2p/service_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -source=./service.go -destination=./service_mock.go -package=p2p . Service +// mockgen -typed=true -source=./service.go -destination=./service_mock.go -package=p2p . Service // // Package p2p is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockService) BlockNumMissing(peerId *PeerId, blockNum uint64) { } // BlockNumMissing indicates an expected call of BlockNumMissing. -func (mr *MockServiceMockRecorder) BlockNumMissing(peerId, blockNum any) *gomock.Call { +func (mr *MockServiceMockRecorder) BlockNumMissing(peerId, blockNum any) *MockServiceBlockNumMissingCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockNumMissing", reflect.TypeOf((*MockService)(nil).BlockNumMissing), peerId, blockNum) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockNumMissing", reflect.TypeOf((*MockService)(nil).BlockNumMissing), peerId, blockNum) + return &MockServiceBlockNumMissingCall{Call: call} +} + +// MockServiceBlockNumMissingCall wrap *gomock.Call +type MockServiceBlockNumMissingCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceBlockNumMissingCall) Return() *MockServiceBlockNumMissingCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceBlockNumMissingCall) Do(f func(*PeerId, uint64)) *MockServiceBlockNumMissingCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceBlockNumMissingCall) DoAndReturn(f func(*PeerId, uint64)) *MockServiceBlockNumMissingCall { + c.Call = c.Call.DoAndReturn(f) + return c } // BlockNumPresent mocks base method. @@ -61,9 +85,33 @@ func (m *MockService) BlockNumPresent(peerId *PeerId, blockNum uint64) { } // BlockNumPresent indicates an expected call of BlockNumPresent. -func (mr *MockServiceMockRecorder) BlockNumPresent(peerId, blockNum any) *gomock.Call { +func (mr *MockServiceMockRecorder) BlockNumPresent(peerId, blockNum any) *MockServiceBlockNumPresentCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockNumPresent", reflect.TypeOf((*MockService)(nil).BlockNumPresent), peerId, blockNum) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockNumPresent", reflect.TypeOf((*MockService)(nil).BlockNumPresent), peerId, blockNum) + return &MockServiceBlockNumPresentCall{Call: call} +} + +// MockServiceBlockNumPresentCall wrap *gomock.Call +type MockServiceBlockNumPresentCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceBlockNumPresentCall) Return() *MockServiceBlockNumPresentCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceBlockNumPresentCall) Do(f func(*PeerId, uint64)) *MockServiceBlockNumPresentCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceBlockNumPresentCall) DoAndReturn(f func(*PeerId, uint64)) *MockServiceBlockNumPresentCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchBlocks mocks base method. @@ -76,9 +124,33 @@ func (m *MockService) FetchBlocks(ctx context.Context, start, end uint64, peerId } // FetchBlocks indicates an expected call of FetchBlocks. -func (mr *MockServiceMockRecorder) FetchBlocks(ctx, start, end, peerId any) *gomock.Call { +func (mr *MockServiceMockRecorder) FetchBlocks(ctx, start, end, peerId any) *MockServiceFetchBlocksCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBlocks", reflect.TypeOf((*MockService)(nil).FetchBlocks), ctx, start, end, peerId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBlocks", reflect.TypeOf((*MockService)(nil).FetchBlocks), ctx, start, end, peerId) + return &MockServiceFetchBlocksCall{Call: call} +} + +// MockServiceFetchBlocksCall wrap *gomock.Call +type MockServiceFetchBlocksCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceFetchBlocksCall) Return(arg0 FetcherResponse[[]*types.Block], arg1 error) *MockServiceFetchBlocksCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceFetchBlocksCall) Do(f func(context.Context, uint64, uint64, *PeerId) (FetcherResponse[[]*types.Block], error)) *MockServiceFetchBlocksCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceFetchBlocksCall) DoAndReturn(f func(context.Context, uint64, uint64, *PeerId) (FetcherResponse[[]*types.Block], error)) *MockServiceFetchBlocksCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchBodies mocks base method. @@ -91,9 +163,33 @@ func (m *MockService) FetchBodies(ctx context.Context, headers []*types.Header, } // FetchBodies indicates an expected call of FetchBodies. -func (mr *MockServiceMockRecorder) FetchBodies(ctx, headers, peerId any) *gomock.Call { +func (mr *MockServiceMockRecorder) FetchBodies(ctx, headers, peerId any) *MockServiceFetchBodiesCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBodies", reflect.TypeOf((*MockService)(nil).FetchBodies), ctx, headers, peerId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchBodies", reflect.TypeOf((*MockService)(nil).FetchBodies), ctx, headers, peerId) + return &MockServiceFetchBodiesCall{Call: call} +} + +// MockServiceFetchBodiesCall wrap *gomock.Call +type MockServiceFetchBodiesCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceFetchBodiesCall) Return(arg0 FetcherResponse[[]*types.Body], arg1 error) *MockServiceFetchBodiesCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceFetchBodiesCall) Do(f func(context.Context, []*types.Header, *PeerId) (FetcherResponse[[]*types.Body], error)) *MockServiceFetchBodiesCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceFetchBodiesCall) DoAndReturn(f func(context.Context, []*types.Header, *PeerId) (FetcherResponse[[]*types.Body], error)) *MockServiceFetchBodiesCall { + c.Call = c.Call.DoAndReturn(f) + return c } // FetchHeaders mocks base method. @@ -106,9 +202,33 @@ func (m *MockService) FetchHeaders(ctx context.Context, start, end uint64, peerI } // FetchHeaders indicates an expected call of FetchHeaders. -func (mr *MockServiceMockRecorder) FetchHeaders(ctx, start, end, peerId any) *gomock.Call { +func (mr *MockServiceMockRecorder) FetchHeaders(ctx, start, end, peerId any) *MockServiceFetchHeadersCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchHeaders", reflect.TypeOf((*MockService)(nil).FetchHeaders), ctx, start, end, peerId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FetchHeaders", reflect.TypeOf((*MockService)(nil).FetchHeaders), ctx, start, end, peerId) + return &MockServiceFetchHeadersCall{Call: call} +} + +// MockServiceFetchHeadersCall wrap *gomock.Call +type MockServiceFetchHeadersCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceFetchHeadersCall) Return(arg0 FetcherResponse[[]*types.Header], arg1 error) *MockServiceFetchHeadersCall { + c.Call = c.Call.Return(arg0, arg1) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceFetchHeadersCall) Do(f func(context.Context, uint64, uint64, *PeerId) (FetcherResponse[[]*types.Header], error)) *MockServiceFetchHeadersCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceFetchHeadersCall) DoAndReturn(f func(context.Context, uint64, uint64, *PeerId) (FetcherResponse[[]*types.Header], error)) *MockServiceFetchHeadersCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ListPeersMayHaveBlockNum mocks base method. @@ -120,9 +240,33 @@ func (m *MockService) ListPeersMayHaveBlockNum(blockNum uint64) []*PeerId { } // ListPeersMayHaveBlockNum indicates an expected call of ListPeersMayHaveBlockNum. -func (mr *MockServiceMockRecorder) ListPeersMayHaveBlockNum(blockNum any) *gomock.Call { +func (mr *MockServiceMockRecorder) ListPeersMayHaveBlockNum(blockNum any) *MockServiceListPeersMayHaveBlockNumCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeersMayHaveBlockNum", reflect.TypeOf((*MockService)(nil).ListPeersMayHaveBlockNum), blockNum) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeersMayHaveBlockNum", reflect.TypeOf((*MockService)(nil).ListPeersMayHaveBlockNum), blockNum) + return &MockServiceListPeersMayHaveBlockNumCall{Call: call} +} + +// MockServiceListPeersMayHaveBlockNumCall wrap *gomock.Call +type MockServiceListPeersMayHaveBlockNumCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceListPeersMayHaveBlockNumCall) Return(arg0 []*PeerId) *MockServiceListPeersMayHaveBlockNumCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceListPeersMayHaveBlockNumCall) Do(f func(uint64) []*PeerId) *MockServiceListPeersMayHaveBlockNumCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceListPeersMayHaveBlockNumCall) DoAndReturn(f func(uint64) []*PeerId) *MockServiceListPeersMayHaveBlockNumCall { + c.Call = c.Call.DoAndReturn(f) + return c } // MaxPeers mocks base method. @@ -134,9 +278,33 @@ func (m *MockService) MaxPeers() int { } // MaxPeers indicates an expected call of MaxPeers. -func (mr *MockServiceMockRecorder) MaxPeers() *gomock.Call { +func (mr *MockServiceMockRecorder) MaxPeers() *MockServiceMaxPeersCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxPeers", reflect.TypeOf((*MockService)(nil).MaxPeers)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MaxPeers", reflect.TypeOf((*MockService)(nil).MaxPeers)) + return &MockServiceMaxPeersCall{Call: call} +} + +// MockServiceMaxPeersCall wrap *gomock.Call +type MockServiceMaxPeersCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceMaxPeersCall) Return(arg0 int) *MockServiceMaxPeersCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceMaxPeersCall) Do(f func() int) *MockServiceMaxPeersCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceMaxPeersCall) DoAndReturn(f func() int) *MockServiceMaxPeersCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PeerConnected mocks base method. @@ -146,9 +314,33 @@ func (m *MockService) PeerConnected(peerId *PeerId) { } // PeerConnected indicates an expected call of PeerConnected. -func (mr *MockServiceMockRecorder) PeerConnected(peerId any) *gomock.Call { +func (mr *MockServiceMockRecorder) PeerConnected(peerId any) *MockServicePeerConnectedCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerConnected", reflect.TypeOf((*MockService)(nil).PeerConnected), peerId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerConnected", reflect.TypeOf((*MockService)(nil).PeerConnected), peerId) + return &MockServicePeerConnectedCall{Call: call} +} + +// MockServicePeerConnectedCall wrap *gomock.Call +type MockServicePeerConnectedCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServicePeerConnectedCall) Return() *MockServicePeerConnectedCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServicePeerConnectedCall) Do(f func(*PeerId)) *MockServicePeerConnectedCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServicePeerConnectedCall) DoAndReturn(f func(*PeerId)) *MockServicePeerConnectedCall { + c.Call = c.Call.DoAndReturn(f) + return c } // PeerDisconnected mocks base method. @@ -158,9 +350,33 @@ func (m *MockService) PeerDisconnected(peerId *PeerId) { } // PeerDisconnected indicates an expected call of PeerDisconnected. -func (mr *MockServiceMockRecorder) PeerDisconnected(peerId any) *gomock.Call { +func (mr *MockServiceMockRecorder) PeerDisconnected(peerId any) *MockServicePeerDisconnectedCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerDisconnected", reflect.TypeOf((*MockService)(nil).PeerDisconnected), peerId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PeerDisconnected", reflect.TypeOf((*MockService)(nil).PeerDisconnected), peerId) + return &MockServicePeerDisconnectedCall{Call: call} +} + +// MockServicePeerDisconnectedCall wrap *gomock.Call +type MockServicePeerDisconnectedCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServicePeerDisconnectedCall) Return() *MockServicePeerDisconnectedCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServicePeerDisconnectedCall) Do(f func(*PeerId)) *MockServicePeerDisconnectedCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServicePeerDisconnectedCall) DoAndReturn(f func(*PeerId)) *MockServicePeerDisconnectedCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Penalize mocks base method. @@ -172,9 +388,33 @@ func (m *MockService) Penalize(ctx context.Context, peerId *PeerId) error { } // Penalize indicates an expected call of Penalize. -func (mr *MockServiceMockRecorder) Penalize(ctx, peerId any) *gomock.Call { +func (mr *MockServiceMockRecorder) Penalize(ctx, peerId any) *MockServicePenalizeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Penalize", reflect.TypeOf((*MockService)(nil).Penalize), ctx, peerId) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Penalize", reflect.TypeOf((*MockService)(nil).Penalize), ctx, peerId) + return &MockServicePenalizeCall{Call: call} +} + +// MockServicePenalizeCall wrap *gomock.Call +type MockServicePenalizeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServicePenalizeCall) Return(arg0 error) *MockServicePenalizeCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServicePenalizeCall) Do(f func(context.Context, *PeerId) error) *MockServicePenalizeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServicePenalizeCall) DoAndReturn(f func(context.Context, *PeerId) error) *MockServicePenalizeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // RegisterBlockBodiesObserver mocks base method. @@ -186,9 +426,33 @@ func (m *MockService) RegisterBlockBodiesObserver(observer MessageObserver[*Deco } // RegisterBlockBodiesObserver indicates an expected call of RegisterBlockBodiesObserver. -func (mr *MockServiceMockRecorder) RegisterBlockBodiesObserver(observer any) *gomock.Call { +func (mr *MockServiceMockRecorder) RegisterBlockBodiesObserver(observer any) *MockServiceRegisterBlockBodiesObserverCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterBlockBodiesObserver", reflect.TypeOf((*MockService)(nil).RegisterBlockBodiesObserver), observer) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterBlockBodiesObserver", reflect.TypeOf((*MockService)(nil).RegisterBlockBodiesObserver), observer) + return &MockServiceRegisterBlockBodiesObserverCall{Call: call} +} + +// MockServiceRegisterBlockBodiesObserverCall wrap *gomock.Call +type MockServiceRegisterBlockBodiesObserverCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceRegisterBlockBodiesObserverCall) Return(arg0 UnregisterFunc) *MockServiceRegisterBlockBodiesObserverCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceRegisterBlockBodiesObserverCall) Do(f func(MessageObserver[*DecodedInboundMessage[*eth.BlockBodiesPacket66]]) UnregisterFunc) *MockServiceRegisterBlockBodiesObserverCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceRegisterBlockBodiesObserverCall) DoAndReturn(f func(MessageObserver[*DecodedInboundMessage[*eth.BlockBodiesPacket66]]) UnregisterFunc) *MockServiceRegisterBlockBodiesObserverCall { + c.Call = c.Call.DoAndReturn(f) + return c } // RegisterBlockHeadersObserver mocks base method. @@ -200,9 +464,33 @@ func (m *MockService) RegisterBlockHeadersObserver(observer MessageObserver[*Dec } // RegisterBlockHeadersObserver indicates an expected call of RegisterBlockHeadersObserver. -func (mr *MockServiceMockRecorder) RegisterBlockHeadersObserver(observer any) *gomock.Call { +func (mr *MockServiceMockRecorder) RegisterBlockHeadersObserver(observer any) *MockServiceRegisterBlockHeadersObserverCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterBlockHeadersObserver", reflect.TypeOf((*MockService)(nil).RegisterBlockHeadersObserver), observer) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterBlockHeadersObserver", reflect.TypeOf((*MockService)(nil).RegisterBlockHeadersObserver), observer) + return &MockServiceRegisterBlockHeadersObserverCall{Call: call} +} + +// MockServiceRegisterBlockHeadersObserverCall wrap *gomock.Call +type MockServiceRegisterBlockHeadersObserverCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceRegisterBlockHeadersObserverCall) Return(arg0 UnregisterFunc) *MockServiceRegisterBlockHeadersObserverCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceRegisterBlockHeadersObserverCall) Do(f func(MessageObserver[*DecodedInboundMessage[*eth.BlockHeadersPacket66]]) UnregisterFunc) *MockServiceRegisterBlockHeadersObserverCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceRegisterBlockHeadersObserverCall) DoAndReturn(f func(MessageObserver[*DecodedInboundMessage[*eth.BlockHeadersPacket66]]) UnregisterFunc) *MockServiceRegisterBlockHeadersObserverCall { + c.Call = c.Call.DoAndReturn(f) + return c } // RegisterNewBlockHashesObserver mocks base method. @@ -214,9 +502,33 @@ func (m *MockService) RegisterNewBlockHashesObserver(observer MessageObserver[*D } // RegisterNewBlockHashesObserver indicates an expected call of RegisterNewBlockHashesObserver. -func (mr *MockServiceMockRecorder) RegisterNewBlockHashesObserver(observer any) *gomock.Call { +func (mr *MockServiceMockRecorder) RegisterNewBlockHashesObserver(observer any) *MockServiceRegisterNewBlockHashesObserverCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterNewBlockHashesObserver", reflect.TypeOf((*MockService)(nil).RegisterNewBlockHashesObserver), observer) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterNewBlockHashesObserver", reflect.TypeOf((*MockService)(nil).RegisterNewBlockHashesObserver), observer) + return &MockServiceRegisterNewBlockHashesObserverCall{Call: call} +} + +// MockServiceRegisterNewBlockHashesObserverCall wrap *gomock.Call +type MockServiceRegisterNewBlockHashesObserverCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceRegisterNewBlockHashesObserverCall) Return(arg0 UnregisterFunc) *MockServiceRegisterNewBlockHashesObserverCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceRegisterNewBlockHashesObserverCall) Do(f func(MessageObserver[*DecodedInboundMessage[*eth.NewBlockHashesPacket]]) UnregisterFunc) *MockServiceRegisterNewBlockHashesObserverCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceRegisterNewBlockHashesObserverCall) DoAndReturn(f func(MessageObserver[*DecodedInboundMessage[*eth.NewBlockHashesPacket]]) UnregisterFunc) *MockServiceRegisterNewBlockHashesObserverCall { + c.Call = c.Call.DoAndReturn(f) + return c } // RegisterNewBlockObserver mocks base method. @@ -228,9 +540,33 @@ func (m *MockService) RegisterNewBlockObserver(observer MessageObserver[*Decoded } // RegisterNewBlockObserver indicates an expected call of RegisterNewBlockObserver. -func (mr *MockServiceMockRecorder) RegisterNewBlockObserver(observer any) *gomock.Call { +func (mr *MockServiceMockRecorder) RegisterNewBlockObserver(observer any) *MockServiceRegisterNewBlockObserverCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterNewBlockObserver", reflect.TypeOf((*MockService)(nil).RegisterNewBlockObserver), observer) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterNewBlockObserver", reflect.TypeOf((*MockService)(nil).RegisterNewBlockObserver), observer) + return &MockServiceRegisterNewBlockObserverCall{Call: call} +} + +// MockServiceRegisterNewBlockObserverCall wrap *gomock.Call +type MockServiceRegisterNewBlockObserverCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceRegisterNewBlockObserverCall) Return(arg0 UnregisterFunc) *MockServiceRegisterNewBlockObserverCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceRegisterNewBlockObserverCall) Do(f func(MessageObserver[*DecodedInboundMessage[*eth.NewBlockPacket]]) UnregisterFunc) *MockServiceRegisterNewBlockObserverCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceRegisterNewBlockObserverCall) DoAndReturn(f func(MessageObserver[*DecodedInboundMessage[*eth.NewBlockPacket]]) UnregisterFunc) *MockServiceRegisterNewBlockObserverCall { + c.Call = c.Call.DoAndReturn(f) + return c } // RegisterPeerEventObserver mocks base method. @@ -242,9 +578,33 @@ func (m *MockService) RegisterPeerEventObserver(observer MessageObserver[*sentry } // RegisterPeerEventObserver indicates an expected call of RegisterPeerEventObserver. -func (mr *MockServiceMockRecorder) RegisterPeerEventObserver(observer any) *gomock.Call { +func (mr *MockServiceMockRecorder) RegisterPeerEventObserver(observer any) *MockServiceRegisterPeerEventObserverCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterPeerEventObserver", reflect.TypeOf((*MockService)(nil).RegisterPeerEventObserver), observer) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterPeerEventObserver", reflect.TypeOf((*MockService)(nil).RegisterPeerEventObserver), observer) + return &MockServiceRegisterPeerEventObserverCall{Call: call} +} + +// MockServiceRegisterPeerEventObserverCall wrap *gomock.Call +type MockServiceRegisterPeerEventObserverCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceRegisterPeerEventObserverCall) Return(arg0 UnregisterFunc) *MockServiceRegisterPeerEventObserverCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceRegisterPeerEventObserverCall) Do(f func(MessageObserver[*sentry.PeerEvent]) UnregisterFunc) *MockServiceRegisterPeerEventObserverCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceRegisterPeerEventObserverCall) DoAndReturn(f func(MessageObserver[*sentry.PeerEvent]) UnregisterFunc) *MockServiceRegisterPeerEventObserverCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Run mocks base method. @@ -254,7 +614,31 @@ func (m *MockService) Run(ctx context.Context) { } // Run indicates an expected call of Run. -func (mr *MockServiceMockRecorder) Run(ctx any) *gomock.Call { +func (mr *MockServiceMockRecorder) Run(ctx any) *MockServiceRunCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockService)(nil).Run), ctx) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockService)(nil).Run), ctx) + return &MockServiceRunCall{Call: call} +} + +// MockServiceRunCall wrap *gomock.Call +type MockServiceRunCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockServiceRunCall) Return() *MockServiceRunCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockServiceRunCall) Do(f func(context.Context)) *MockServiceRunCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockServiceRunCall) DoAndReturn(f func(context.Context)) *MockServiceRunCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/sync/canonical_chain_builder.go b/polygon/sync/canonical_chain_builder.go index 2a49cb23eb6..c6ceabb8de6 100644 --- a/polygon/sync/canonical_chain_builder.go +++ b/polygon/sync/canonical_chain_builder.go @@ -11,7 +11,7 @@ import ( "github.com/ledgerwatch/erigon/polygon/bor" ) -//go:generate mockgen -destination=./canonical_chain_builder_mock.go -package=sync . CanonicalChainBuilder +//go:generate mockgen -typed=true -destination=./canonical_chain_builder_mock.go -package=sync . CanonicalChainBuilder type CanonicalChainBuilder interface { Reset(root *types.Header) ContainsHash(hash libcommon.Hash) bool diff --git a/polygon/sync/canonical_chain_builder_mock.go b/polygon/sync/canonical_chain_builder_mock.go index aa41958cd5f..b5f5d3a705c 100644 --- a/polygon/sync/canonical_chain_builder_mock.go +++ b/polygon/sync/canonical_chain_builder_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./canonical_chain_builder_mock.go -package=sync . CanonicalChainBuilder +// mockgen -typed=true -destination=./canonical_chain_builder_mock.go -package=sync . CanonicalChainBuilder // // Package sync is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockCanonicalChainBuilder) Connect(arg0 []*types.Header) error { } // Connect indicates an expected call of Connect. -func (mr *MockCanonicalChainBuilderMockRecorder) Connect(arg0 any) *gomock.Call { +func (mr *MockCanonicalChainBuilderMockRecorder) Connect(arg0 any) *MockCanonicalChainBuilderConnectCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Connect), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Connect", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Connect), arg0) + return &MockCanonicalChainBuilderConnectCall{Call: call} +} + +// MockCanonicalChainBuilderConnectCall wrap *gomock.Call +type MockCanonicalChainBuilderConnectCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCanonicalChainBuilderConnectCall) Return(arg0 error) *MockCanonicalChainBuilderConnectCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCanonicalChainBuilderConnectCall) Do(f func([]*types.Header) error) *MockCanonicalChainBuilderConnectCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCanonicalChainBuilderConnectCall) DoAndReturn(f func([]*types.Header) error) *MockCanonicalChainBuilderConnectCall { + c.Call = c.Call.DoAndReturn(f) + return c } // ContainsHash mocks base method. @@ -63,9 +87,33 @@ func (m *MockCanonicalChainBuilder) ContainsHash(arg0 common.Hash) bool { } // ContainsHash indicates an expected call of ContainsHash. -func (mr *MockCanonicalChainBuilderMockRecorder) ContainsHash(arg0 any) *gomock.Call { +func (mr *MockCanonicalChainBuilderMockRecorder) ContainsHash(arg0 any) *MockCanonicalChainBuilderContainsHashCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainsHash", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).ContainsHash), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ContainsHash", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).ContainsHash), arg0) + return &MockCanonicalChainBuilderContainsHashCall{Call: call} +} + +// MockCanonicalChainBuilderContainsHashCall wrap *gomock.Call +type MockCanonicalChainBuilderContainsHashCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCanonicalChainBuilderContainsHashCall) Return(arg0 bool) *MockCanonicalChainBuilderContainsHashCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCanonicalChainBuilderContainsHashCall) Do(f func(common.Hash) bool) *MockCanonicalChainBuilderContainsHashCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCanonicalChainBuilderContainsHashCall) DoAndReturn(f func(common.Hash) bool) *MockCanonicalChainBuilderContainsHashCall { + c.Call = c.Call.DoAndReturn(f) + return c } // HeadersInRange mocks base method. @@ -77,9 +125,33 @@ func (m *MockCanonicalChainBuilder) HeadersInRange(arg0, arg1 uint64) []*types.H } // HeadersInRange indicates an expected call of HeadersInRange. -func (mr *MockCanonicalChainBuilderMockRecorder) HeadersInRange(arg0, arg1 any) *gomock.Call { +func (mr *MockCanonicalChainBuilderMockRecorder) HeadersInRange(arg0, arg1 any) *MockCanonicalChainBuilderHeadersInRangeCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadersInRange", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).HeadersInRange), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HeadersInRange", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).HeadersInRange), arg0, arg1) + return &MockCanonicalChainBuilderHeadersInRangeCall{Call: call} +} + +// MockCanonicalChainBuilderHeadersInRangeCall wrap *gomock.Call +type MockCanonicalChainBuilderHeadersInRangeCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCanonicalChainBuilderHeadersInRangeCall) Return(arg0 []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCanonicalChainBuilderHeadersInRangeCall) Do(f func(uint64, uint64) []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCanonicalChainBuilderHeadersInRangeCall) DoAndReturn(f func(uint64, uint64) []*types.Header) *MockCanonicalChainBuilderHeadersInRangeCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Prune mocks base method. @@ -91,9 +163,33 @@ func (m *MockCanonicalChainBuilder) Prune(arg0 uint64) error { } // Prune indicates an expected call of Prune. -func (mr *MockCanonicalChainBuilderMockRecorder) Prune(arg0 any) *gomock.Call { +func (mr *MockCanonicalChainBuilderMockRecorder) Prune(arg0 any) *MockCanonicalChainBuilderPruneCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prune", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Prune), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prune", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Prune), arg0) + return &MockCanonicalChainBuilderPruneCall{Call: call} +} + +// MockCanonicalChainBuilderPruneCall wrap *gomock.Call +type MockCanonicalChainBuilderPruneCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCanonicalChainBuilderPruneCall) Return(arg0 error) *MockCanonicalChainBuilderPruneCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCanonicalChainBuilderPruneCall) Do(f func(uint64) error) *MockCanonicalChainBuilderPruneCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCanonicalChainBuilderPruneCall) DoAndReturn(f func(uint64) error) *MockCanonicalChainBuilderPruneCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Reset mocks base method. @@ -103,9 +199,33 @@ func (m *MockCanonicalChainBuilder) Reset(arg0 *types.Header) { } // Reset indicates an expected call of Reset. -func (mr *MockCanonicalChainBuilderMockRecorder) Reset(arg0 any) *gomock.Call { +func (mr *MockCanonicalChainBuilderMockRecorder) Reset(arg0 any) *MockCanonicalChainBuilderResetCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reset", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Reset), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Reset", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Reset), arg0) + return &MockCanonicalChainBuilderResetCall{Call: call} +} + +// MockCanonicalChainBuilderResetCall wrap *gomock.Call +type MockCanonicalChainBuilderResetCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCanonicalChainBuilderResetCall) Return() *MockCanonicalChainBuilderResetCall { + c.Call = c.Call.Return() + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCanonicalChainBuilderResetCall) Do(f func(*types.Header)) *MockCanonicalChainBuilderResetCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCanonicalChainBuilderResetCall) DoAndReturn(f func(*types.Header)) *MockCanonicalChainBuilderResetCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Root mocks base method. @@ -117,9 +237,33 @@ func (m *MockCanonicalChainBuilder) Root() *types.Header { } // Root indicates an expected call of Root. -func (mr *MockCanonicalChainBuilderMockRecorder) Root() *gomock.Call { +func (mr *MockCanonicalChainBuilderMockRecorder) Root() *MockCanonicalChainBuilderRootCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Root", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Root)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Root", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Root)) + return &MockCanonicalChainBuilderRootCall{Call: call} +} + +// MockCanonicalChainBuilderRootCall wrap *gomock.Call +type MockCanonicalChainBuilderRootCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCanonicalChainBuilderRootCall) Return(arg0 *types.Header) *MockCanonicalChainBuilderRootCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCanonicalChainBuilderRootCall) Do(f func() *types.Header) *MockCanonicalChainBuilderRootCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCanonicalChainBuilderRootCall) DoAndReturn(f func() *types.Header) *MockCanonicalChainBuilderRootCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Tip mocks base method. @@ -131,7 +275,31 @@ func (m *MockCanonicalChainBuilder) Tip() *types.Header { } // Tip indicates an expected call of Tip. -func (mr *MockCanonicalChainBuilderMockRecorder) Tip() *gomock.Call { +func (mr *MockCanonicalChainBuilderMockRecorder) Tip() *MockCanonicalChainBuilderTipCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tip", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Tip)) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tip", reflect.TypeOf((*MockCanonicalChainBuilder)(nil).Tip)) + return &MockCanonicalChainBuilderTipCall{Call: call} +} + +// MockCanonicalChainBuilderTipCall wrap *gomock.Call +type MockCanonicalChainBuilderTipCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockCanonicalChainBuilderTipCall) Return(arg0 *types.Header) *MockCanonicalChainBuilderTipCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockCanonicalChainBuilderTipCall) Do(f func() *types.Header) *MockCanonicalChainBuilderTipCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockCanonicalChainBuilderTipCall) DoAndReturn(f func() *types.Header) *MockCanonicalChainBuilderTipCall { + c.Call = c.Call.DoAndReturn(f) + return c } diff --git a/polygon/sync/storage.go b/polygon/sync/storage.go index 2b805b8f314..5e47aa0d204 100644 --- a/polygon/sync/storage.go +++ b/polygon/sync/storage.go @@ -10,7 +10,7 @@ import ( "github.com/ledgerwatch/erigon/core/types" ) -//go:generate mockgen -destination=./storage_mock.go -package=sync . Storage +//go:generate mockgen -typed=true -destination=./storage_mock.go -package=sync . Storage type Storage interface { // InsertBlocks queues blocks for writing into the local canonical chain. InsertBlocks(ctx context.Context, blocks []*types.Block) error diff --git a/polygon/sync/storage_mock.go b/polygon/sync/storage_mock.go index f29bc7ec5ee..32c3611bc03 100644 --- a/polygon/sync/storage_mock.go +++ b/polygon/sync/storage_mock.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./storage_mock.go -package=sync . Storage +// mockgen -typed=true -destination=./storage_mock.go -package=sync . Storage // // Package sync is a generated GoMock package. @@ -49,9 +49,33 @@ func (m *MockStorage) Flush(arg0 context.Context) error { } // Flush indicates an expected call of Flush. -func (mr *MockStorageMockRecorder) Flush(arg0 any) *gomock.Call { +func (mr *MockStorageMockRecorder) Flush(arg0 any) *MockStorageFlushCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Flush", reflect.TypeOf((*MockStorage)(nil).Flush), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Flush", reflect.TypeOf((*MockStorage)(nil).Flush), arg0) + return &MockStorageFlushCall{Call: call} +} + +// MockStorageFlushCall wrap *gomock.Call +type MockStorageFlushCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorageFlushCall) Return(arg0 error) *MockStorageFlushCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorageFlushCall) Do(f func(context.Context) error) *MockStorageFlushCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorageFlushCall) DoAndReturn(f func(context.Context) error) *MockStorageFlushCall { + c.Call = c.Call.DoAndReturn(f) + return c } // InsertBlocks mocks base method. @@ -63,9 +87,33 @@ func (m *MockStorage) InsertBlocks(arg0 context.Context, arg1 []*types.Block) er } // InsertBlocks indicates an expected call of InsertBlocks. -func (mr *MockStorageMockRecorder) InsertBlocks(arg0, arg1 any) *gomock.Call { +func (mr *MockStorageMockRecorder) InsertBlocks(arg0, arg1 any) *MockStorageInsertBlocksCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlocks", reflect.TypeOf((*MockStorage)(nil).InsertBlocks), arg0, arg1) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InsertBlocks", reflect.TypeOf((*MockStorage)(nil).InsertBlocks), arg0, arg1) + return &MockStorageInsertBlocksCall{Call: call} +} + +// MockStorageInsertBlocksCall wrap *gomock.Call +type MockStorageInsertBlocksCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorageInsertBlocksCall) Return(arg0 error) *MockStorageInsertBlocksCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorageInsertBlocksCall) Do(f func(context.Context, []*types.Block) error) *MockStorageInsertBlocksCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorageInsertBlocksCall) DoAndReturn(f func(context.Context, []*types.Block) error) *MockStorageInsertBlocksCall { + c.Call = c.Call.DoAndReturn(f) + return c } // Run mocks base method. @@ -77,7 +125,31 @@ func (m *MockStorage) Run(arg0 context.Context) error { } // Run indicates an expected call of Run. -func (mr *MockStorageMockRecorder) Run(arg0 any) *gomock.Call { +func (mr *MockStorageMockRecorder) Run(arg0 any) *MockStorageRunCall { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockStorage)(nil).Run), arg0) + call := mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Run", reflect.TypeOf((*MockStorage)(nil).Run), arg0) + return &MockStorageRunCall{Call: call} +} + +// MockStorageRunCall wrap *gomock.Call +type MockStorageRunCall struct { + *gomock.Call +} + +// Return rewrite *gomock.Call.Return +func (c *MockStorageRunCall) Return(arg0 error) *MockStorageRunCall { + c.Call = c.Call.Return(arg0) + return c +} + +// Do rewrite *gomock.Call.Do +func (c *MockStorageRunCall) Do(f func(context.Context) error) *MockStorageRunCall { + c.Call = c.Call.Do(f) + return c +} + +// DoAndReturn rewrite *gomock.Call.DoAndReturn +func (c *MockStorageRunCall) DoAndReturn(f func(context.Context) error) *MockStorageRunCall { + c.Call = c.Call.DoAndReturn(f) + return c }