diff --git a/.mockery.yaml b/.mockery.yaml index 7ad18b97802..e49546519fd 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -34,9 +34,6 @@ packages: interfaces: Dispatcher: Receiver: - github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders: - interfaces: - ORM: github.com/smartcontractkit/chainlink/v2/core/chains/evm/log: interfaces: Broadcaster: @@ -48,6 +45,11 @@ packages: interfaces: LogPoller: github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm: + config: + dir: core/chains/evm/txm + outpkg: txm + mockname: "mock{{ .InterfaceName }}" + filename: "mock_{{ .InterfaceName | snakecase }}_test.go" interfaces: Client: TxStore: diff --git a/core/chains/evm/forwarders/mocks/orm.go b/core/chains/evm/forwarders/mocks/orm.go deleted file mode 100644 index 86783dc3b1e..00000000000 --- a/core/chains/evm/forwarders/mocks/orm.go +++ /dev/null @@ -1,335 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package mocks - -import ( - common "github.com/ethereum/go-ethereum/common" - big "github.com/smartcontractkit/chainlink-integrations/evm/utils/big" - - context "context" - - forwarders "github.com/smartcontractkit/chainlink/v2/core/chains/evm/forwarders" - - mock "github.com/stretchr/testify/mock" - - sqlutil "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" -) - -// ORM is an autogenerated mock type for the ORM type -type ORM struct { - mock.Mock -} - -type ORM_Expecter struct { - mock *mock.Mock -} - -func (_m *ORM) EXPECT() *ORM_Expecter { - return &ORM_Expecter{mock: &_m.Mock} -} - -// CreateForwarder provides a mock function with given fields: ctx, addr, evmChainId -func (_m *ORM) CreateForwarder(ctx context.Context, addr common.Address, evmChainId big.Big) (forwarders.Forwarder, error) { - ret := _m.Called(ctx, addr, evmChainId) - - if len(ret) == 0 { - panic("no return value specified for CreateForwarder") - } - - var r0 forwarders.Forwarder - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address, big.Big) (forwarders.Forwarder, error)); ok { - return rf(ctx, addr, evmChainId) - } - if rf, ok := ret.Get(0).(func(context.Context, common.Address, big.Big) forwarders.Forwarder); ok { - r0 = rf(ctx, addr, evmChainId) - } else { - r0 = ret.Get(0).(forwarders.Forwarder) - } - - if rf, ok := ret.Get(1).(func(context.Context, common.Address, big.Big) error); ok { - r1 = rf(ctx, addr, evmChainId) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ORM_CreateForwarder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateForwarder' -type ORM_CreateForwarder_Call struct { - *mock.Call -} - -// CreateForwarder is a helper method to define mock.On call -// - ctx context.Context -// - addr common.Address -// - evmChainId big.Big -func (_e *ORM_Expecter) CreateForwarder(ctx interface{}, addr interface{}, evmChainId interface{}) *ORM_CreateForwarder_Call { - return &ORM_CreateForwarder_Call{Call: _e.mock.On("CreateForwarder", ctx, addr, evmChainId)} -} - -func (_c *ORM_CreateForwarder_Call) Run(run func(ctx context.Context, addr common.Address, evmChainId big.Big)) *ORM_CreateForwarder_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(common.Address), args[2].(big.Big)) - }) - return _c -} - -func (_c *ORM_CreateForwarder_Call) Return(fwd forwarders.Forwarder, err error) *ORM_CreateForwarder_Call { - _c.Call.Return(fwd, err) - return _c -} - -func (_c *ORM_CreateForwarder_Call) RunAndReturn(run func(context.Context, common.Address, big.Big) (forwarders.Forwarder, error)) *ORM_CreateForwarder_Call { - _c.Call.Return(run) - return _c -} - -// DeleteForwarder provides a mock function with given fields: ctx, id, cleanup -func (_m *ORM) DeleteForwarder(ctx context.Context, id int64, cleanup func(sqlutil.DataSource, int64, common.Address) error) error { - ret := _m.Called(ctx, id, cleanup) - - if len(ret) == 0 { - panic("no return value specified for DeleteForwarder") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, int64, func(sqlutil.DataSource, int64, common.Address) error) error); ok { - r0 = rf(ctx, id, cleanup) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// ORM_DeleteForwarder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteForwarder' -type ORM_DeleteForwarder_Call struct { - *mock.Call -} - -// DeleteForwarder is a helper method to define mock.On call -// - ctx context.Context -// - id int64 -// - cleanup func(sqlutil.DataSource , int64 , common.Address) error -func (_e *ORM_Expecter) DeleteForwarder(ctx interface{}, id interface{}, cleanup interface{}) *ORM_DeleteForwarder_Call { - return &ORM_DeleteForwarder_Call{Call: _e.mock.On("DeleteForwarder", ctx, id, cleanup)} -} - -func (_c *ORM_DeleteForwarder_Call) Run(run func(ctx context.Context, id int64, cleanup func(sqlutil.DataSource, int64, common.Address) error)) *ORM_DeleteForwarder_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(int64), args[2].(func(sqlutil.DataSource, int64, common.Address) error)) - }) - return _c -} - -func (_c *ORM_DeleteForwarder_Call) Return(_a0 error) *ORM_DeleteForwarder_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *ORM_DeleteForwarder_Call) RunAndReturn(run func(context.Context, int64, func(sqlutil.DataSource, int64, common.Address) error) error) *ORM_DeleteForwarder_Call { - _c.Call.Return(run) - return _c -} - -// FindForwarders provides a mock function with given fields: ctx, offset, limit -func (_m *ORM) FindForwarders(ctx context.Context, offset int, limit int) ([]forwarders.Forwarder, int, error) { - ret := _m.Called(ctx, offset, limit) - - if len(ret) == 0 { - panic("no return value specified for FindForwarders") - } - - var r0 []forwarders.Forwarder - var r1 int - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, int, int) ([]forwarders.Forwarder, int, error)); ok { - return rf(ctx, offset, limit) - } - if rf, ok := ret.Get(0).(func(context.Context, int, int) []forwarders.Forwarder); ok { - r0 = rf(ctx, offset, limit) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]forwarders.Forwarder) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, int, int) int); ok { - r1 = rf(ctx, offset, limit) - } else { - r1 = ret.Get(1).(int) - } - - if rf, ok := ret.Get(2).(func(context.Context, int, int) error); ok { - r2 = rf(ctx, offset, limit) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// ORM_FindForwarders_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindForwarders' -type ORM_FindForwarders_Call struct { - *mock.Call -} - -// FindForwarders is a helper method to define mock.On call -// - ctx context.Context -// - offset int -// - limit int -func (_e *ORM_Expecter) FindForwarders(ctx interface{}, offset interface{}, limit interface{}) *ORM_FindForwarders_Call { - return &ORM_FindForwarders_Call{Call: _e.mock.On("FindForwarders", ctx, offset, limit)} -} - -func (_c *ORM_FindForwarders_Call) Run(run func(ctx context.Context, offset int, limit int)) *ORM_FindForwarders_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(int), args[2].(int)) - }) - return _c -} - -func (_c *ORM_FindForwarders_Call) Return(_a0 []forwarders.Forwarder, _a1 int, _a2 error) *ORM_FindForwarders_Call { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *ORM_FindForwarders_Call) RunAndReturn(run func(context.Context, int, int) ([]forwarders.Forwarder, int, error)) *ORM_FindForwarders_Call { - _c.Call.Return(run) - return _c -} - -// FindForwardersByChain provides a mock function with given fields: ctx, evmChainId -func (_m *ORM) FindForwardersByChain(ctx context.Context, evmChainId big.Big) ([]forwarders.Forwarder, error) { - ret := _m.Called(ctx, evmChainId) - - if len(ret) == 0 { - panic("no return value specified for FindForwardersByChain") - } - - var r0 []forwarders.Forwarder - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, big.Big) ([]forwarders.Forwarder, error)); ok { - return rf(ctx, evmChainId) - } - if rf, ok := ret.Get(0).(func(context.Context, big.Big) []forwarders.Forwarder); ok { - r0 = rf(ctx, evmChainId) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]forwarders.Forwarder) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, big.Big) error); ok { - r1 = rf(ctx, evmChainId) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ORM_FindForwardersByChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindForwardersByChain' -type ORM_FindForwardersByChain_Call struct { - *mock.Call -} - -// FindForwardersByChain is a helper method to define mock.On call -// - ctx context.Context -// - evmChainId big.Big -func (_e *ORM_Expecter) FindForwardersByChain(ctx interface{}, evmChainId interface{}) *ORM_FindForwardersByChain_Call { - return &ORM_FindForwardersByChain_Call{Call: _e.mock.On("FindForwardersByChain", ctx, evmChainId)} -} - -func (_c *ORM_FindForwardersByChain_Call) Run(run func(ctx context.Context, evmChainId big.Big)) *ORM_FindForwardersByChain_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(big.Big)) - }) - return _c -} - -func (_c *ORM_FindForwardersByChain_Call) Return(_a0 []forwarders.Forwarder, _a1 error) *ORM_FindForwardersByChain_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ORM_FindForwardersByChain_Call) RunAndReturn(run func(context.Context, big.Big) ([]forwarders.Forwarder, error)) *ORM_FindForwardersByChain_Call { - _c.Call.Return(run) - return _c -} - -// FindForwardersInListByChain provides a mock function with given fields: ctx, evmChainId, addrs -func (_m *ORM) FindForwardersInListByChain(ctx context.Context, evmChainId big.Big, addrs []common.Address) ([]forwarders.Forwarder, error) { - ret := _m.Called(ctx, evmChainId, addrs) - - if len(ret) == 0 { - panic("no return value specified for FindForwardersInListByChain") - } - - var r0 []forwarders.Forwarder - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, big.Big, []common.Address) ([]forwarders.Forwarder, error)); ok { - return rf(ctx, evmChainId, addrs) - } - if rf, ok := ret.Get(0).(func(context.Context, big.Big, []common.Address) []forwarders.Forwarder); ok { - r0 = rf(ctx, evmChainId, addrs) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]forwarders.Forwarder) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, big.Big, []common.Address) error); ok { - r1 = rf(ctx, evmChainId, addrs) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// ORM_FindForwardersInListByChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindForwardersInListByChain' -type ORM_FindForwardersInListByChain_Call struct { - *mock.Call -} - -// FindForwardersInListByChain is a helper method to define mock.On call -// - ctx context.Context -// - evmChainId big.Big -// - addrs []common.Address -func (_e *ORM_Expecter) FindForwardersInListByChain(ctx interface{}, evmChainId interface{}, addrs interface{}) *ORM_FindForwardersInListByChain_Call { - return &ORM_FindForwardersInListByChain_Call{Call: _e.mock.On("FindForwardersInListByChain", ctx, evmChainId, addrs)} -} - -func (_c *ORM_FindForwardersInListByChain_Call) Run(run func(ctx context.Context, evmChainId big.Big, addrs []common.Address)) *ORM_FindForwardersInListByChain_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(big.Big), args[2].([]common.Address)) - }) - return _c -} - -func (_c *ORM_FindForwardersInListByChain_Call) Return(_a0 []forwarders.Forwarder, _a1 error) *ORM_FindForwardersInListByChain_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *ORM_FindForwardersInListByChain_Call) RunAndReturn(run func(context.Context, big.Big, []common.Address) ([]forwarders.Forwarder, error)) *ORM_FindForwardersInListByChain_Call { - _c.Call.Return(run) - return _c -} - -// NewORM creates a new instance of ORM. 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 NewORM(t interface { - mock.TestingT - Cleanup(func()) -}) *ORM { - mock := &ORM{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/txm/mocks/attempt_builder.go b/core/chains/evm/txm/mock_attempt_builder_test.go similarity index 52% rename from core/chains/evm/txm/mocks/attempt_builder.go rename to core/chains/evm/txm/mock_attempt_builder_test.go index 91961e5d420..db0f036026c 100644 --- a/core/chains/evm/txm/mocks/attempt_builder.go +++ b/core/chains/evm/txm/mock_attempt_builder_test.go @@ -1,6 +1,6 @@ // Code generated by mockery v2.50.0. DO NOT EDIT. -package mocks +package txm import ( context "context" @@ -11,21 +11,21 @@ import ( types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" ) -// AttemptBuilder is an autogenerated mock type for the AttemptBuilder type -type AttemptBuilder struct { +// mockAttemptBuilder is an autogenerated mock type for the AttemptBuilder type +type mockAttemptBuilder struct { mock.Mock } -type AttemptBuilder_Expecter struct { +type mockAttemptBuilder_Expecter struct { mock *mock.Mock } -func (_m *AttemptBuilder) EXPECT() *AttemptBuilder_Expecter { - return &AttemptBuilder_Expecter{mock: &_m.Mock} +func (_m *mockAttemptBuilder) EXPECT() *mockAttemptBuilder_Expecter { + return &mockAttemptBuilder_Expecter{mock: &_m.Mock} } // NewAttempt provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *AttemptBuilder) NewAttempt(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 bool) (*types.Attempt, error) { +func (_m *mockAttemptBuilder) NewAttempt(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 bool) (*types.Attempt, error) { ret := _m.Called(_a0, _a1, _a2, _a3) if len(ret) == 0 { @@ -54,8 +54,8 @@ func (_m *AttemptBuilder) NewAttempt(_a0 context.Context, _a1 logger.Logger, _a2 return r0, r1 } -// AttemptBuilder_NewAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewAttempt' -type AttemptBuilder_NewAttempt_Call struct { +// mockAttemptBuilder_NewAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewAttempt' +type mockAttemptBuilder_NewAttempt_Call struct { *mock.Call } @@ -64,29 +64,29 @@ type AttemptBuilder_NewAttempt_Call struct { // - _a1 logger.Logger // - _a2 *types.Transaction // - _a3 bool -func (_e *AttemptBuilder_Expecter) NewAttempt(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *AttemptBuilder_NewAttempt_Call { - return &AttemptBuilder_NewAttempt_Call{Call: _e.mock.On("NewAttempt", _a0, _a1, _a2, _a3)} +func (_e *mockAttemptBuilder_Expecter) NewAttempt(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *mockAttemptBuilder_NewAttempt_Call { + return &mockAttemptBuilder_NewAttempt_Call{Call: _e.mock.On("NewAttempt", _a0, _a1, _a2, _a3)} } -func (_c *AttemptBuilder_NewAttempt_Call) Run(run func(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 bool)) *AttemptBuilder_NewAttempt_Call { +func (_c *mockAttemptBuilder_NewAttempt_Call) Run(run func(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 bool)) *mockAttemptBuilder_NewAttempt_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(logger.Logger), args[2].(*types.Transaction), args[3].(bool)) }) return _c } -func (_c *AttemptBuilder_NewAttempt_Call) Return(_a0 *types.Attempt, _a1 error) *AttemptBuilder_NewAttempt_Call { +func (_c *mockAttemptBuilder_NewAttempt_Call) Return(_a0 *types.Attempt, _a1 error) *mockAttemptBuilder_NewAttempt_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *AttemptBuilder_NewAttempt_Call) RunAndReturn(run func(context.Context, logger.Logger, *types.Transaction, bool) (*types.Attempt, error)) *AttemptBuilder_NewAttempt_Call { +func (_c *mockAttemptBuilder_NewAttempt_Call) RunAndReturn(run func(context.Context, logger.Logger, *types.Transaction, bool) (*types.Attempt, error)) *mockAttemptBuilder_NewAttempt_Call { _c.Call.Return(run) return _c } // NewBumpAttempt provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *AttemptBuilder) NewBumpAttempt(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 types.Attempt) (*types.Attempt, error) { +func (_m *mockAttemptBuilder) NewBumpAttempt(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 types.Attempt) (*types.Attempt, error) { ret := _m.Called(_a0, _a1, _a2, _a3) if len(ret) == 0 { @@ -115,8 +115,8 @@ func (_m *AttemptBuilder) NewBumpAttempt(_a0 context.Context, _a1 logger.Logger, return r0, r1 } -// AttemptBuilder_NewBumpAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewBumpAttempt' -type AttemptBuilder_NewBumpAttempt_Call struct { +// mockAttemptBuilder_NewBumpAttempt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewBumpAttempt' +type mockAttemptBuilder_NewBumpAttempt_Call struct { *mock.Call } @@ -125,34 +125,34 @@ type AttemptBuilder_NewBumpAttempt_Call struct { // - _a1 logger.Logger // - _a2 *types.Transaction // - _a3 types.Attempt -func (_e *AttemptBuilder_Expecter) NewBumpAttempt(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *AttemptBuilder_NewBumpAttempt_Call { - return &AttemptBuilder_NewBumpAttempt_Call{Call: _e.mock.On("NewBumpAttempt", _a0, _a1, _a2, _a3)} +func (_e *mockAttemptBuilder_Expecter) NewBumpAttempt(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *mockAttemptBuilder_NewBumpAttempt_Call { + return &mockAttemptBuilder_NewBumpAttempt_Call{Call: _e.mock.On("NewBumpAttempt", _a0, _a1, _a2, _a3)} } -func (_c *AttemptBuilder_NewBumpAttempt_Call) Run(run func(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 types.Attempt)) *AttemptBuilder_NewBumpAttempt_Call { +func (_c *mockAttemptBuilder_NewBumpAttempt_Call) Run(run func(_a0 context.Context, _a1 logger.Logger, _a2 *types.Transaction, _a3 types.Attempt)) *mockAttemptBuilder_NewBumpAttempt_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(logger.Logger), args[2].(*types.Transaction), args[3].(types.Attempt)) }) return _c } -func (_c *AttemptBuilder_NewBumpAttempt_Call) Return(_a0 *types.Attempt, _a1 error) *AttemptBuilder_NewBumpAttempt_Call { +func (_c *mockAttemptBuilder_NewBumpAttempt_Call) Return(_a0 *types.Attempt, _a1 error) *mockAttemptBuilder_NewBumpAttempt_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *AttemptBuilder_NewBumpAttempt_Call) RunAndReturn(run func(context.Context, logger.Logger, *types.Transaction, types.Attempt) (*types.Attempt, error)) *AttemptBuilder_NewBumpAttempt_Call { +func (_c *mockAttemptBuilder_NewBumpAttempt_Call) RunAndReturn(run func(context.Context, logger.Logger, *types.Transaction, types.Attempt) (*types.Attempt, error)) *mockAttemptBuilder_NewBumpAttempt_Call { _c.Call.Return(run) return _c } -// NewAttemptBuilder creates a new instance of AttemptBuilder. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// newMockAttemptBuilder creates a new instance of mockAttemptBuilder. 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 NewAttemptBuilder(t interface { +func newMockAttemptBuilder(t interface { mock.TestingT Cleanup(func()) -}) *AttemptBuilder { - mock := &AttemptBuilder{} +}) *mockAttemptBuilder { + mock := &mockAttemptBuilder{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/core/chains/evm/txm/mocks/client.go b/core/chains/evm/txm/mock_client_test.go similarity index 50% rename from core/chains/evm/txm/mocks/client.go rename to core/chains/evm/txm/mock_client_test.go index cac2e55491a..68bf3001427 100644 --- a/core/chains/evm/txm/mocks/client.go +++ b/core/chains/evm/txm/mock_client_test.go @@ -1,6 +1,6 @@ // Code generated by mockery v2.50.0. DO NOT EDIT. -package mocks +package txm import ( context "context" @@ -13,21 +13,21 @@ import ( types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" ) -// Client is an autogenerated mock type for the Client type -type Client struct { +// mockClient is an autogenerated mock type for the Client type +type mockClient struct { mock.Mock } -type Client_Expecter struct { +type mockClient_Expecter struct { mock *mock.Mock } -func (_m *Client) EXPECT() *Client_Expecter { - return &Client_Expecter{mock: &_m.Mock} +func (_m *mockClient) EXPECT() *mockClient_Expecter { + return &mockClient_Expecter{mock: &_m.Mock} } // NonceAt provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Client) NonceAt(_a0 context.Context, _a1 common.Address, _a2 *big.Int) (uint64, error) { +func (_m *mockClient) NonceAt(_a0 context.Context, _a1 common.Address, _a2 *big.Int) (uint64, error) { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -54,8 +54,8 @@ func (_m *Client) NonceAt(_a0 context.Context, _a1 common.Address, _a2 *big.Int) return r0, r1 } -// Client_NonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NonceAt' -type Client_NonceAt_Call struct { +// mockClient_NonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NonceAt' +type mockClient_NonceAt_Call struct { *mock.Call } @@ -63,29 +63,29 @@ type Client_NonceAt_Call struct { // - _a0 context.Context // - _a1 common.Address // - _a2 *big.Int -func (_e *Client_Expecter) NonceAt(_a0 interface{}, _a1 interface{}, _a2 interface{}) *Client_NonceAt_Call { - return &Client_NonceAt_Call{Call: _e.mock.On("NonceAt", _a0, _a1, _a2)} +func (_e *mockClient_Expecter) NonceAt(_a0 interface{}, _a1 interface{}, _a2 interface{}) *mockClient_NonceAt_Call { + return &mockClient_NonceAt_Call{Call: _e.mock.On("NonceAt", _a0, _a1, _a2)} } -func (_c *Client_NonceAt_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 *big.Int)) *Client_NonceAt_Call { +func (_c *mockClient_NonceAt_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 *big.Int)) *mockClient_NonceAt_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(common.Address), args[2].(*big.Int)) }) return _c } -func (_c *Client_NonceAt_Call) Return(_a0 uint64, _a1 error) *Client_NonceAt_Call { +func (_c *mockClient_NonceAt_Call) Return(_a0 uint64, _a1 error) *mockClient_NonceAt_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Client_NonceAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (uint64, error)) *Client_NonceAt_Call { +func (_c *mockClient_NonceAt_Call) RunAndReturn(run func(context.Context, common.Address, *big.Int) (uint64, error)) *mockClient_NonceAt_Call { _c.Call.Return(run) return _c } // PendingNonceAt provides a mock function with given fields: _a0, _a1 -func (_m *Client) PendingNonceAt(_a0 context.Context, _a1 common.Address) (uint64, error) { +func (_m *mockClient) PendingNonceAt(_a0 context.Context, _a1 common.Address) (uint64, error) { ret := _m.Called(_a0, _a1) if len(ret) == 0 { @@ -112,37 +112,37 @@ func (_m *Client) PendingNonceAt(_a0 context.Context, _a1 common.Address) (uint6 return r0, r1 } -// Client_PendingNonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingNonceAt' -type Client_PendingNonceAt_Call struct { +// mockClient_PendingNonceAt_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PendingNonceAt' +type mockClient_PendingNonceAt_Call struct { *mock.Call } // PendingNonceAt is a helper method to define mock.On call // - _a0 context.Context // - _a1 common.Address -func (_e *Client_Expecter) PendingNonceAt(_a0 interface{}, _a1 interface{}) *Client_PendingNonceAt_Call { - return &Client_PendingNonceAt_Call{Call: _e.mock.On("PendingNonceAt", _a0, _a1)} +func (_e *mockClient_Expecter) PendingNonceAt(_a0 interface{}, _a1 interface{}) *mockClient_PendingNonceAt_Call { + return &mockClient_PendingNonceAt_Call{Call: _e.mock.On("PendingNonceAt", _a0, _a1)} } -func (_c *Client_PendingNonceAt_Call) Run(run func(_a0 context.Context, _a1 common.Address)) *Client_PendingNonceAt_Call { +func (_c *mockClient_PendingNonceAt_Call) Run(run func(_a0 context.Context, _a1 common.Address)) *mockClient_PendingNonceAt_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(common.Address)) }) return _c } -func (_c *Client_PendingNonceAt_Call) Return(_a0 uint64, _a1 error) *Client_PendingNonceAt_Call { +func (_c *mockClient_PendingNonceAt_Call) Return(_a0 uint64, _a1 error) *mockClient_PendingNonceAt_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *Client_PendingNonceAt_Call) RunAndReturn(run func(context.Context, common.Address) (uint64, error)) *Client_PendingNonceAt_Call { +func (_c *mockClient_PendingNonceAt_Call) RunAndReturn(run func(context.Context, common.Address) (uint64, error)) *mockClient_PendingNonceAt_Call { _c.Call.Return(run) return _c } // SendTransaction provides a mock function with given fields: ctx, tx, attempt -func (_m *Client) SendTransaction(ctx context.Context, tx *types.Transaction, attempt *types.Attempt) error { +func (_m *mockClient) SendTransaction(ctx context.Context, tx *types.Transaction, attempt *types.Attempt) error { ret := _m.Called(ctx, tx, attempt) if len(ret) == 0 { @@ -159,8 +159,8 @@ func (_m *Client) SendTransaction(ctx context.Context, tx *types.Transaction, at return r0 } -// Client_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' -type Client_SendTransaction_Call struct { +// mockClient_SendTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SendTransaction' +type mockClient_SendTransaction_Call struct { *mock.Call } @@ -168,34 +168,34 @@ type Client_SendTransaction_Call struct { // - ctx context.Context // - tx *types.Transaction // - attempt *types.Attempt -func (_e *Client_Expecter) SendTransaction(ctx interface{}, tx interface{}, attempt interface{}) *Client_SendTransaction_Call { - return &Client_SendTransaction_Call{Call: _e.mock.On("SendTransaction", ctx, tx, attempt)} +func (_e *mockClient_Expecter) SendTransaction(ctx interface{}, tx interface{}, attempt interface{}) *mockClient_SendTransaction_Call { + return &mockClient_SendTransaction_Call{Call: _e.mock.On("SendTransaction", ctx, tx, attempt)} } -func (_c *Client_SendTransaction_Call) Run(run func(ctx context.Context, tx *types.Transaction, attempt *types.Attempt)) *Client_SendTransaction_Call { +func (_c *mockClient_SendTransaction_Call) Run(run func(ctx context.Context, tx *types.Transaction, attempt *types.Attempt)) *mockClient_SendTransaction_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*types.Transaction), args[2].(*types.Attempt)) }) return _c } -func (_c *Client_SendTransaction_Call) Return(_a0 error) *Client_SendTransaction_Call { +func (_c *mockClient_SendTransaction_Call) Return(_a0 error) *mockClient_SendTransaction_Call { _c.Call.Return(_a0) return _c } -func (_c *Client_SendTransaction_Call) RunAndReturn(run func(context.Context, *types.Transaction, *types.Attempt) error) *Client_SendTransaction_Call { +func (_c *mockClient_SendTransaction_Call) RunAndReturn(run func(context.Context, *types.Transaction, *types.Attempt) error) *mockClient_SendTransaction_Call { _c.Call.Return(run) return _c } -// NewClient creates a new instance of Client. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// newMockClient creates a new instance of mockClient. 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 NewClient(t interface { +func newMockClient(t interface { mock.TestingT Cleanup(func()) -}) *Client { - mock := &Client{} +}) *mockClient { + mock := &mockClient{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) diff --git a/core/chains/evm/txm/mock_keystore_test.go b/core/chains/evm/txm/mock_keystore_test.go new file mode 100644 index 00000000000..f30e17e5024 --- /dev/null +++ b/core/chains/evm/txm/mock_keystore_test.go @@ -0,0 +1,98 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package txm + +import ( + context "context" + big "math/big" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" +) + +// mockKeystore is an autogenerated mock type for the Keystore type +type mockKeystore struct { + mock.Mock +} + +type mockKeystore_Expecter struct { + mock *mock.Mock +} + +func (_m *mockKeystore) EXPECT() *mockKeystore_Expecter { + return &mockKeystore_Expecter{mock: &_m.Mock} +} + +// EnabledAddressesForChain provides a mock function with given fields: ctx, chainID +func (_m *mockKeystore) EnabledAddressesForChain(ctx context.Context, chainID *big.Int) ([]common.Address, error) { + ret := _m.Called(ctx, chainID) + + if len(ret) == 0 { + panic("no return value specified for EnabledAddressesForChain") + } + + var r0 []common.Address + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) ([]common.Address, error)); ok { + return rf(ctx, chainID) + } + if rf, ok := ret.Get(0).(func(context.Context, *big.Int) []common.Address); ok { + r0 = rf(ctx, chainID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]common.Address) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { + r1 = rf(ctx, chainID) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// mockKeystore_EnabledAddressesForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledAddressesForChain' +type mockKeystore_EnabledAddressesForChain_Call struct { + *mock.Call +} + +// EnabledAddressesForChain is a helper method to define mock.On call +// - ctx context.Context +// - chainID *big.Int +func (_e *mockKeystore_Expecter) EnabledAddressesForChain(ctx interface{}, chainID interface{}) *mockKeystore_EnabledAddressesForChain_Call { + return &mockKeystore_EnabledAddressesForChain_Call{Call: _e.mock.On("EnabledAddressesForChain", ctx, chainID)} +} + +func (_c *mockKeystore_EnabledAddressesForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *mockKeystore_EnabledAddressesForChain_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*big.Int)) + }) + return _c +} + +func (_c *mockKeystore_EnabledAddressesForChain_Call) Return(addresses []common.Address, err error) *mockKeystore_EnabledAddressesForChain_Call { + _c.Call.Return(addresses, err) + return _c +} + +func (_c *mockKeystore_EnabledAddressesForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]common.Address, error)) *mockKeystore_EnabledAddressesForChain_Call { + _c.Call.Return(run) + return _c +} + +// newMockKeystore creates a new instance of mockKeystore. 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 newMockKeystore(t interface { + mock.TestingT + Cleanup(func()) +}) *mockKeystore { + mock := &mockKeystore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/chains/evm/txm/mock_tx_store_test.go b/core/chains/evm/txm/mock_tx_store_test.go new file mode 100644 index 00000000000..18dd11a4196 --- /dev/null +++ b/core/chains/evm/txm/mock_tx_store_test.go @@ -0,0 +1,647 @@ +// Code generated by mockery v2.50.0. DO NOT EDIT. + +package txm + +import ( + context "context" + + common "github.com/ethereum/go-ethereum/common" + + mock "github.com/stretchr/testify/mock" + + types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" +) + +// mockTxStore is an autogenerated mock type for the TxStore type +type mockTxStore struct { + mock.Mock +} + +type mockTxStore_Expecter struct { + mock *mock.Mock +} + +func (_m *mockTxStore) EXPECT() *mockTxStore_Expecter { + return &mockTxStore_Expecter{mock: &_m.Mock} +} + +// AbandonPendingTransactions provides a mock function with given fields: _a0, _a1 +func (_m *mockTxStore) AbandonPendingTransactions(_a0 context.Context, _a1 common.Address) error { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for AbandonPendingTransactions") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address) error); ok { + r0 = rf(_a0, _a1) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// mockTxStore_AbandonPendingTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbandonPendingTransactions' +type mockTxStore_AbandonPendingTransactions_Call struct { + *mock.Call +} + +// AbandonPendingTransactions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +func (_e *mockTxStore_Expecter) AbandonPendingTransactions(_a0 interface{}, _a1 interface{}) *mockTxStore_AbandonPendingTransactions_Call { + return &mockTxStore_AbandonPendingTransactions_Call{Call: _e.mock.On("AbandonPendingTransactions", _a0, _a1)} +} + +func (_c *mockTxStore_AbandonPendingTransactions_Call) Run(run func(_a0 context.Context, _a1 common.Address)) *mockTxStore_AbandonPendingTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address)) + }) + return _c +} + +func (_c *mockTxStore_AbandonPendingTransactions_Call) Return(_a0 error) *mockTxStore_AbandonPendingTransactions_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockTxStore_AbandonPendingTransactions_Call) RunAndReturn(run func(context.Context, common.Address) error) *mockTxStore_AbandonPendingTransactions_Call { + _c.Call.Return(run) + return _c +} + +// AppendAttemptToTransaction provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *mockTxStore) AppendAttemptToTransaction(_a0 context.Context, _a1 uint64, _a2 common.Address, _a3 *types.Attempt) error { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for AppendAttemptToTransaction") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address, *types.Attempt) error); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// mockTxStore_AppendAttemptToTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendAttemptToTransaction' +type mockTxStore_AppendAttemptToTransaction_Call struct { + *mock.Call +} + +// AppendAttemptToTransaction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +// - _a3 *types.Attempt +func (_e *mockTxStore_Expecter) AppendAttemptToTransaction(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *mockTxStore_AppendAttemptToTransaction_Call { + return &mockTxStore_AppendAttemptToTransaction_Call{Call: _e.mock.On("AppendAttemptToTransaction", _a0, _a1, _a2, _a3)} +} + +func (_c *mockTxStore_AppendAttemptToTransaction_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address, _a3 *types.Attempt)) *mockTxStore_AppendAttemptToTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address), args[3].(*types.Attempt)) + }) + return _c +} + +func (_c *mockTxStore_AppendAttemptToTransaction_Call) Return(_a0 error) *mockTxStore_AppendAttemptToTransaction_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockTxStore_AppendAttemptToTransaction_Call) RunAndReturn(run func(context.Context, uint64, common.Address, *types.Attempt) error) *mockTxStore_AppendAttemptToTransaction_Call { + _c.Call.Return(run) + return _c +} + +// CreateEmptyUnconfirmedTransaction provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *mockTxStore) CreateEmptyUnconfirmedTransaction(_a0 context.Context, _a1 common.Address, _a2 uint64, _a3 uint64) (*types.Transaction, error) { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for CreateEmptyUnconfirmedTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, uint64) (*types.Transaction, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, uint64) *types.Transaction); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64, uint64) error); ok { + r1 = rf(_a0, _a1, _a2, _a3) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// mockTxStore_CreateEmptyUnconfirmedTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEmptyUnconfirmedTransaction' +type mockTxStore_CreateEmptyUnconfirmedTransaction_Call struct { + *mock.Call +} + +// CreateEmptyUnconfirmedTransaction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +// - _a2 uint64 +// - _a3 uint64 +func (_e *mockTxStore_Expecter) CreateEmptyUnconfirmedTransaction(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *mockTxStore_CreateEmptyUnconfirmedTransaction_Call { + return &mockTxStore_CreateEmptyUnconfirmedTransaction_Call{Call: _e.mock.On("CreateEmptyUnconfirmedTransaction", _a0, _a1, _a2, _a3)} +} + +func (_c *mockTxStore_CreateEmptyUnconfirmedTransaction_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 uint64, _a3 uint64)) *mockTxStore_CreateEmptyUnconfirmedTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint64), args[3].(uint64)) + }) + return _c +} + +func (_c *mockTxStore_CreateEmptyUnconfirmedTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *mockTxStore_CreateEmptyUnconfirmedTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockTxStore_CreateEmptyUnconfirmedTransaction_Call) RunAndReturn(run func(context.Context, common.Address, uint64, uint64) (*types.Transaction, error)) *mockTxStore_CreateEmptyUnconfirmedTransaction_Call { + _c.Call.Return(run) + return _c +} + +// CreateTransaction provides a mock function with given fields: _a0, _a1 +func (_m *mockTxStore) CreateTransaction(_a0 context.Context, _a1 *types.TxRequest) (*types.Transaction, error) { + ret := _m.Called(_a0, _a1) + + if len(ret) == 0 { + panic("no return value specified for CreateTransaction") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.TxRequest) (*types.Transaction, error)); ok { + return rf(_a0, _a1) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.TxRequest) *types.Transaction); ok { + r0 = rf(_a0, _a1) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.TxRequest) error); ok { + r1 = rf(_a0, _a1) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// mockTxStore_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' +type mockTxStore_CreateTransaction_Call struct { + *mock.Call +} + +// CreateTransaction is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *types.TxRequest +func (_e *mockTxStore_Expecter) CreateTransaction(_a0 interface{}, _a1 interface{}) *mockTxStore_CreateTransaction_Call { + return &mockTxStore_CreateTransaction_Call{Call: _e.mock.On("CreateTransaction", _a0, _a1)} +} + +func (_c *mockTxStore_CreateTransaction_Call) Run(run func(_a0 context.Context, _a1 *types.TxRequest)) *mockTxStore_CreateTransaction_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.TxRequest)) + }) + return _c +} + +func (_c *mockTxStore_CreateTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *mockTxStore_CreateTransaction_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockTxStore_CreateTransaction_Call) RunAndReturn(run func(context.Context, *types.TxRequest) (*types.Transaction, error)) *mockTxStore_CreateTransaction_Call { + _c.Call.Return(run) + return _c +} + +// DeleteAttemptForUnconfirmedTx provides a mock function with given fields: _a0, _a1, _a2, _a3 +func (_m *mockTxStore) DeleteAttemptForUnconfirmedTx(_a0 context.Context, _a1 uint64, _a2 *types.Attempt, _a3 common.Address) error { + ret := _m.Called(_a0, _a1, _a2, _a3) + + if len(ret) == 0 { + panic("no return value specified for DeleteAttemptForUnconfirmedTx") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.Attempt, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2, _a3) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// mockTxStore_DeleteAttemptForUnconfirmedTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAttemptForUnconfirmedTx' +type mockTxStore_DeleteAttemptForUnconfirmedTx_Call struct { + *mock.Call +} + +// DeleteAttemptForUnconfirmedTx is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 *types.Attempt +// - _a3 common.Address +func (_e *mockTxStore_Expecter) DeleteAttemptForUnconfirmedTx(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *mockTxStore_DeleteAttemptForUnconfirmedTx_Call { + return &mockTxStore_DeleteAttemptForUnconfirmedTx_Call{Call: _e.mock.On("DeleteAttemptForUnconfirmedTx", _a0, _a1, _a2, _a3)} +} + +func (_c *mockTxStore_DeleteAttemptForUnconfirmedTx_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 *types.Attempt, _a3 common.Address)) *mockTxStore_DeleteAttemptForUnconfirmedTx_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(*types.Attempt), args[3].(common.Address)) + }) + return _c +} + +func (_c *mockTxStore_DeleteAttemptForUnconfirmedTx_Call) Return(_a0 error) *mockTxStore_DeleteAttemptForUnconfirmedTx_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockTxStore_DeleteAttemptForUnconfirmedTx_Call) RunAndReturn(run func(context.Context, uint64, *types.Attempt, common.Address) error) *mockTxStore_DeleteAttemptForUnconfirmedTx_Call { + _c.Call.Return(run) + return _c +} + +// FetchUnconfirmedTransactionAtNonceWithCount provides a mock function with given fields: _a0, _a1, _a2 +func (_m *mockTxStore) FetchUnconfirmedTransactionAtNonceWithCount(_a0 context.Context, _a1 uint64, _a2 common.Address) (*types.Transaction, int, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for FetchUnconfirmedTransactionAtNonceWithCount") + } + + var r0 *types.Transaction + var r1 int + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) (*types.Transaction, int, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) *types.Transaction); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, common.Address) int); ok { + r1 = rf(_a0, _a1, _a2) + } else { + r1 = ret.Get(1).(int) + } + + if rf, ok := ret.Get(2).(func(context.Context, uint64, common.Address) error); ok { + r2 = rf(_a0, _a1, _a2) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchUnconfirmedTransactionAtNonceWithCount' +type mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call struct { + *mock.Call +} + +// FetchUnconfirmedTransactionAtNonceWithCount is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +func (_e *mockTxStore_Expecter) FetchUnconfirmedTransactionAtNonceWithCount(_a0 interface{}, _a1 interface{}, _a2 interface{}) *mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + return &mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call{Call: _e.mock.On("FetchUnconfirmedTransactionAtNonceWithCount", _a0, _a1, _a2)} +} + +func (_c *mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) Return(_a0 *types.Transaction, _a1 int, _a2 error) *mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) RunAndReturn(run func(context.Context, uint64, common.Address) (*types.Transaction, int, error)) *mockTxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { + _c.Call.Return(run) + return _c +} + +// MarkConfirmedAndReorgedTransactions provides a mock function with given fields: _a0, _a1, _a2 +func (_m *mockTxStore) MarkConfirmedAndReorgedTransactions(_a0 context.Context, _a1 uint64, _a2 common.Address) ([]*types.Transaction, []uint64, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for MarkConfirmedAndReorgedTransactions") + } + + var r0 []*types.Transaction + var r1 []uint64 + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) ([]*types.Transaction, []uint64, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) []*types.Transaction); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, uint64, common.Address) []uint64); ok { + r1 = rf(_a0, _a1, _a2) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).([]uint64) + } + } + + if rf, ok := ret.Get(2).(func(context.Context, uint64, common.Address) error); ok { + r2 = rf(_a0, _a1, _a2) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// mockTxStore_MarkConfirmedAndReorgedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkConfirmedAndReorgedTransactions' +type mockTxStore_MarkConfirmedAndReorgedTransactions_Call struct { + *mock.Call +} + +// MarkConfirmedAndReorgedTransactions is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +func (_e *mockTxStore_Expecter) MarkConfirmedAndReorgedTransactions(_a0 interface{}, _a1 interface{}, _a2 interface{}) *mockTxStore_MarkConfirmedAndReorgedTransactions_Call { + return &mockTxStore_MarkConfirmedAndReorgedTransactions_Call{Call: _e.mock.On("MarkConfirmedAndReorgedTransactions", _a0, _a1, _a2)} +} + +func (_c *mockTxStore_MarkConfirmedAndReorgedTransactions_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *mockTxStore_MarkConfirmedAndReorgedTransactions_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *mockTxStore_MarkConfirmedAndReorgedTransactions_Call) Return(_a0 []*types.Transaction, _a1 []uint64, _a2 error) *mockTxStore_MarkConfirmedAndReorgedTransactions_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *mockTxStore_MarkConfirmedAndReorgedTransactions_Call) RunAndReturn(run func(context.Context, uint64, common.Address) ([]*types.Transaction, []uint64, error)) *mockTxStore_MarkConfirmedAndReorgedTransactions_Call { + _c.Call.Return(run) + return _c +} + +// MarkTxFatal provides a mock function with given fields: _a0, _a1, _a2 +func (_m *mockTxStore) MarkTxFatal(_a0 context.Context, _a1 *types.Transaction, _a2 common.Address) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for MarkTxFatal") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// mockTxStore_MarkTxFatal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkTxFatal' +type mockTxStore_MarkTxFatal_Call struct { + *mock.Call +} + +// MarkTxFatal is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 *types.Transaction +// - _a2 common.Address +func (_e *mockTxStore_Expecter) MarkTxFatal(_a0 interface{}, _a1 interface{}, _a2 interface{}) *mockTxStore_MarkTxFatal_Call { + return &mockTxStore_MarkTxFatal_Call{Call: _e.mock.On("MarkTxFatal", _a0, _a1, _a2)} +} + +func (_c *mockTxStore_MarkTxFatal_Call) Run(run func(_a0 context.Context, _a1 *types.Transaction, _a2 common.Address)) *mockTxStore_MarkTxFatal_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*types.Transaction), args[2].(common.Address)) + }) + return _c +} + +func (_c *mockTxStore_MarkTxFatal_Call) Return(_a0 error) *mockTxStore_MarkTxFatal_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockTxStore_MarkTxFatal_Call) RunAndReturn(run func(context.Context, *types.Transaction, common.Address) error) *mockTxStore_MarkTxFatal_Call { + _c.Call.Return(run) + return _c +} + +// MarkUnconfirmedTransactionPurgeable provides a mock function with given fields: _a0, _a1, _a2 +func (_m *mockTxStore) MarkUnconfirmedTransactionPurgeable(_a0 context.Context, _a1 uint64, _a2 common.Address) error { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for MarkUnconfirmedTransactionPurgeable") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// mockTxStore_MarkUnconfirmedTransactionPurgeable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkUnconfirmedTransactionPurgeable' +type mockTxStore_MarkUnconfirmedTransactionPurgeable_Call struct { + *mock.Call +} + +// MarkUnconfirmedTransactionPurgeable is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 common.Address +func (_e *mockTxStore_Expecter) MarkUnconfirmedTransactionPurgeable(_a0 interface{}, _a1 interface{}, _a2 interface{}) *mockTxStore_MarkUnconfirmedTransactionPurgeable_Call { + return &mockTxStore_MarkUnconfirmedTransactionPurgeable_Call{Call: _e.mock.On("MarkUnconfirmedTransactionPurgeable", _a0, _a1, _a2)} +} + +func (_c *mockTxStore_MarkUnconfirmedTransactionPurgeable_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *mockTxStore_MarkUnconfirmedTransactionPurgeable_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) + }) + return _c +} + +func (_c *mockTxStore_MarkUnconfirmedTransactionPurgeable_Call) Return(_a0 error) *mockTxStore_MarkUnconfirmedTransactionPurgeable_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockTxStore_MarkUnconfirmedTransactionPurgeable_Call) RunAndReturn(run func(context.Context, uint64, common.Address) error) *mockTxStore_MarkUnconfirmedTransactionPurgeable_Call { + _c.Call.Return(run) + return _c +} + +// UpdateTransactionBroadcast provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 +func (_m *mockTxStore) UpdateTransactionBroadcast(_a0 context.Context, _a1 uint64, _a2 uint64, _a3 common.Hash, _a4 common.Address) error { + ret := _m.Called(_a0, _a1, _a2, _a3, _a4) + + if len(ret) == 0 { + panic("no return value specified for UpdateTransactionBroadcast") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, common.Hash, common.Address) error); ok { + r0 = rf(_a0, _a1, _a2, _a3, _a4) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// mockTxStore_UpdateTransactionBroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTransactionBroadcast' +type mockTxStore_UpdateTransactionBroadcast_Call struct { + *mock.Call +} + +// UpdateTransactionBroadcast is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 uint64 +// - _a2 uint64 +// - _a3 common.Hash +// - _a4 common.Address +func (_e *mockTxStore_Expecter) UpdateTransactionBroadcast(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}) *mockTxStore_UpdateTransactionBroadcast_Call { + return &mockTxStore_UpdateTransactionBroadcast_Call{Call: _e.mock.On("UpdateTransactionBroadcast", _a0, _a1, _a2, _a3, _a4)} +} + +func (_c *mockTxStore_UpdateTransactionBroadcast_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 uint64, _a3 common.Hash, _a4 common.Address)) *mockTxStore_UpdateTransactionBroadcast_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint64), args[2].(uint64), args[3].(common.Hash), args[4].(common.Address)) + }) + return _c +} + +func (_c *mockTxStore_UpdateTransactionBroadcast_Call) Return(_a0 error) *mockTxStore_UpdateTransactionBroadcast_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *mockTxStore_UpdateTransactionBroadcast_Call) RunAndReturn(run func(context.Context, uint64, uint64, common.Hash, common.Address) error) *mockTxStore_UpdateTransactionBroadcast_Call { + _c.Call.Return(run) + return _c +} + +// UpdateUnstartedTransactionWithNonce provides a mock function with given fields: _a0, _a1, _a2 +func (_m *mockTxStore) UpdateUnstartedTransactionWithNonce(_a0 context.Context, _a1 common.Address, _a2 uint64) (*types.Transaction, error) { + ret := _m.Called(_a0, _a1, _a2) + + if len(ret) == 0 { + panic("no return value specified for UpdateUnstartedTransactionWithNonce") + } + + var r0 *types.Transaction + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64) (*types.Transaction, error)); ok { + return rf(_a0, _a1, _a2) + } + if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64) *types.Transaction); ok { + r0 = rf(_a0, _a1, _a2) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Transaction) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64) error); ok { + r1 = rf(_a0, _a1, _a2) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// mockTxStore_UpdateUnstartedTransactionWithNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUnstartedTransactionWithNonce' +type mockTxStore_UpdateUnstartedTransactionWithNonce_Call struct { + *mock.Call +} + +// UpdateUnstartedTransactionWithNonce is a helper method to define mock.On call +// - _a0 context.Context +// - _a1 common.Address +// - _a2 uint64 +func (_e *mockTxStore_Expecter) UpdateUnstartedTransactionWithNonce(_a0 interface{}, _a1 interface{}, _a2 interface{}) *mockTxStore_UpdateUnstartedTransactionWithNonce_Call { + return &mockTxStore_UpdateUnstartedTransactionWithNonce_Call{Call: _e.mock.On("UpdateUnstartedTransactionWithNonce", _a0, _a1, _a2)} +} + +func (_c *mockTxStore_UpdateUnstartedTransactionWithNonce_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 uint64)) *mockTxStore_UpdateUnstartedTransactionWithNonce_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.Address), args[2].(uint64)) + }) + return _c +} + +func (_c *mockTxStore_UpdateUnstartedTransactionWithNonce_Call) Return(_a0 *types.Transaction, _a1 error) *mockTxStore_UpdateUnstartedTransactionWithNonce_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *mockTxStore_UpdateUnstartedTransactionWithNonce_Call) RunAndReturn(run func(context.Context, common.Address, uint64) (*types.Transaction, error)) *mockTxStore_UpdateUnstartedTransactionWithNonce_Call { + _c.Call.Return(run) + return _c +} + +// newMockTxStore creates a new instance of mockTxStore. 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 newMockTxStore(t interface { + mock.TestingT + Cleanup(func()) +}) *mockTxStore { + mock := &mockTxStore{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/core/chains/evm/txm/mocks/keystore.go b/core/chains/evm/txm/mocks/keystore.go deleted file mode 100644 index 3d11a6fa549..00000000000 --- a/core/chains/evm/txm/mocks/keystore.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package mocks - -import ( - context "context" - big "math/big" - - common "github.com/ethereum/go-ethereum/common" - - mock "github.com/stretchr/testify/mock" -) - -// Keystore is an autogenerated mock type for the Keystore type -type Keystore struct { - mock.Mock -} - -type Keystore_Expecter struct { - mock *mock.Mock -} - -func (_m *Keystore) EXPECT() *Keystore_Expecter { - return &Keystore_Expecter{mock: &_m.Mock} -} - -// EnabledAddressesForChain provides a mock function with given fields: ctx, chainID -func (_m *Keystore) EnabledAddressesForChain(ctx context.Context, chainID *big.Int) ([]common.Address, error) { - ret := _m.Called(ctx, chainID) - - if len(ret) == 0 { - panic("no return value specified for EnabledAddressesForChain") - } - - var r0 []common.Address - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *big.Int) ([]common.Address, error)); ok { - return rf(ctx, chainID) - } - if rf, ok := ret.Get(0).(func(context.Context, *big.Int) []common.Address); ok { - r0 = rf(ctx, chainID) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]common.Address) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *big.Int) error); ok { - r1 = rf(ctx, chainID) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// Keystore_EnabledAddressesForChain_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnabledAddressesForChain' -type Keystore_EnabledAddressesForChain_Call struct { - *mock.Call -} - -// EnabledAddressesForChain is a helper method to define mock.On call -// - ctx context.Context -// - chainID *big.Int -func (_e *Keystore_Expecter) EnabledAddressesForChain(ctx interface{}, chainID interface{}) *Keystore_EnabledAddressesForChain_Call { - return &Keystore_EnabledAddressesForChain_Call{Call: _e.mock.On("EnabledAddressesForChain", ctx, chainID)} -} - -func (_c *Keystore_EnabledAddressesForChain_Call) Run(run func(ctx context.Context, chainID *big.Int)) *Keystore_EnabledAddressesForChain_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*big.Int)) - }) - return _c -} - -func (_c *Keystore_EnabledAddressesForChain_Call) Return(addresses []common.Address, err error) *Keystore_EnabledAddressesForChain_Call { - _c.Call.Return(addresses, err) - return _c -} - -func (_c *Keystore_EnabledAddressesForChain_Call) RunAndReturn(run func(context.Context, *big.Int) ([]common.Address, error)) *Keystore_EnabledAddressesForChain_Call { - _c.Call.Return(run) - return _c -} - -// NewKeystore creates a new instance of Keystore. 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 NewKeystore(t interface { - mock.TestingT - Cleanup(func()) -}) *Keystore { - mock := &Keystore{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/txm/mocks/tx_store.go b/core/chains/evm/txm/mocks/tx_store.go deleted file mode 100644 index 318b36942b8..00000000000 --- a/core/chains/evm/txm/mocks/tx_store.go +++ /dev/null @@ -1,647 +0,0 @@ -// Code generated by mockery v2.50.0. DO NOT EDIT. - -package mocks - -import ( - context "context" - - common "github.com/ethereum/go-ethereum/common" - - mock "github.com/stretchr/testify/mock" - - types "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" -) - -// TxStore is an autogenerated mock type for the TxStore type -type TxStore struct { - mock.Mock -} - -type TxStore_Expecter struct { - mock *mock.Mock -} - -func (_m *TxStore) EXPECT() *TxStore_Expecter { - return &TxStore_Expecter{mock: &_m.Mock} -} - -// AbandonPendingTransactions provides a mock function with given fields: _a0, _a1 -func (_m *TxStore) AbandonPendingTransactions(_a0 context.Context, _a1 common.Address) error { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for AbandonPendingTransactions") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address) error); ok { - r0 = rf(_a0, _a1) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TxStore_AbandonPendingTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AbandonPendingTransactions' -type TxStore_AbandonPendingTransactions_Call struct { - *mock.Call -} - -// AbandonPendingTransactions is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 common.Address -func (_e *TxStore_Expecter) AbandonPendingTransactions(_a0 interface{}, _a1 interface{}) *TxStore_AbandonPendingTransactions_Call { - return &TxStore_AbandonPendingTransactions_Call{Call: _e.mock.On("AbandonPendingTransactions", _a0, _a1)} -} - -func (_c *TxStore_AbandonPendingTransactions_Call) Run(run func(_a0 context.Context, _a1 common.Address)) *TxStore_AbandonPendingTransactions_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(common.Address)) - }) - return _c -} - -func (_c *TxStore_AbandonPendingTransactions_Call) Return(_a0 error) *TxStore_AbandonPendingTransactions_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *TxStore_AbandonPendingTransactions_Call) RunAndReturn(run func(context.Context, common.Address) error) *TxStore_AbandonPendingTransactions_Call { - _c.Call.Return(run) - return _c -} - -// AppendAttemptToTransaction provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *TxStore) AppendAttemptToTransaction(_a0 context.Context, _a1 uint64, _a2 common.Address, _a3 *types.Attempt) error { - ret := _m.Called(_a0, _a1, _a2, _a3) - - if len(ret) == 0 { - panic("no return value specified for AppendAttemptToTransaction") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address, *types.Attempt) error); ok { - r0 = rf(_a0, _a1, _a2, _a3) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TxStore_AppendAttemptToTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AppendAttemptToTransaction' -type TxStore_AppendAttemptToTransaction_Call struct { - *mock.Call -} - -// AppendAttemptToTransaction is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint64 -// - _a2 common.Address -// - _a3 *types.Attempt -func (_e *TxStore_Expecter) AppendAttemptToTransaction(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *TxStore_AppendAttemptToTransaction_Call { - return &TxStore_AppendAttemptToTransaction_Call{Call: _e.mock.On("AppendAttemptToTransaction", _a0, _a1, _a2, _a3)} -} - -func (_c *TxStore_AppendAttemptToTransaction_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address, _a3 *types.Attempt)) *TxStore_AppendAttemptToTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address), args[3].(*types.Attempt)) - }) - return _c -} - -func (_c *TxStore_AppendAttemptToTransaction_Call) Return(_a0 error) *TxStore_AppendAttemptToTransaction_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *TxStore_AppendAttemptToTransaction_Call) RunAndReturn(run func(context.Context, uint64, common.Address, *types.Attempt) error) *TxStore_AppendAttemptToTransaction_Call { - _c.Call.Return(run) - return _c -} - -// CreateEmptyUnconfirmedTransaction provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *TxStore) CreateEmptyUnconfirmedTransaction(_a0 context.Context, _a1 common.Address, _a2 uint64, _a3 uint64) (*types.Transaction, error) { - ret := _m.Called(_a0, _a1, _a2, _a3) - - if len(ret) == 0 { - panic("no return value specified for CreateEmptyUnconfirmedTransaction") - } - - var r0 *types.Transaction - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, uint64) (*types.Transaction, error)); ok { - return rf(_a0, _a1, _a2, _a3) - } - if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64, uint64) *types.Transaction); ok { - r0 = rf(_a0, _a1, _a2, _a3) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Transaction) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64, uint64) error); ok { - r1 = rf(_a0, _a1, _a2, _a3) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TxStore_CreateEmptyUnconfirmedTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEmptyUnconfirmedTransaction' -type TxStore_CreateEmptyUnconfirmedTransaction_Call struct { - *mock.Call -} - -// CreateEmptyUnconfirmedTransaction is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 common.Address -// - _a2 uint64 -// - _a3 uint64 -func (_e *TxStore_Expecter) CreateEmptyUnconfirmedTransaction(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *TxStore_CreateEmptyUnconfirmedTransaction_Call { - return &TxStore_CreateEmptyUnconfirmedTransaction_Call{Call: _e.mock.On("CreateEmptyUnconfirmedTransaction", _a0, _a1, _a2, _a3)} -} - -func (_c *TxStore_CreateEmptyUnconfirmedTransaction_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 uint64, _a3 uint64)) *TxStore_CreateEmptyUnconfirmedTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(common.Address), args[2].(uint64), args[3].(uint64)) - }) - return _c -} - -func (_c *TxStore_CreateEmptyUnconfirmedTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *TxStore_CreateEmptyUnconfirmedTransaction_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *TxStore_CreateEmptyUnconfirmedTransaction_Call) RunAndReturn(run func(context.Context, common.Address, uint64, uint64) (*types.Transaction, error)) *TxStore_CreateEmptyUnconfirmedTransaction_Call { - _c.Call.Return(run) - return _c -} - -// CreateTransaction provides a mock function with given fields: _a0, _a1 -func (_m *TxStore) CreateTransaction(_a0 context.Context, _a1 *types.TxRequest) (*types.Transaction, error) { - ret := _m.Called(_a0, _a1) - - if len(ret) == 0 { - panic("no return value specified for CreateTransaction") - } - - var r0 *types.Transaction - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.TxRequest) (*types.Transaction, error)); ok { - return rf(_a0, _a1) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.TxRequest) *types.Transaction); ok { - r0 = rf(_a0, _a1) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Transaction) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.TxRequest) error); ok { - r1 = rf(_a0, _a1) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TxStore_CreateTransaction_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateTransaction' -type TxStore_CreateTransaction_Call struct { - *mock.Call -} - -// CreateTransaction is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.TxRequest -func (_e *TxStore_Expecter) CreateTransaction(_a0 interface{}, _a1 interface{}) *TxStore_CreateTransaction_Call { - return &TxStore_CreateTransaction_Call{Call: _e.mock.On("CreateTransaction", _a0, _a1)} -} - -func (_c *TxStore_CreateTransaction_Call) Run(run func(_a0 context.Context, _a1 *types.TxRequest)) *TxStore_CreateTransaction_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*types.TxRequest)) - }) - return _c -} - -func (_c *TxStore_CreateTransaction_Call) Return(_a0 *types.Transaction, _a1 error) *TxStore_CreateTransaction_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *TxStore_CreateTransaction_Call) RunAndReturn(run func(context.Context, *types.TxRequest) (*types.Transaction, error)) *TxStore_CreateTransaction_Call { - _c.Call.Return(run) - return _c -} - -// DeleteAttemptForUnconfirmedTx provides a mock function with given fields: _a0, _a1, _a2, _a3 -func (_m *TxStore) DeleteAttemptForUnconfirmedTx(_a0 context.Context, _a1 uint64, _a2 *types.Attempt, _a3 common.Address) error { - ret := _m.Called(_a0, _a1, _a2, _a3) - - if len(ret) == 0 { - panic("no return value specified for DeleteAttemptForUnconfirmedTx") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, *types.Attempt, common.Address) error); ok { - r0 = rf(_a0, _a1, _a2, _a3) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TxStore_DeleteAttemptForUnconfirmedTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAttemptForUnconfirmedTx' -type TxStore_DeleteAttemptForUnconfirmedTx_Call struct { - *mock.Call -} - -// DeleteAttemptForUnconfirmedTx is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint64 -// - _a2 *types.Attempt -// - _a3 common.Address -func (_e *TxStore_Expecter) DeleteAttemptForUnconfirmedTx(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}) *TxStore_DeleteAttemptForUnconfirmedTx_Call { - return &TxStore_DeleteAttemptForUnconfirmedTx_Call{Call: _e.mock.On("DeleteAttemptForUnconfirmedTx", _a0, _a1, _a2, _a3)} -} - -func (_c *TxStore_DeleteAttemptForUnconfirmedTx_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 *types.Attempt, _a3 common.Address)) *TxStore_DeleteAttemptForUnconfirmedTx_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(uint64), args[2].(*types.Attempt), args[3].(common.Address)) - }) - return _c -} - -func (_c *TxStore_DeleteAttemptForUnconfirmedTx_Call) Return(_a0 error) *TxStore_DeleteAttemptForUnconfirmedTx_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *TxStore_DeleteAttemptForUnconfirmedTx_Call) RunAndReturn(run func(context.Context, uint64, *types.Attempt, common.Address) error) *TxStore_DeleteAttemptForUnconfirmedTx_Call { - _c.Call.Return(run) - return _c -} - -// FetchUnconfirmedTransactionAtNonceWithCount provides a mock function with given fields: _a0, _a1, _a2 -func (_m *TxStore) FetchUnconfirmedTransactionAtNonceWithCount(_a0 context.Context, _a1 uint64, _a2 common.Address) (*types.Transaction, int, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for FetchUnconfirmedTransactionAtNonceWithCount") - } - - var r0 *types.Transaction - var r1 int - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) (*types.Transaction, int, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) *types.Transaction); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Transaction) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, uint64, common.Address) int); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Get(1).(int) - } - - if rf, ok := ret.Get(2).(func(context.Context, uint64, common.Address) error); ok { - r2 = rf(_a0, _a1, _a2) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchUnconfirmedTransactionAtNonceWithCount' -type TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call struct { - *mock.Call -} - -// FetchUnconfirmedTransactionAtNonceWithCount is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint64 -// - _a2 common.Address -func (_e *TxStore_Expecter) FetchUnconfirmedTransactionAtNonceWithCount(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { - return &TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call{Call: _e.mock.On("FetchUnconfirmedTransactionAtNonceWithCount", _a0, _a1, _a2)} -} - -func (_c *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) - }) - return _c -} - -func (_c *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) Return(_a0 *types.Transaction, _a1 int, _a2 error) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call) RunAndReturn(run func(context.Context, uint64, common.Address) (*types.Transaction, int, error)) *TxStore_FetchUnconfirmedTransactionAtNonceWithCount_Call { - _c.Call.Return(run) - return _c -} - -// MarkConfirmedAndReorgedTransactions provides a mock function with given fields: _a0, _a1, _a2 -func (_m *TxStore) MarkConfirmedAndReorgedTransactions(_a0 context.Context, _a1 uint64, _a2 common.Address) ([]*types.Transaction, []uint64, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for MarkConfirmedAndReorgedTransactions") - } - - var r0 []*types.Transaction - var r1 []uint64 - var r2 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) ([]*types.Transaction, []uint64, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) []*types.Transaction); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*types.Transaction) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, uint64, common.Address) []uint64); ok { - r1 = rf(_a0, _a1, _a2) - } else { - if ret.Get(1) != nil { - r1 = ret.Get(1).([]uint64) - } - } - - if rf, ok := ret.Get(2).(func(context.Context, uint64, common.Address) error); ok { - r2 = rf(_a0, _a1, _a2) - } else { - r2 = ret.Error(2) - } - - return r0, r1, r2 -} - -// TxStore_MarkConfirmedAndReorgedTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkConfirmedAndReorgedTransactions' -type TxStore_MarkConfirmedAndReorgedTransactions_Call struct { - *mock.Call -} - -// MarkConfirmedAndReorgedTransactions is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint64 -// - _a2 common.Address -func (_e *TxStore_Expecter) MarkConfirmedAndReorgedTransactions(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_MarkConfirmedAndReorgedTransactions_Call { - return &TxStore_MarkConfirmedAndReorgedTransactions_Call{Call: _e.mock.On("MarkConfirmedAndReorgedTransactions", _a0, _a1, _a2)} -} - -func (_c *TxStore_MarkConfirmedAndReorgedTransactions_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *TxStore_MarkConfirmedAndReorgedTransactions_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) - }) - return _c -} - -func (_c *TxStore_MarkConfirmedAndReorgedTransactions_Call) Return(_a0 []*types.Transaction, _a1 []uint64, _a2 error) *TxStore_MarkConfirmedAndReorgedTransactions_Call { - _c.Call.Return(_a0, _a1, _a2) - return _c -} - -func (_c *TxStore_MarkConfirmedAndReorgedTransactions_Call) RunAndReturn(run func(context.Context, uint64, common.Address) ([]*types.Transaction, []uint64, error)) *TxStore_MarkConfirmedAndReorgedTransactions_Call { - _c.Call.Return(run) - return _c -} - -// MarkTxFatal provides a mock function with given fields: _a0, _a1, _a2 -func (_m *TxStore) MarkTxFatal(_a0 context.Context, _a1 *types.Transaction, _a2 common.Address) error { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for MarkTxFatal") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *types.Transaction, common.Address) error); ok { - r0 = rf(_a0, _a1, _a2) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TxStore_MarkTxFatal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkTxFatal' -type TxStore_MarkTxFatal_Call struct { - *mock.Call -} - -// MarkTxFatal is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 *types.Transaction -// - _a2 common.Address -func (_e *TxStore_Expecter) MarkTxFatal(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_MarkTxFatal_Call { - return &TxStore_MarkTxFatal_Call{Call: _e.mock.On("MarkTxFatal", _a0, _a1, _a2)} -} - -func (_c *TxStore_MarkTxFatal_Call) Run(run func(_a0 context.Context, _a1 *types.Transaction, _a2 common.Address)) *TxStore_MarkTxFatal_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(*types.Transaction), args[2].(common.Address)) - }) - return _c -} - -func (_c *TxStore_MarkTxFatal_Call) Return(_a0 error) *TxStore_MarkTxFatal_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *TxStore_MarkTxFatal_Call) RunAndReturn(run func(context.Context, *types.Transaction, common.Address) error) *TxStore_MarkTxFatal_Call { - _c.Call.Return(run) - return _c -} - -// MarkUnconfirmedTransactionPurgeable provides a mock function with given fields: _a0, _a1, _a2 -func (_m *TxStore) MarkUnconfirmedTransactionPurgeable(_a0 context.Context, _a1 uint64, _a2 common.Address) error { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for MarkUnconfirmedTransactionPurgeable") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, common.Address) error); ok { - r0 = rf(_a0, _a1, _a2) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TxStore_MarkUnconfirmedTransactionPurgeable_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MarkUnconfirmedTransactionPurgeable' -type TxStore_MarkUnconfirmedTransactionPurgeable_Call struct { - *mock.Call -} - -// MarkUnconfirmedTransactionPurgeable is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint64 -// - _a2 common.Address -func (_e *TxStore_Expecter) MarkUnconfirmedTransactionPurgeable(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { - return &TxStore_MarkUnconfirmedTransactionPurgeable_Call{Call: _e.mock.On("MarkUnconfirmedTransactionPurgeable", _a0, _a1, _a2)} -} - -func (_c *TxStore_MarkUnconfirmedTransactionPurgeable_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 common.Address)) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(uint64), args[2].(common.Address)) - }) - return _c -} - -func (_c *TxStore_MarkUnconfirmedTransactionPurgeable_Call) Return(_a0 error) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *TxStore_MarkUnconfirmedTransactionPurgeable_Call) RunAndReturn(run func(context.Context, uint64, common.Address) error) *TxStore_MarkUnconfirmedTransactionPurgeable_Call { - _c.Call.Return(run) - return _c -} - -// UpdateTransactionBroadcast provides a mock function with given fields: _a0, _a1, _a2, _a3, _a4 -func (_m *TxStore) UpdateTransactionBroadcast(_a0 context.Context, _a1 uint64, _a2 uint64, _a3 common.Hash, _a4 common.Address) error { - ret := _m.Called(_a0, _a1, _a2, _a3, _a4) - - if len(ret) == 0 { - panic("no return value specified for UpdateTransactionBroadcast") - } - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, uint64, uint64, common.Hash, common.Address) error); ok { - r0 = rf(_a0, _a1, _a2, _a3, _a4) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// TxStore_UpdateTransactionBroadcast_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateTransactionBroadcast' -type TxStore_UpdateTransactionBroadcast_Call struct { - *mock.Call -} - -// UpdateTransactionBroadcast is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 uint64 -// - _a2 uint64 -// - _a3 common.Hash -// - _a4 common.Address -func (_e *TxStore_Expecter) UpdateTransactionBroadcast(_a0 interface{}, _a1 interface{}, _a2 interface{}, _a3 interface{}, _a4 interface{}) *TxStore_UpdateTransactionBroadcast_Call { - return &TxStore_UpdateTransactionBroadcast_Call{Call: _e.mock.On("UpdateTransactionBroadcast", _a0, _a1, _a2, _a3, _a4)} -} - -func (_c *TxStore_UpdateTransactionBroadcast_Call) Run(run func(_a0 context.Context, _a1 uint64, _a2 uint64, _a3 common.Hash, _a4 common.Address)) *TxStore_UpdateTransactionBroadcast_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(uint64), args[2].(uint64), args[3].(common.Hash), args[4].(common.Address)) - }) - return _c -} - -func (_c *TxStore_UpdateTransactionBroadcast_Call) Return(_a0 error) *TxStore_UpdateTransactionBroadcast_Call { - _c.Call.Return(_a0) - return _c -} - -func (_c *TxStore_UpdateTransactionBroadcast_Call) RunAndReturn(run func(context.Context, uint64, uint64, common.Hash, common.Address) error) *TxStore_UpdateTransactionBroadcast_Call { - _c.Call.Return(run) - return _c -} - -// UpdateUnstartedTransactionWithNonce provides a mock function with given fields: _a0, _a1, _a2 -func (_m *TxStore) UpdateUnstartedTransactionWithNonce(_a0 context.Context, _a1 common.Address, _a2 uint64) (*types.Transaction, error) { - ret := _m.Called(_a0, _a1, _a2) - - if len(ret) == 0 { - panic("no return value specified for UpdateUnstartedTransactionWithNonce") - } - - var r0 *types.Transaction - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64) (*types.Transaction, error)); ok { - return rf(_a0, _a1, _a2) - } - if rf, ok := ret.Get(0).(func(context.Context, common.Address, uint64) *types.Transaction); ok { - r0 = rf(_a0, _a1, _a2) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.Transaction) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, common.Address, uint64) error); ok { - r1 = rf(_a0, _a1, _a2) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// TxStore_UpdateUnstartedTransactionWithNonce_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUnstartedTransactionWithNonce' -type TxStore_UpdateUnstartedTransactionWithNonce_Call struct { - *mock.Call -} - -// UpdateUnstartedTransactionWithNonce is a helper method to define mock.On call -// - _a0 context.Context -// - _a1 common.Address -// - _a2 uint64 -func (_e *TxStore_Expecter) UpdateUnstartedTransactionWithNonce(_a0 interface{}, _a1 interface{}, _a2 interface{}) *TxStore_UpdateUnstartedTransactionWithNonce_Call { - return &TxStore_UpdateUnstartedTransactionWithNonce_Call{Call: _e.mock.On("UpdateUnstartedTransactionWithNonce", _a0, _a1, _a2)} -} - -func (_c *TxStore_UpdateUnstartedTransactionWithNonce_Call) Run(run func(_a0 context.Context, _a1 common.Address, _a2 uint64)) *TxStore_UpdateUnstartedTransactionWithNonce_Call { - _c.Call.Run(func(args mock.Arguments) { - run(args[0].(context.Context), args[1].(common.Address), args[2].(uint64)) - }) - return _c -} - -func (_c *TxStore_UpdateUnstartedTransactionWithNonce_Call) Return(_a0 *types.Transaction, _a1 error) *TxStore_UpdateUnstartedTransactionWithNonce_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *TxStore_UpdateUnstartedTransactionWithNonce_Call) RunAndReturn(run func(context.Context, common.Address, uint64) (*types.Transaction, error)) *TxStore_UpdateUnstartedTransactionWithNonce_Call { - _c.Call.Return(run) - return _c -} - -// NewTxStore creates a new instance of TxStore. 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 NewTxStore(t interface { - mock.TestingT - Cleanup(func()) -}) *TxStore { - mock := &TxStore{} - mock.Mock.Test(t) - - t.Cleanup(func() { mock.AssertExpectations(t) }) - - return mock -} diff --git a/core/chains/evm/txm/txm_test.go b/core/chains/evm/txm/txm_test.go index 7b5e5bdd702..13b987000ed 100644 --- a/core/chains/evm/txm/txm_test.go +++ b/core/chains/evm/txm/txm_test.go @@ -19,7 +19,6 @@ import ( "github.com/smartcontractkit/chainlink-integrations/evm/assets" "github.com/smartcontractkit/chainlink-integrations/evm/gas" "github.com/smartcontractkit/chainlink-integrations/evm/testutils" - "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/mocks" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/storage" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/txm/types" ) @@ -27,13 +26,13 @@ import ( func TestLifecycle(t *testing.T) { t.Parallel() - client := mocks.NewClient(t) - ab := mocks.NewAttemptBuilder(t) + client := newMockClient(t) + ab := newMockAttemptBuilder(t) address1 := testutils.NewAddress() address2 := testutils.NewAddress() assert.NotEqual(t, address1, address2) addresses := []common.Address{address1, address2} - keystore := mocks.NewKeystore(t) + keystore := newMockKeystore(t) t.Run("retries if initial pending nonce call fails", func(t *testing.T) { lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) @@ -73,7 +72,7 @@ func TestTrigger(t *testing.T) { t.Parallel() address := testutils.NewAddress() - keystore := mocks.NewKeystore(t) + keystore := newMockKeystore(t) t.Run("Trigger fails if Txm is unstarted", func(t *testing.T) { lggr, observedLogs := logger.TestObserved(t, zap.ErrorLevel) txm := NewTxm(lggr, nil, nil, nil, nil, nil, Config{}, keystore) @@ -85,8 +84,8 @@ func TestTrigger(t *testing.T) { lggr := logger.Test(t) txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) require.NoError(t, txStore.Add(address)) - client := mocks.NewClient(t) - ab := mocks.NewAttemptBuilder(t) + client := newMockClient(t) + ab := newMockAttemptBuilder(t) config := Config{BlockTime: 1 * time.Minute, RetryBlockThreshold: 10} keystore.On("EnabledAddressesForChain", mock.Anything, mock.Anything).Return([]common.Address{address}, nil) txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) @@ -102,14 +101,14 @@ func TestBroadcastTransaction(t *testing.T) { t.Parallel() ctx := tests.Context(t) - client := mocks.NewClient(t) - ab := mocks.NewAttemptBuilder(t) + client := newMockClient(t) + ab := newMockAttemptBuilder(t) config := Config{} address := testutils.NewAddress() - keystore := mocks.NewKeystore(t) + keystore := newMockKeystore(t) t.Run("fails if FetchUnconfirmedTransactionAtNonceWithCount for unconfirmed transactions fails", func(t *testing.T) { - mTxStore := mocks.NewTxStore(t) + mTxStore := newMockTxStore(t) mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, 0, errors.New("call failed")).Once() txm := NewTxm(logger.Test(t), testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) bo, err := txm.broadcastTransaction(ctx, address) @@ -120,7 +119,7 @@ func TestBroadcastTransaction(t *testing.T) { t.Run("throws a warning and returns if unconfirmed transactions exceed maxInFlightTransactions", func(t *testing.T) { lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - mTxStore := mocks.NewTxStore(t) + mTxStore := newMockTxStore(t) mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, maxInFlightTransactions+1, nil).Once() txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) bo, err := txm.broadcastTransaction(ctx, address) @@ -131,7 +130,7 @@ func TestBroadcastTransaction(t *testing.T) { t.Run("checks pending nonce if unconfirmed transactions are equal or more than maxInFlightSubset", func(t *testing.T) { lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) - mTxStore := mocks.NewTxStore(t) + mTxStore := newMockTxStore(t) txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) txm.setNonce(address, 1) mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, maxInFlightSubset, nil).Twice() @@ -150,7 +149,7 @@ func TestBroadcastTransaction(t *testing.T) { }) t.Run("fails if UpdateUnstartedTransactionWithNonce fails", func(t *testing.T) { - mTxStore := mocks.NewTxStore(t) + mTxStore := newMockTxStore(t) mTxStore.On("FetchUnconfirmedTransactionAtNonceWithCount", mock.Anything, mock.Anything, mock.Anything).Return(nil, 0, nil).Once() txm := NewTxm(logger.Test(t), testutils.FixtureChainID, client, ab, mTxStore, nil, config, keystore) mTxStore.On("UpdateUnstartedTransactionWithNonce", mock.Anything, mock.Anything, mock.Anything).Return(nil, errors.New("call failed")).Once() @@ -217,12 +216,12 @@ func TestBackfillTransactions(t *testing.T) { t.Parallel() ctx := tests.Context(t) - client := mocks.NewClient(t) - ab := mocks.NewAttemptBuilder(t) - txStore := mocks.NewTxStore(t) + client := newMockClient(t) + ab := newMockAttemptBuilder(t) + txStore := newMockTxStore(t) config := Config{} address := testutils.NewAddress() - keystore := mocks.NewKeystore(t) + keystore := newMockKeystore(t) t.Run("fails if latest nonce fetching fails", func(t *testing.T) { txm := NewTxm(logger.Test(t), testutils.FixtureChainID, client, ab, txStore, nil, config, keystore) @@ -248,7 +247,7 @@ func TestBackfillTransactions(t *testing.T) { lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) require.NoError(t, txStore.Add(address)) - ab := mocks.NewAttemptBuilder(t) + ab := newMockAttemptBuilder(t) c := Config{EIP1559: false, BlockTime: 10 * time.Minute, RetryBlockThreshold: 10, EmptyTxLimitDefault: 22000} txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, c, keystore) emptyMetrics, err := NewTxmMetrics(testutils.FixtureChainID) @@ -290,7 +289,7 @@ func TestBackfillTransactions(t *testing.T) { lggr, observedLogs := logger.TestObserved(t, zap.DebugLevel) txStore := storage.NewInMemoryStoreManager(lggr, testutils.FixtureChainID) require.NoError(t, txStore.Add(address)) - ab := mocks.NewAttemptBuilder(t) + ab := newMockAttemptBuilder(t) c := Config{EIP1559: false, BlockTime: 1 * time.Second, RetryBlockThreshold: 1, EmptyTxLimitDefault: 22000} txm := NewTxm(lggr, testutils.FixtureChainID, client, ab, txStore, nil, c, keystore) emptyMetrics, err := NewTxmMetrics(testutils.FixtureChainID)