diff --git a/bridgesync/mocks/bridge_contractor.go b/bridgesync/mocks/bridge_contractor.go deleted file mode 100644 index fd559850..00000000 --- a/bridgesync/mocks/bridge_contractor.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by mockery. DO NOT EDIT. - -package mocks_bridgesync - -import ( - context "context" - - mock "github.com/stretchr/testify/mock" -) - -// BridgeContractor is an autogenerated mock type for the BridgeContractor type -type BridgeContractor struct { - mock.Mock -} - -type BridgeContractor_Expecter struct { - mock *mock.Mock -} - -func (_m *BridgeContractor) EXPECT() *BridgeContractor_Expecter { - return &BridgeContractor_Expecter{mock: &_m.Mock} -} - -// LastUpdatedDepositCount provides a mock function with given fields: ctx, BlockNumber -func (_m *BridgeContractor) LastUpdatedDepositCount(ctx context.Context, BlockNumber uint64) (uint32, error) { - ret := _m.Called(ctx, BlockNumber) - - if len(ret) == 0 { - panic("no return value specified for LastUpdatedDepositCount") - } - - var r0 uint32 - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, uint64) (uint32, error)); ok { - return rf(ctx, BlockNumber) - } - if rf, ok := ret.Get(0).(func(context.Context, uint64) uint32); ok { - r0 = rf(ctx, BlockNumber) - } else { - r0 = ret.Get(0).(uint32) - } - - if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { - r1 = rf(ctx, BlockNumber) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// BridgeContractor_LastUpdatedDepositCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LastUpdatedDepositCount' -type BridgeContractor_LastUpdatedDepositCount_Call struct { - *mock.Call -} - -// LastUpdatedDepositCount is a helper method to define mock.On call -// - ctx context.Context -// - BlockNumber uint64 -func (_e *BridgeContractor_Expecter) LastUpdatedDepositCount(ctx interface{}, BlockNumber interface{}) *BridgeContractor_LastUpdatedDepositCount_Call { - return &BridgeContractor_LastUpdatedDepositCount_Call{Call: _e.mock.On("LastUpdatedDepositCount", ctx, BlockNumber)} -} - -func (_c *BridgeContractor_LastUpdatedDepositCount_Call) Run(run func(ctx context.Context, BlockNumber uint64)) *BridgeContractor_LastUpdatedDepositCount_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(uint64)) - }) - return _c -} - -func (_c *BridgeContractor_LastUpdatedDepositCount_Call) Return(_a0 uint32, _a1 error) *BridgeContractor_LastUpdatedDepositCount_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *BridgeContractor_LastUpdatedDepositCount_Call) RunAndReturn(run func(context.Context, uint64) (uint32, error)) *BridgeContractor_LastUpdatedDepositCount_Call { - _c.Call.Return(run) - return _c -} - -// NewBridgeContractor creates a new instance of BridgeContractor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. -// The first argument is typically a *testing.T value. -func NewBridgeContractor(t interface { - mock.TestingT - Cleanup(func()) -}) *BridgeContractor { - mock := &BridgeContractor{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/l1infotreesync/mocks/eth_clienter.go b/l1infotreesync/mocks/eth_clienter.go index 3e5897f9..270c40d9 100644 --- a/l1infotreesync/mocks/eth_clienter.go +++ b/l1infotreesync/mocks/eth_clienter.go @@ -1083,4 +1083,4 @@ func NewEthClienter(t interface { t.Cleanup(func() { mock.AssertExpectations(t) }) return mock -} \ No newline at end of file +} diff --git a/test/Makefile b/test/Makefile index 32a2a89d..b76fdb0a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,14 +1,14 @@ .PHONY: generate-mocks -generate-mocks: generate-mocks-bridgesync generate-mocks-reorgdetector generate-mocks-sequencesender \ - generate-mocks-da generate-mocks-l1infotreesync generate-mocks-helpers \ - generate-mocks-sync generate-mocks-l1infotreesync generate-mocks-aggregator \ - generate-mocks-aggsender generate-mocks-agglayer generate-mocks-bridgesync - generate-mocks-sync generate-mocks-l1infotreesync generate-mocks-aggregator \ - generate-mocks-aggsender generate-mocks-agglayer generate-mocks-bridgesync +generate-mocks: generate-mocks-bridgesync generate-mocks-reorgdetector \ + generate-mocks-sequencesender generate-mocks-da \ + generate-mocks-l1infotreesync generate-mocks-helpers \ + generate-mocks-sync generate-mocks-aggregator \ + generate-mocks-aggsender generate-mocks-agglayer .PHONY: generate-mocks-bridgesync generate-mocks-bridgesync: ## Generates mocks for bridgesync, using mockery tool - export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=EthClienter --dir=../bridgesync --output=../bridgesync --outpkg=bridgesync --inpackage --structname=L2Mock --filename=mock_l2_test.go + rm -Rf ../bridgesync/mocks + export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../bridgesync --output ../bridgesync/mocks --outpkg mocks_bridgesync ${COMMON_MOCKERY_PARAMS} .PHONY: generate-mocks-reorgdetector generate-mocks-reorgdetector: ## Generates mocks for reorgdetector, using mockery tool @@ -39,10 +39,14 @@ generate-mocks-l1infotreesync: ## Generates mocks for l1infotreesync, using mock export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../l1infotreesync --output ../l1infotreesync/mocks --outpkg mocks_l1infotreesync ${COMMON_MOCKERY_PARAMS} export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=ReorgDetector --dir=../sync --output=../l1infotreesync/mocks --outpkg=mocks_l1infotreesync --structname=ReorgDetectorMock --filename=mock_reorgdetector.go -.PHONY: generate-mocks-aggoracle -generate-mocks-helpers: ## Generates mocks for helpers , using mockery tool +.PHONY: generate-mocks-helpers +generate-mocks-helpers: ## Generates mocks for helpers, using mockery tool export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=EthTxManager --dir=../aggoracle/chaingersender --output=./helpers --outpkg=helpers --structname=EthTxManagerMock --filename=mock_ethtxmanager.go +.PHONY: generate-mocks-aggoracle +generate-mocks-aggoracle: ## Generates mocks for aggoracle, using mockery tool + export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --dir ../aggoracle/chaingersender --output ../aggoracle/chaingersender/mocks --outpkg mocks ${COMMON_MOCKERY_PARAMS} + .PHONY: generate-mocks-sync generate-mocks-sync: ## Generates mocks for sync, using mockery tool export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=EthClienter --dir=../sync --output=../sync --outpkg=sync --inpackage --structname=L2Mock --filename=mock_l2_test.go ${COMMON_MOCKERY_PARAMS} @@ -70,13 +74,7 @@ generate-mocks-aggsender: ## Generates mocks for aggsender, using mockery tool .PHONY: generate-mocks-agglayer generate-mocks-agglayer: ## Generates mocks for agglayer, using mockery tool - export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=AgglayerClientInterface --dir=../agglayer --output=../agglayer --outpkg=agglayer --inpackage --structname=AgglayerClientMock --filename=mock_agglayer_client.go ${COMMON_MOCKERY_PARAMS} - -.PHONY: generate-mocks-bridgesync -generate-mocks-bridgesync: ## Generates mocks for bridgesync, using mockery tool - rm -Rf ../bridgesync/mocks - export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --all --case snake --dir ../bridgesync --output ../bridgesync/mocks --outpkg mocks_bridgesync ${COMMON_MOCKERY_PARAMS} - + export "GOROOT=$$(go env GOROOT)" && $$(go env GOPATH)/bin/mockery --name=AgglayerClientInterface --dir=../agglayer --output=../agglayer --outpkg=agglayer --inpackage --structname=AgglayerClientMock --filename=mock_agglayer_client.go ${COMMON_MOCKERY_PARAMS} .PHONY: test-e2e-fork9-validium test-e2e-fork9-validium: stop diff --git a/test/helpers/mock_ethtxmanager.go b/test/helpers/mock_ethtxmanager.go index adb21f26..ea943e53 100644 --- a/test/helpers/mock_ethtxmanager.go +++ b/test/helpers/mock_ethtxmanager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.45.0. DO NOT EDIT. +// Code generated by mockery v2.39.0. DO NOT EDIT. package helpers @@ -9,11 +9,11 @@ import ( context "context" - ethtxtypes "github.com/0xPolygon/zkevm-ethtx-manager/types" - mock "github.com/stretchr/testify/mock" types "github.com/ethereum/go-ethereum/core/types" + + zkevm_ethtx_managertypes "github.com/0xPolygon/zkevm-ethtx-manager/types" ) // EthTxManagerMock is an autogenerated mock type for the EthTxManager type @@ -70,22 +70,22 @@ func (_m *EthTxManagerMock) Remove(ctx context.Context, id common.Hash) error { } // Result provides a mock function with given fields: ctx, id -func (_m *EthTxManagerMock) Result(ctx context.Context, id common.Hash) (ethtxtypes.MonitoredTxResult, error) { +func (_m *EthTxManagerMock) Result(ctx context.Context, id common.Hash) (zkevm_ethtx_managertypes.MonitoredTxResult, error) { ret := _m.Called(ctx, id) if len(ret) == 0 { panic("no return value specified for Result") } - var r0 ethtxtypes.MonitoredTxResult + var r0 zkevm_ethtx_managertypes.MonitoredTxResult var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (ethtxtypes.MonitoredTxResult, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) (zkevm_ethtx_managertypes.MonitoredTxResult, error)); ok { return rf(ctx, id) } - if rf, ok := ret.Get(0).(func(context.Context, common.Hash) ethtxtypes.MonitoredTxResult); ok { + if rf, ok := ret.Get(0).(func(context.Context, common.Hash) zkevm_ethtx_managertypes.MonitoredTxResult); ok { r0 = rf(ctx, id) } else { - r0 = ret.Get(0).(ethtxtypes.MonitoredTxResult) + r0 = ret.Get(0).(zkevm_ethtx_managertypes.MonitoredTxResult) } if rf, ok := ret.Get(1).(func(context.Context, common.Hash) error); ok { @@ -98,27 +98,27 @@ func (_m *EthTxManagerMock) Result(ctx context.Context, id common.Hash) (ethtxty } // ResultsByStatus provides a mock function with given fields: ctx, statuses -func (_m *EthTxManagerMock) ResultsByStatus(ctx context.Context, statuses []ethtxtypes.MonitoredTxStatus) ([]ethtxtypes.MonitoredTxResult, error) { +func (_m *EthTxManagerMock) ResultsByStatus(ctx context.Context, statuses []zkevm_ethtx_managertypes.MonitoredTxStatus) ([]zkevm_ethtx_managertypes.MonitoredTxResult, error) { ret := _m.Called(ctx, statuses) if len(ret) == 0 { panic("no return value specified for ResultsByStatus") } - var r0 []ethtxtypes.MonitoredTxResult + var r0 []zkevm_ethtx_managertypes.MonitoredTxResult var r1 error - if rf, ok := ret.Get(0).(func(context.Context, []ethtxtypes.MonitoredTxStatus) ([]ethtxtypes.MonitoredTxResult, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, []zkevm_ethtx_managertypes.MonitoredTxStatus) ([]zkevm_ethtx_managertypes.MonitoredTxResult, error)); ok { return rf(ctx, statuses) } - if rf, ok := ret.Get(0).(func(context.Context, []ethtxtypes.MonitoredTxStatus) []ethtxtypes.MonitoredTxResult); ok { + if rf, ok := ret.Get(0).(func(context.Context, []zkevm_ethtx_managertypes.MonitoredTxStatus) []zkevm_ethtx_managertypes.MonitoredTxResult); ok { r0 = rf(ctx, statuses) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]ethtxtypes.MonitoredTxResult) + r0 = ret.Get(0).([]zkevm_ethtx_managertypes.MonitoredTxResult) } } - if rf, ok := ret.Get(1).(func(context.Context, []ethtxtypes.MonitoredTxStatus) error); ok { + if rf, ok := ret.Get(1).(func(context.Context, []zkevm_ethtx_managertypes.MonitoredTxStatus) error); ok { r1 = rf(ctx, statuses) } else { r1 = ret.Error(1)