From ab7dfc4ecdebb6c7ce96054ba65b59663bc2b16e Mon Sep 17 00:00:00 2001 From: Madhur Shrimal Date: Thu, 27 Jun 2024 18:30:31 -0700 Subject: [PATCH] fix mocks --- chainio/gen.go | 6 +- chainio/mocks/avsRegistryContractsReader.go | 102 +++++++++--------- .../mocks/avsRegistryContractsSubscriber.go | 36 +++---- chainio/mocks/avsRegistryContractsWriter.go | 54 +++++----- metrics/collectors/economic/economic_test.go | 2 +- .../avsregistry_chaincaller_test.go | 18 ++-- .../operatorsinfo_inmemory_test.go | 12 +-- 7 files changed, 115 insertions(+), 115 deletions(-) diff --git a/chainio/gen.go b/chainio/gen.go index c789795c..a34ae1e6 100644 --- a/chainio/gen.go +++ b/chainio/gen.go @@ -1,8 +1,8 @@ package chainio -//go:generate mockgen -destination=./mocks/avsRegistryContractsReader.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Reader -//go:generate mockgen -destination=./mocks/avsRegistryContractsSubscriber.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Subscriber -//go:generate mockgen -destination=./mocks/avsRegistryContractsWriter.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Writer +//go:generate mockgen -destination=./mocks/avsRegistryContractsReader.go -package=mocks -mock_names=Reader=MockAVSReader github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Reader +//go:generate mockgen -destination=./mocks/avsRegistryContractsSubscriber.go -package=mocks -mock_names=Subscriber=MockAVSSubscriber github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Subscriber +//go:generate mockgen -destination=./mocks/avsRegistryContractsWriter.go -package=mocks -mock_names=Writer=MockAVSWriter github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Writer //go:generate mockgen -destination=./mocks/elContractsReader.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts ELReader //go:generate mockgen -destination=./mocks/elContractsWriter.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/elcontracts ELWriter //go:generate mockgen -destination=./mocks/ethclient.go -package=mocks -mock_names=Client=MockEthClient github.com/Layr-Labs/eigensdk-go/chainio/clients/eth Client diff --git a/chainio/mocks/avsRegistryContractsReader.go b/chainio/mocks/avsRegistryContractsReader.go index 14857bc0..15305b91 100644 --- a/chainio/mocks/avsRegistryContractsReader.go +++ b/chainio/mocks/avsRegistryContractsReader.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mocks/avsRegistryContractsReader.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Reader +// mockgen -destination=./mocks/avsRegistryContractsReader.go -package=mocks -mock_names=Reader=MockAVSReader github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Reader // // Package mocks is a generated GoMock package. @@ -21,31 +21,31 @@ import ( gomock "go.uber.org/mock/gomock" ) -// MockReader is a mock of Reader interface. -type MockReader struct { +// MockAVSReader is a mock of Reader interface. +type MockAVSReader struct { ctrl *gomock.Controller - recorder *MockReaderMockRecorder + recorder *MockAVSReaderMockRecorder } -// MockReaderMockRecorder is the mock recorder for MockReader. -type MockReaderMockRecorder struct { - mock *MockReader +// MockAVSReaderMockRecorder is the mock recorder for MockAVSReader. +type MockAVSReaderMockRecorder struct { + mock *MockAVSReader } -// NewMockReader creates a new mock instance. -func NewMockReader(ctrl *gomock.Controller) *MockReader { - mock := &MockReader{ctrl: ctrl} - mock.recorder = &MockReaderMockRecorder{mock} +// NewMockAVSReader creates a new mock instance. +func NewMockAVSReader(ctrl *gomock.Controller) *MockAVSReader { + mock := &MockAVSReader{ctrl: ctrl} + mock.recorder = &MockAVSReaderMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockReader) EXPECT() *MockReaderMockRecorder { +func (m *MockAVSReader) EXPECT() *MockAVSReaderMockRecorder { return m.recorder } // GetCheckSignaturesIndices mocks base method. -func (m *MockReader) GetCheckSignaturesIndices(arg0 *bind.CallOpts, arg1 uint32, arg2 types.QuorumNums, arg3 []types.Bytes32) (contractOperatorStateRetriever.OperatorStateRetrieverCheckSignaturesIndices, error) { +func (m *MockAVSReader) GetCheckSignaturesIndices(arg0 *bind.CallOpts, arg1 uint32, arg2 types.QuorumNums, arg3 []types.Bytes32) (contractOperatorStateRetriever.OperatorStateRetrieverCheckSignaturesIndices, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetCheckSignaturesIndices", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(contractOperatorStateRetriever.OperatorStateRetrieverCheckSignaturesIndices) @@ -54,13 +54,13 @@ func (m *MockReader) GetCheckSignaturesIndices(arg0 *bind.CallOpts, arg1 uint32, } // GetCheckSignaturesIndices indicates an expected call of GetCheckSignaturesIndices. -func (mr *MockReaderMockRecorder) GetCheckSignaturesIndices(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetCheckSignaturesIndices(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckSignaturesIndices", reflect.TypeOf((*MockReader)(nil).GetCheckSignaturesIndices), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCheckSignaturesIndices", reflect.TypeOf((*MockAVSReader)(nil).GetCheckSignaturesIndices), arg0, arg1, arg2, arg3) } // GetOperatorAddrsInQuorumsAtCurrentBlock mocks base method. -func (m *MockReader) GetOperatorAddrsInQuorumsAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums) ([][]common.Address, error) { +func (m *MockAVSReader) GetOperatorAddrsInQuorumsAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums) ([][]common.Address, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorAddrsInQuorumsAtCurrentBlock", arg0, arg1) ret0, _ := ret[0].([][]common.Address) @@ -69,13 +69,13 @@ func (m *MockReader) GetOperatorAddrsInQuorumsAtCurrentBlock(arg0 *bind.CallOpts } // GetOperatorAddrsInQuorumsAtCurrentBlock indicates an expected call of GetOperatorAddrsInQuorumsAtCurrentBlock. -func (mr *MockReaderMockRecorder) GetOperatorAddrsInQuorumsAtCurrentBlock(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorAddrsInQuorumsAtCurrentBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorAddrsInQuorumsAtCurrentBlock", reflect.TypeOf((*MockReader)(nil).GetOperatorAddrsInQuorumsAtCurrentBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorAddrsInQuorumsAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorAddrsInQuorumsAtCurrentBlock), arg0, arg1) } // GetOperatorFromId mocks base method. -func (m *MockReader) GetOperatorFromId(arg0 *bind.CallOpts, arg1 types.Bytes32) (common.Address, error) { +func (m *MockAVSReader) GetOperatorFromId(arg0 *bind.CallOpts, arg1 types.Bytes32) (common.Address, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorFromId", arg0, arg1) ret0, _ := ret[0].(common.Address) @@ -84,13 +84,13 @@ func (m *MockReader) GetOperatorFromId(arg0 *bind.CallOpts, arg1 types.Bytes32) } // GetOperatorFromId indicates an expected call of GetOperatorFromId. -func (mr *MockReaderMockRecorder) GetOperatorFromId(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorFromId(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorFromId", reflect.TypeOf((*MockReader)(nil).GetOperatorFromId), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorFromId", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorFromId), arg0, arg1) } // GetOperatorId mocks base method. -func (m *MockReader) GetOperatorId(arg0 *bind.CallOpts, arg1 common.Address) ([32]byte, error) { +func (m *MockAVSReader) GetOperatorId(arg0 *bind.CallOpts, arg1 common.Address) ([32]byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorId", arg0, arg1) ret0, _ := ret[0].([32]byte) @@ -99,13 +99,13 @@ func (m *MockReader) GetOperatorId(arg0 *bind.CallOpts, arg1 common.Address) ([3 } // GetOperatorId indicates an expected call of GetOperatorId. -func (mr *MockReaderMockRecorder) GetOperatorId(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorId(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorId", reflect.TypeOf((*MockReader)(nil).GetOperatorId), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorId", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorId), arg0, arg1) } // GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock mocks base method. -func (m *MockReader) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.Bytes32) (map[types.QuorumNum]*big.Int, error) { +func (m *MockAVSReader) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.Bytes32) (map[types.QuorumNum]*big.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock", arg0, arg1) ret0, _ := ret[0].(map[types.QuorumNum]*big.Int) @@ -114,13 +114,13 @@ func (m *MockReader) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bin } // GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock indicates an expected call of GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock. -func (mr *MockReaderMockRecorder) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock", reflect.TypeOf((*MockReader)(nil).GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock), arg0, arg1) } // GetOperatorsStakeInQuorumsAtBlock mocks base method. -func (m *MockReader) GetOperatorsStakeInQuorumsAtBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums, arg2 uint32) ([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { +func (m *MockAVSReader) GetOperatorsStakeInQuorumsAtBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums, arg2 uint32) ([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsAtBlock", arg0, arg1, arg2) ret0, _ := ret[0].([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator) @@ -129,13 +129,13 @@ func (m *MockReader) GetOperatorsStakeInQuorumsAtBlock(arg0 *bind.CallOpts, arg1 } // GetOperatorsStakeInQuorumsAtBlock indicates an expected call of GetOperatorsStakeInQuorumsAtBlock. -func (mr *MockReaderMockRecorder) GetOperatorsStakeInQuorumsAtBlock(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsAtBlock(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsAtBlock", reflect.TypeOf((*MockReader)(nil).GetOperatorsStakeInQuorumsAtBlock), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsAtBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsAtBlock), arg0, arg1, arg2) } // GetOperatorsStakeInQuorumsAtCurrentBlock mocks base method. -func (m *MockReader) GetOperatorsStakeInQuorumsAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums) ([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { +func (m *MockAVSReader) GetOperatorsStakeInQuorumsAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.QuorumNums) ([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsAtCurrentBlock", arg0, arg1) ret0, _ := ret[0].([][]contractOperatorStateRetriever.OperatorStateRetrieverOperator) @@ -144,13 +144,13 @@ func (m *MockReader) GetOperatorsStakeInQuorumsAtCurrentBlock(arg0 *bind.CallOpt } // GetOperatorsStakeInQuorumsAtCurrentBlock indicates an expected call of GetOperatorsStakeInQuorumsAtCurrentBlock. -func (mr *MockReaderMockRecorder) GetOperatorsStakeInQuorumsAtCurrentBlock(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsAtCurrentBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsAtCurrentBlock", reflect.TypeOf((*MockReader)(nil).GetOperatorsStakeInQuorumsAtCurrentBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsAtCurrentBlock), arg0, arg1) } // GetOperatorsStakeInQuorumsOfOperatorAtBlock mocks base method. -func (m *MockReader) GetOperatorsStakeInQuorumsOfOperatorAtBlock(arg0 *bind.CallOpts, arg1 types.Bytes32, arg2 uint32) (types.QuorumNums, [][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { +func (m *MockAVSReader) GetOperatorsStakeInQuorumsOfOperatorAtBlock(arg0 *bind.CallOpts, arg1 types.Bytes32, arg2 uint32) (types.QuorumNums, [][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsOfOperatorAtBlock", arg0, arg1, arg2) ret0, _ := ret[0].(types.QuorumNums) @@ -160,13 +160,13 @@ func (m *MockReader) GetOperatorsStakeInQuorumsOfOperatorAtBlock(arg0 *bind.Call } // GetOperatorsStakeInQuorumsOfOperatorAtBlock indicates an expected call of GetOperatorsStakeInQuorumsOfOperatorAtBlock. -func (mr *MockReaderMockRecorder) GetOperatorsStakeInQuorumsOfOperatorAtBlock(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsOfOperatorAtBlock(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsOfOperatorAtBlock", reflect.TypeOf((*MockReader)(nil).GetOperatorsStakeInQuorumsOfOperatorAtBlock), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsOfOperatorAtBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsOfOperatorAtBlock), arg0, arg1, arg2) } // GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock mocks base method. -func (m *MockReader) GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.Bytes32) (types.QuorumNums, [][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { +func (m *MockAVSReader) GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bind.CallOpts, arg1 types.Bytes32) (types.QuorumNums, [][]contractOperatorStateRetriever.OperatorStateRetrieverOperator, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock", arg0, arg1) ret0, _ := ret[0].(types.QuorumNums) @@ -176,13 +176,13 @@ func (m *MockReader) GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock(arg0 *bi } // GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock indicates an expected call of GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock. -func (mr *MockReaderMockRecorder) GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock", reflect.TypeOf((*MockReader)(nil).GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock", reflect.TypeOf((*MockAVSReader)(nil).GetOperatorsStakeInQuorumsOfOperatorAtCurrentBlock), arg0, arg1) } // GetQuorumCount mocks base method. -func (m *MockReader) GetQuorumCount(arg0 *bind.CallOpts) (byte, error) { +func (m *MockAVSReader) GetQuorumCount(arg0 *bind.CallOpts) (byte, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetQuorumCount", arg0) ret0, _ := ret[0].(byte) @@ -191,13 +191,13 @@ func (m *MockReader) GetQuorumCount(arg0 *bind.CallOpts) (byte, error) { } // GetQuorumCount indicates an expected call of GetQuorumCount. -func (mr *MockReaderMockRecorder) GetQuorumCount(arg0 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) GetQuorumCount(arg0 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQuorumCount", reflect.TypeOf((*MockReader)(nil).GetQuorumCount), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetQuorumCount", reflect.TypeOf((*MockAVSReader)(nil).GetQuorumCount), arg0) } // IsOperatorRegistered mocks base method. -func (m *MockReader) IsOperatorRegistered(arg0 *bind.CallOpts, arg1 common.Address) (bool, error) { +func (m *MockAVSReader) IsOperatorRegistered(arg0 *bind.CallOpts, arg1 common.Address) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsOperatorRegistered", arg0, arg1) ret0, _ := ret[0].(bool) @@ -206,13 +206,13 @@ func (m *MockReader) IsOperatorRegistered(arg0 *bind.CallOpts, arg1 common.Addre } // IsOperatorRegistered indicates an expected call of IsOperatorRegistered. -func (mr *MockReaderMockRecorder) IsOperatorRegistered(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) IsOperatorRegistered(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOperatorRegistered", reflect.TypeOf((*MockReader)(nil).IsOperatorRegistered), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsOperatorRegistered", reflect.TypeOf((*MockAVSReader)(nil).IsOperatorRegistered), arg0, arg1) } // QueryExistingRegisteredOperatorPubKeys mocks base method. -func (m *MockReader) QueryExistingRegisteredOperatorPubKeys(arg0 context.Context, arg1, arg2, arg3 *big.Int) ([]common.Address, []types.OperatorPubkeys, error) { +func (m *MockAVSReader) QueryExistingRegisteredOperatorPubKeys(arg0 context.Context, arg1, arg2, arg3 *big.Int) ([]common.Address, []types.OperatorPubkeys, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "QueryExistingRegisteredOperatorPubKeys", arg0, arg1, arg2, arg3) ret0, _ := ret[0].([]common.Address) @@ -222,13 +222,13 @@ func (m *MockReader) QueryExistingRegisteredOperatorPubKeys(arg0 context.Context } // QueryExistingRegisteredOperatorPubKeys indicates an expected call of QueryExistingRegisteredOperatorPubKeys. -func (mr *MockReaderMockRecorder) QueryExistingRegisteredOperatorPubKeys(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) QueryExistingRegisteredOperatorPubKeys(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryExistingRegisteredOperatorPubKeys", reflect.TypeOf((*MockReader)(nil).QueryExistingRegisteredOperatorPubKeys), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryExistingRegisteredOperatorPubKeys", reflect.TypeOf((*MockAVSReader)(nil).QueryExistingRegisteredOperatorPubKeys), arg0, arg1, arg2, arg3) } // QueryExistingRegisteredOperatorSockets mocks base method. -func (m *MockReader) QueryExistingRegisteredOperatorSockets(arg0 context.Context, arg1, arg2, arg3 *big.Int) (map[types.Bytes32]types.Socket, error) { +func (m *MockAVSReader) QueryExistingRegisteredOperatorSockets(arg0 context.Context, arg1, arg2, arg3 *big.Int) (map[types.Bytes32]types.Socket, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "QueryExistingRegisteredOperatorSockets", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(map[types.Bytes32]types.Socket) @@ -237,7 +237,7 @@ func (m *MockReader) QueryExistingRegisteredOperatorSockets(arg0 context.Context } // QueryExistingRegisteredOperatorSockets indicates an expected call of QueryExistingRegisteredOperatorSockets. -func (mr *MockReaderMockRecorder) QueryExistingRegisteredOperatorSockets(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockAVSReaderMockRecorder) QueryExistingRegisteredOperatorSockets(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryExistingRegisteredOperatorSockets", reflect.TypeOf((*MockReader)(nil).QueryExistingRegisteredOperatorSockets), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryExistingRegisteredOperatorSockets", reflect.TypeOf((*MockAVSReader)(nil).QueryExistingRegisteredOperatorSockets), arg0, arg1, arg2, arg3) } diff --git a/chainio/mocks/avsRegistryContractsSubscriber.go b/chainio/mocks/avsRegistryContractsSubscriber.go index c6249822..febfe4ef 100644 --- a/chainio/mocks/avsRegistryContractsSubscriber.go +++ b/chainio/mocks/avsRegistryContractsSubscriber.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mocks/avsRegistryContractsSubscriber.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Subscriber +// mockgen -destination=./mocks/avsRegistryContractsSubscriber.go -package=mocks -mock_names=Subscriber=MockAVSSubscriber github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Subscriber // // Package mocks is a generated GoMock package. @@ -18,31 +18,31 @@ import ( gomock "go.uber.org/mock/gomock" ) -// MockSubscriber is a mock of Subscriber interface. -type MockSubscriber struct { +// MockAVSSubscriber is a mock of Subscriber interface. +type MockAVSSubscriber struct { ctrl *gomock.Controller - recorder *MockSubscriberMockRecorder + recorder *MockAVSSubscriberMockRecorder } -// MockSubscriberMockRecorder is the mock recorder for MockSubscriber. -type MockSubscriberMockRecorder struct { - mock *MockSubscriber +// MockAVSSubscriberMockRecorder is the mock recorder for MockAVSSubscriber. +type MockAVSSubscriberMockRecorder struct { + mock *MockAVSSubscriber } -// NewMockSubscriber creates a new mock instance. -func NewMockSubscriber(ctrl *gomock.Controller) *MockSubscriber { - mock := &MockSubscriber{ctrl: ctrl} - mock.recorder = &MockSubscriberMockRecorder{mock} +// NewMockAVSSubscriber creates a new mock instance. +func NewMockAVSSubscriber(ctrl *gomock.Controller) *MockAVSSubscriber { + mock := &MockAVSSubscriber{ctrl: ctrl} + mock.recorder = &MockAVSSubscriberMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockSubscriber) EXPECT() *MockSubscriberMockRecorder { +func (m *MockAVSSubscriber) EXPECT() *MockAVSSubscriberMockRecorder { return m.recorder } // SubscribeToNewPubkeyRegistrations mocks base method. -func (m *MockSubscriber) SubscribeToNewPubkeyRegistrations() (chan *contractBLSApkRegistry.ContractBLSApkRegistryNewPubkeyRegistration, event.Subscription, error) { +func (m *MockAVSSubscriber) SubscribeToNewPubkeyRegistrations() (chan *contractBLSApkRegistry.ContractBLSApkRegistryNewPubkeyRegistration, event.Subscription, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SubscribeToNewPubkeyRegistrations") ret0, _ := ret[0].(chan *contractBLSApkRegistry.ContractBLSApkRegistryNewPubkeyRegistration) @@ -52,13 +52,13 @@ func (m *MockSubscriber) SubscribeToNewPubkeyRegistrations() (chan *contractBLSA } // SubscribeToNewPubkeyRegistrations indicates an expected call of SubscribeToNewPubkeyRegistrations. -func (mr *MockSubscriberMockRecorder) SubscribeToNewPubkeyRegistrations() *gomock.Call { +func (mr *MockAVSSubscriberMockRecorder) SubscribeToNewPubkeyRegistrations() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToNewPubkeyRegistrations", reflect.TypeOf((*MockSubscriber)(nil).SubscribeToNewPubkeyRegistrations)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToNewPubkeyRegistrations", reflect.TypeOf((*MockAVSSubscriber)(nil).SubscribeToNewPubkeyRegistrations)) } // SubscribeToOperatorSocketUpdates mocks base method. -func (m *MockSubscriber) SubscribeToOperatorSocketUpdates() (chan *contractRegistryCoordinator.ContractRegistryCoordinatorOperatorSocketUpdate, event.Subscription, error) { +func (m *MockAVSSubscriber) SubscribeToOperatorSocketUpdates() (chan *contractRegistryCoordinator.ContractRegistryCoordinatorOperatorSocketUpdate, event.Subscription, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SubscribeToOperatorSocketUpdates") ret0, _ := ret[0].(chan *contractRegistryCoordinator.ContractRegistryCoordinatorOperatorSocketUpdate) @@ -68,7 +68,7 @@ func (m *MockSubscriber) SubscribeToOperatorSocketUpdates() (chan *contractRegis } // SubscribeToOperatorSocketUpdates indicates an expected call of SubscribeToOperatorSocketUpdates. -func (mr *MockSubscriberMockRecorder) SubscribeToOperatorSocketUpdates() *gomock.Call { +func (mr *MockAVSSubscriberMockRecorder) SubscribeToOperatorSocketUpdates() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToOperatorSocketUpdates", reflect.TypeOf((*MockSubscriber)(nil).SubscribeToOperatorSocketUpdates)) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeToOperatorSocketUpdates", reflect.TypeOf((*MockAVSSubscriber)(nil).SubscribeToOperatorSocketUpdates)) } diff --git a/chainio/mocks/avsRegistryContractsWriter.go b/chainio/mocks/avsRegistryContractsWriter.go index 59d0cb7f..7797d777 100644 --- a/chainio/mocks/avsRegistryContractsWriter.go +++ b/chainio/mocks/avsRegistryContractsWriter.go @@ -3,7 +3,7 @@ // // Generated by this command: // -// mockgen -destination=./mocks/avsRegistryContractsWriter.go -package=mocks github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Writer +// mockgen -destination=./mocks/avsRegistryContractsWriter.go -package=mocks -mock_names=Writer=MockAVSWriter github.com/Layr-Labs/eigensdk-go/chainio/clients/avsregistry Writer // // Package mocks is a generated GoMock package. @@ -23,31 +23,31 @@ import ( gomock "go.uber.org/mock/gomock" ) -// MockWriter is a mock of Writer interface. -type MockWriter struct { +// MockAVSWriter is a mock of Writer interface. +type MockAVSWriter struct { ctrl *gomock.Controller - recorder *MockWriterMockRecorder + recorder *MockAVSWriterMockRecorder } -// MockWriterMockRecorder is the mock recorder for MockWriter. -type MockWriterMockRecorder struct { - mock *MockWriter +// MockAVSWriterMockRecorder is the mock recorder for MockAVSWriter. +type MockAVSWriterMockRecorder struct { + mock *MockAVSWriter } -// NewMockWriter creates a new mock instance. -func NewMockWriter(ctrl *gomock.Controller) *MockWriter { - mock := &MockWriter{ctrl: ctrl} - mock.recorder = &MockWriterMockRecorder{mock} +// NewMockAVSWriter creates a new mock instance. +func NewMockAVSWriter(ctrl *gomock.Controller) *MockAVSWriter { + mock := &MockAVSWriter{ctrl: ctrl} + mock.recorder = &MockAVSWriterMockRecorder{mock} return mock } // EXPECT returns an object that allows the caller to indicate expected use. -func (m *MockWriter) EXPECT() *MockWriterMockRecorder { +func (m *MockAVSWriter) EXPECT() *MockAVSWriterMockRecorder { return m.recorder } // DeregisterOperator mocks base method. -func (m *MockWriter) DeregisterOperator(arg0 context.Context, arg1 types.QuorumNums, arg2 contractRegistryCoordinator.BN254G1Point) (*types0.Receipt, error) { +func (m *MockAVSWriter) DeregisterOperator(arg0 context.Context, arg1 types.QuorumNums, arg2 contractRegistryCoordinator.BN254G1Point) (*types0.Receipt, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DeregisterOperator", arg0, arg1, arg2) ret0, _ := ret[0].(*types0.Receipt) @@ -56,13 +56,13 @@ func (m *MockWriter) DeregisterOperator(arg0 context.Context, arg1 types.QuorumN } // DeregisterOperator indicates an expected call of DeregisterOperator. -func (mr *MockWriterMockRecorder) DeregisterOperator(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAVSWriterMockRecorder) DeregisterOperator(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeregisterOperator", reflect.TypeOf((*MockWriter)(nil).DeregisterOperator), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeregisterOperator", reflect.TypeOf((*MockAVSWriter)(nil).DeregisterOperator), arg0, arg1, arg2) } // RegisterOperator mocks base method. -func (m *MockWriter) RegisterOperator(arg0 context.Context, arg1 *ecdsa.PrivateKey, arg2 *bls.KeyPair, arg3 types.QuorumNums, arg4 string) (*types0.Receipt, error) { +func (m *MockAVSWriter) RegisterOperator(arg0 context.Context, arg1 *ecdsa.PrivateKey, arg2 *bls.KeyPair, arg3 types.QuorumNums, arg4 string) (*types0.Receipt, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RegisterOperator", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(*types0.Receipt) @@ -71,13 +71,13 @@ func (m *MockWriter) RegisterOperator(arg0 context.Context, arg1 *ecdsa.PrivateK } // RegisterOperator indicates an expected call of RegisterOperator. -func (mr *MockWriterMockRecorder) RegisterOperator(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { +func (mr *MockAVSWriterMockRecorder) RegisterOperator(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterOperator", reflect.TypeOf((*MockWriter)(nil).RegisterOperator), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterOperator", reflect.TypeOf((*MockAVSWriter)(nil).RegisterOperator), arg0, arg1, arg2, arg3, arg4) } // RegisterOperatorInQuorumWithAVSRegistryCoordinator mocks base method. -func (m *MockWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator(arg0 context.Context, arg1 *ecdsa.PrivateKey, arg2 [32]byte, arg3 *big.Int, arg4 *bls.KeyPair, arg5 types.QuorumNums, arg6 string) (*types0.Receipt, error) { +func (m *MockAVSWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator(arg0 context.Context, arg1 *ecdsa.PrivateKey, arg2 [32]byte, arg3 *big.Int, arg4 *bls.KeyPair, arg5 types.QuorumNums, arg6 string) (*types0.Receipt, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RegisterOperatorInQuorumWithAVSRegistryCoordinator", arg0, arg1, arg2, arg3, arg4, arg5, arg6) ret0, _ := ret[0].(*types0.Receipt) @@ -86,13 +86,13 @@ func (m *MockWriter) RegisterOperatorInQuorumWithAVSRegistryCoordinator(arg0 con } // RegisterOperatorInQuorumWithAVSRegistryCoordinator indicates an expected call of RegisterOperatorInQuorumWithAVSRegistryCoordinator. -func (mr *MockWriterMockRecorder) RegisterOperatorInQuorumWithAVSRegistryCoordinator(arg0, arg1, arg2, arg3, arg4, arg5, arg6 any) *gomock.Call { +func (mr *MockAVSWriterMockRecorder) RegisterOperatorInQuorumWithAVSRegistryCoordinator(arg0, arg1, arg2, arg3, arg4, arg5, arg6 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterOperatorInQuorumWithAVSRegistryCoordinator", reflect.TypeOf((*MockWriter)(nil).RegisterOperatorInQuorumWithAVSRegistryCoordinator), arg0, arg1, arg2, arg3, arg4, arg5, arg6) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterOperatorInQuorumWithAVSRegistryCoordinator", reflect.TypeOf((*MockAVSWriter)(nil).RegisterOperatorInQuorumWithAVSRegistryCoordinator), arg0, arg1, arg2, arg3, arg4, arg5, arg6) } // UpdateStakesOfEntireOperatorSetForQuorums mocks base method. -func (m *MockWriter) UpdateStakesOfEntireOperatorSetForQuorums(arg0 context.Context, arg1 [][]common.Address, arg2 types.QuorumNums) (*types0.Receipt, error) { +func (m *MockAVSWriter) UpdateStakesOfEntireOperatorSetForQuorums(arg0 context.Context, arg1 [][]common.Address, arg2 types.QuorumNums) (*types0.Receipt, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateStakesOfEntireOperatorSetForQuorums", arg0, arg1, arg2) ret0, _ := ret[0].(*types0.Receipt) @@ -101,13 +101,13 @@ func (m *MockWriter) UpdateStakesOfEntireOperatorSetForQuorums(arg0 context.Cont } // UpdateStakesOfEntireOperatorSetForQuorums indicates an expected call of UpdateStakesOfEntireOperatorSetForQuorums. -func (mr *MockWriterMockRecorder) UpdateStakesOfEntireOperatorSetForQuorums(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAVSWriterMockRecorder) UpdateStakesOfEntireOperatorSetForQuorums(arg0, arg1, arg2 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStakesOfEntireOperatorSetForQuorums", reflect.TypeOf((*MockWriter)(nil).UpdateStakesOfEntireOperatorSetForQuorums), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStakesOfEntireOperatorSetForQuorums", reflect.TypeOf((*MockAVSWriter)(nil).UpdateStakesOfEntireOperatorSetForQuorums), arg0, arg1, arg2) } // UpdateStakesOfOperatorSubsetForAllQuorums mocks base method. -func (m *MockWriter) UpdateStakesOfOperatorSubsetForAllQuorums(arg0 context.Context, arg1 []common.Address) (*types0.Receipt, error) { +func (m *MockAVSWriter) UpdateStakesOfOperatorSubsetForAllQuorums(arg0 context.Context, arg1 []common.Address) (*types0.Receipt, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateStakesOfOperatorSubsetForAllQuorums", arg0, arg1) ret0, _ := ret[0].(*types0.Receipt) @@ -116,7 +116,7 @@ func (m *MockWriter) UpdateStakesOfOperatorSubsetForAllQuorums(arg0 context.Cont } // UpdateStakesOfOperatorSubsetForAllQuorums indicates an expected call of UpdateStakesOfOperatorSubsetForAllQuorums. -func (mr *MockWriterMockRecorder) UpdateStakesOfOperatorSubsetForAllQuorums(arg0, arg1 any) *gomock.Call { +func (mr *MockAVSWriterMockRecorder) UpdateStakesOfOperatorSubsetForAllQuorums(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStakesOfOperatorSubsetForAllQuorums", reflect.TypeOf((*MockWriter)(nil).UpdateStakesOfOperatorSubsetForAllQuorums), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateStakesOfOperatorSubsetForAllQuorums", reflect.TypeOf((*MockAVSWriter)(nil).UpdateStakesOfOperatorSubsetForAllQuorums), arg0, arg1) } diff --git a/metrics/collectors/economic/economic_test.go b/metrics/collectors/economic/economic_test.go index 180701aa..23bc831d 100644 --- a/metrics/collectors/economic/economic_test.go +++ b/metrics/collectors/economic/economic_test.go @@ -28,7 +28,7 @@ func TestEconomicCollector(t *testing.T) { elReader := mocks.NewMockELReader(mockCtrl) elReader.EXPECT().OperatorIsFrozen(gomock.Any(), operatorAddr).Return(false, nil) - avsRegistryReader := mocks.NewMockAvsRegistryReader(mockCtrl) + avsRegistryReader := mocks.NewMockAVSReader(mockCtrl) avsRegistryReader.EXPECT().GetOperatorId(gomock.Any(), operatorAddr).Return(operatorId, nil) avsRegistryReader.EXPECT().GetOperatorStakeInQuorumsOfOperatorAtCurrentBlock(gomock.Any(), gomock.Any()).Return( map[types.QuorumNum]*big.Int{ diff --git a/services/avsregistry/avsregistry_chaincaller_test.go b/services/avsregistry/avsregistry_chaincaller_test.go index c3cd7fc5..8b2cbde0 100644 --- a/services/avsregistry/avsregistry_chaincaller_test.go +++ b/services/avsregistry/avsregistry_chaincaller_test.go @@ -39,14 +39,14 @@ func TestAvsRegistryServiceChainCaller_getOperatorPubkeys(t *testing.T) { // TODO(samlaf): add error test cases var tests = []struct { name string - mocksInitializationFunc func(*chainiomocks.MockAvsRegistryReader, *servicemocks.MockOperatorsInfoService) + mocksInitializationFunc func(*chainiomocks.MockAVSReader, *servicemocks.MockOperatorsInfoService) queryOperatorId types.OperatorId wantErr error wantOperatorInfo types.OperatorInfo }{ { name: "should return operator info", - mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAvsRegistryReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { + mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAVSReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { mockAvsRegistryReader.EXPECT().GetOperatorFromId(gomock.Any(), testOperator.operatorId).Return(testOperator.operatorAddr, nil) mockOperatorsInfoService.EXPECT().GetOperatorInfo(gomock.Any(), testOperator.operatorAddr).Return(testOperator.operatorInfo, true) }, @@ -60,7 +60,7 @@ func TestAvsRegistryServiceChainCaller_getOperatorPubkeys(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // Create mocks mockCtrl := gomock.NewController(t) - mockAvsRegistryReader := chainiomocks.NewMockAvsRegistryReader(mockCtrl) + mockAvsRegistryReader := chainiomocks.NewMockAVSReader(mockCtrl) mockOperatorsInfoService := servicemocks.NewMockOperatorsInfoService(mockCtrl) if tt.mocksInitializationFunc != nil { @@ -97,7 +97,7 @@ func TestAvsRegistryServiceChainCaller_GetOperatorsAvsState(t *testing.T) { var tests = []struct { name string - mocksInitializationFunc func(*chainiomocks.MockAvsRegistryReader, *servicemocks.MockOperatorsInfoService) + mocksInitializationFunc func(*chainiomocks.MockAVSReader, *servicemocks.MockOperatorsInfoService) queryQuorumNumbers types.QuorumNums queryBlockNum types.BlockNum wantErr error @@ -105,7 +105,7 @@ func TestAvsRegistryServiceChainCaller_GetOperatorsAvsState(t *testing.T) { }{ { name: "should return operatorsAvsState", - mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAvsRegistryReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { + mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAVSReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { mockAvsRegistryReader.EXPECT().GetOperatorsStakeInQuorumsAtBlock(gomock.Any(), types.QuorumNums{1}, types.BlockNum(1)).Return([][]opstateretrievar.OperatorStateRetrieverOperator{ { { @@ -135,7 +135,7 @@ func TestAvsRegistryServiceChainCaller_GetOperatorsAvsState(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // Create mocks mockCtrl := gomock.NewController(t) - mockAvsRegistryReader := chainiomocks.NewMockAvsRegistryReader(mockCtrl) + mockAvsRegistryReader := chainiomocks.NewMockAVSReader(mockCtrl) mockOperatorsInfoService := servicemocks.NewMockOperatorsInfoService(mockCtrl) if tt.mocksInitializationFunc != nil { @@ -172,7 +172,7 @@ func TestAvsRegistryServiceChainCaller_GetQuorumsAvsState(t *testing.T) { var tests = []struct { name string - mocksInitializationFunc func(*chainiomocks.MockAvsRegistryReader, *servicemocks.MockOperatorsInfoService) + mocksInitializationFunc func(*chainiomocks.MockAVSReader, *servicemocks.MockOperatorsInfoService) queryQuorumNumbers types.QuorumNums queryBlockNum types.BlockNum wantErr error @@ -180,7 +180,7 @@ func TestAvsRegistryServiceChainCaller_GetQuorumsAvsState(t *testing.T) { }{ { name: "should return operatorsAvsState", - mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAvsRegistryReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { + mocksInitializationFunc: func(mockAvsRegistryReader *chainiomocks.MockAVSReader, mockOperatorsInfoService *servicemocks.MockOperatorsInfoService) { mockAvsRegistryReader.EXPECT().GetOperatorsStakeInQuorumsAtBlock(gomock.Any(), types.QuorumNums{1}, types.BlockNum(1)).Return([][]opstateretrievar.OperatorStateRetrieverOperator{ { { @@ -210,7 +210,7 @@ func TestAvsRegistryServiceChainCaller_GetQuorumsAvsState(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // Create mocks mockCtrl := gomock.NewController(t) - mockAvsRegistryReader := chainiomocks.NewMockAvsRegistryReader(mockCtrl) + mockAvsRegistryReader := chainiomocks.NewMockAVSReader(mockCtrl) mockOperatorsInfoService := servicemocks.NewMockOperatorsInfoService(mockCtrl) if tt.mocksInitializationFunc != nil { diff --git a/services/operatorsinfo/operatorsinfo_inmemory_test.go b/services/operatorsinfo/operatorsinfo_inmemory_test.go index 0034d579..c0322223 100644 --- a/services/operatorsinfo/operatorsinfo_inmemory_test.go +++ b/services/operatorsinfo/operatorsinfo_inmemory_test.go @@ -48,14 +48,14 @@ func TestGetOperatorInfo(t *testing.T) { // Define tests var tests = []struct { name string - mocksInitializationFunc func(*mocks.MockAvsRegistrySubscriber, *mocks.MockAvsRegistryReader, *mocks.MockSubscription) + mocksInitializationFunc func(*mocks.MockAVSSubscriber, *mocks.MockAVSReader, *mocks.MockSubscription) queryOperatorAddr common.Address wantOperatorFound bool wantOperatorInfo types.OperatorInfo }{ { name: "should return false if operator not found", - mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAvsRegistrySubscriber, mockAvsReader *mocks.MockAvsRegistryReader, mockSubscription *mocks.MockSubscription) { + mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAVSSubscriber, mockAvsReader *mocks.MockAVSReader, mockSubscription *mocks.MockSubscription) { errC := make(chan error) mockSubscription.EXPECT().Err().AnyTimes().Return(errC) mockAvsRegistrySubscriber.EXPECT().SubscribeToNewPubkeyRegistrations().Return(nil, mockSubscription, nil) @@ -69,7 +69,7 @@ func TestGetOperatorInfo(t *testing.T) { }, { name: "should return operator info found via query", - mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAvsRegistrySubscriber, mockAvsReader *mocks.MockAvsRegistryReader, mockSubscription *mocks.MockSubscription) { + mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAVSSubscriber, mockAvsReader *mocks.MockAVSReader, mockSubscription *mocks.MockSubscription) { errC := make(chan error) mockSubscription.EXPECT().Err().AnyTimes().Return(errC) mockAvsRegistrySubscriber.EXPECT().SubscribeToNewPubkeyRegistrations().Return(nil, mockSubscription, nil) @@ -87,7 +87,7 @@ func TestGetOperatorInfo(t *testing.T) { }, { name: "should return operator info found via subscription", - mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAvsRegistrySubscriber, mockAvsReader *mocks.MockAvsRegistryReader, mockSubscription *mocks.MockSubscription) { + mocksInitializationFunc: func(mockAvsRegistrySubscriber *mocks.MockAVSSubscriber, mockAvsReader *mocks.MockAVSReader, mockSubscription *mocks.MockSubscription) { errC := make(chan error) pubkeyRegistrationEventC := make(chan *apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration, 1) pubkeyRegistrationEvent := &apkregistrybindings.ContractBLSApkRegistryNewPubkeyRegistration{ @@ -121,8 +121,8 @@ func TestGetOperatorInfo(t *testing.T) { t.Run(tt.name, func(t *testing.T) { // Create mocks mockCtrl := gomock.NewController(t) - mockAvsRegistrySubscriber := mocks.NewMockAvsRegistrySubscriber(mockCtrl) - mockAvsReader := mocks.NewMockAvsRegistryReader(mockCtrl) + mockAvsRegistrySubscriber := mocks.NewMockAVSSubscriber(mockCtrl) + mockAvsReader := mocks.NewMockAVSReader(mockCtrl) mockSubscription := mocks.NewMockSubscription(mockCtrl) if tt.mocksInitializationFunc != nil {