diff --git a/synchronizer/common/syncinterfaces/mocks/etherman_pre_rollup.go b/synchronizer/common/syncinterfaces/mocks/etherman_pre_rollup.go new file mode 100644 index 0000000000..3599152aee --- /dev/null +++ b/synchronizer/common/syncinterfaces/mocks/etherman_pre_rollup.go @@ -0,0 +1,166 @@ +// Code generated by mockery. DO NOT EDIT. + +package mock_syncinterfaces + +import ( + context "context" + + common "github.com/ethereum/go-ethereum/common" + + etherman "github.com/0xPolygonHermez/zkevm-node/etherman" + + mock "github.com/stretchr/testify/mock" +) + +// EthermanPreRollup is an autogenerated mock type for the EthermanPreRollup type +type EthermanPreRollup struct { + mock.Mock +} + +type EthermanPreRollup_Expecter struct { + mock *mock.Mock +} + +func (_m *EthermanPreRollup) EXPECT() *EthermanPreRollup_Expecter { + return &EthermanPreRollup_Expecter{mock: &_m.Mock} +} + +// GetL1BlockUpgradeLxLy provides a mock function with given fields: ctx, genesisBlock +func (_m *EthermanPreRollup) GetL1BlockUpgradeLxLy(ctx context.Context, genesisBlock uint64) (uint64, error) { + ret := _m.Called(ctx, genesisBlock) + + if len(ret) == 0 { + panic("no return value specified for GetL1BlockUpgradeLxLy") + } + + var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (uint64, error)); ok { + return rf(ctx, genesisBlock) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64) uint64); ok { + r0 = rf(ctx, genesisBlock) + } else { + r0 = ret.Get(0).(uint64) + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { + r1 = rf(ctx, genesisBlock) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// EthermanPreRollup_GetL1BlockUpgradeLxLy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetL1BlockUpgradeLxLy' +type EthermanPreRollup_GetL1BlockUpgradeLxLy_Call struct { + *mock.Call +} + +// GetL1BlockUpgradeLxLy is a helper method to define mock.On call +// - ctx context.Context +// - genesisBlock uint64 +func (_e *EthermanPreRollup_Expecter) GetL1BlockUpgradeLxLy(ctx interface{}, genesisBlock interface{}) *EthermanPreRollup_GetL1BlockUpgradeLxLy_Call { + return &EthermanPreRollup_GetL1BlockUpgradeLxLy_Call{Call: _e.mock.On("GetL1BlockUpgradeLxLy", ctx, genesisBlock)} +} + +func (_c *EthermanPreRollup_GetL1BlockUpgradeLxLy_Call) Run(run func(ctx context.Context, genesisBlock uint64)) *EthermanPreRollup_GetL1BlockUpgradeLxLy_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64)) + }) + return _c +} + +func (_c *EthermanPreRollup_GetL1BlockUpgradeLxLy_Call) Return(_a0 uint64, _a1 error) *EthermanPreRollup_GetL1BlockUpgradeLxLy_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *EthermanPreRollup_GetL1BlockUpgradeLxLy_Call) RunAndReturn(run func(context.Context, uint64) (uint64, error)) *EthermanPreRollup_GetL1BlockUpgradeLxLy_Call { + _c.Call.Return(run) + return _c +} + +// GetRollupInfoByBlockRangePreviousRollupGenesis provides a mock function with given fields: ctx, fromBlock, toBlock +func (_m *EthermanPreRollup) GetRollupInfoByBlockRangePreviousRollupGenesis(ctx context.Context, fromBlock uint64, toBlock *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error) { + ret := _m.Called(ctx, fromBlock, toBlock) + + if len(ret) == 0 { + panic("no return value specified for GetRollupInfoByBlockRangePreviousRollupGenesis") + } + + var r0 []etherman.Block + var r1 map[common.Hash][]etherman.Order + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error)); ok { + return rf(ctx, fromBlock, toBlock) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, *uint64) []etherman.Block); ok { + r0 = rf(ctx, fromBlock, toBlock) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]etherman.Block) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, *uint64) map[common.Hash][]etherman.Order); ok { + r1 = rf(ctx, fromBlock, toBlock) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(map[common.Hash][]etherman.Order) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, uint64, *uint64) error); ok { + r2 = rf(ctx, fromBlock, toBlock) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRollupInfoByBlockRangePreviousRollupGenesis' +type EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call struct { + *mock.Call +} + +// GetRollupInfoByBlockRangePreviousRollupGenesis is a helper method to define mock.On call +// - ctx context.Context +// - fromBlock uint64 +// - toBlock *uint64 +func (_e *EthermanPreRollup_Expecter) GetRollupInfoByBlockRangePreviousRollupGenesis(ctx interface{}, fromBlock interface{}, toBlock interface{}) *EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call { + return &EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call{Call: _e.mock.On("GetRollupInfoByBlockRangePreviousRollupGenesis", ctx, fromBlock, toBlock)} +} + +func (_c *EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call) Run(run func(ctx context.Context, fromBlock uint64, toBlock *uint64)) *EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(*uint64)) + }) + return _c +} + +func (_c *EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call) Return(_a0 []etherman.Block, _a1 map[common.Hash][]etherman.Order, _a2 error) *EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call) RunAndReturn(run func(context.Context, uint64, *uint64) ([]etherman.Block, map[common.Hash][]etherman.Order, error)) *EthermanPreRollup_GetRollupInfoByBlockRangePreviousRollupGenesis_Call { + _c.Call.Return(run) + return _c +} + +// NewEthermanPreRollup creates a new instance of EthermanPreRollup. 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 NewEthermanPreRollup(t interface { + mock.TestingT + Cleanup(func()) +}) *EthermanPreRollup { + mock := &EthermanPreRollup{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}