diff --git a/GNUmakefile b/GNUmakefile index a4377ab2009..470d41c697b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -98,7 +98,7 @@ abigen: ## Build & install abigen. .PHONY: generate generate: abigen codecgen mockery protoc gomods ## Execute all go:generate commands. gomods -w go generate -x ./... - mockery + find . -type f -name .mockery.yaml -execdir mockery \; ## Execute mockery for all .mockery.yaml files .PHONY: rm-mocked rm-mocked: diff --git a/deployment/.mockery.yaml b/deployment/.mockery.yaml new file mode 100644 index 00000000000..79e4d52104a --- /dev/null +++ b/deployment/.mockery.yaml @@ -0,0 +1,13 @@ +dir: "{{ .InterfaceDir }}/mocks" +mockname: "{{ .InterfaceName }}" +outpkg: mocks +filename: "{{ .InterfaceName | snakecase }}.go" +packages: + github.com/smartcontractkit/chainlink/deployment: + interfaces: + OffchainClient: + config: + mockname: "Mock{{ .InterfaceName }}" + filename: offchain_client_mock.go + inpackage: true + dir: "{{ .InterfaceDir }}/mocks" \ No newline at end of file diff --git a/deployment/mocks/offchain_client_mock.go b/deployment/mocks/offchain_client_mock.go new file mode 100644 index 00000000000..de7a6df3a0d --- /dev/null +++ b/deployment/mocks/offchain_client_mock.go @@ -0,0 +1,1375 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package deployment + +import ( + context "context" + + csa "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/csa" + grpc "google.golang.org/grpc" + + job "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" + + mock "github.com/stretchr/testify/mock" + + node "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" +) + +// MockOffchainClient is an autogenerated mock type for the OffchainClient type +type MockOffchainClient struct { + mock.Mock +} + +type MockOffchainClient_Expecter struct { + mock *mock.Mock +} + +func (_m *MockOffchainClient) EXPECT() *MockOffchainClient_Expecter { + return &MockOffchainClient_Expecter{mock: &_m.Mock} +} + +// BatchProposeJob provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) BatchProposeJob(ctx context.Context, in *job.BatchProposeJobRequest, opts ...grpc.CallOption) (*job.BatchProposeJobResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for BatchProposeJob") + } + + var r0 *job.BatchProposeJobResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.BatchProposeJobRequest, ...grpc.CallOption) (*job.BatchProposeJobResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.BatchProposeJobRequest, ...grpc.CallOption) *job.BatchProposeJobResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.BatchProposeJobResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.BatchProposeJobRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_BatchProposeJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BatchProposeJob' +type MockOffchainClient_BatchProposeJob_Call struct { + *mock.Call +} + +// BatchProposeJob is a helper method to define mock.On call +// - ctx context.Context +// - in *job.BatchProposeJobRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) BatchProposeJob(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_BatchProposeJob_Call { + return &MockOffchainClient_BatchProposeJob_Call{Call: _e.mock.On("BatchProposeJob", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_BatchProposeJob_Call) Run(run func(ctx context.Context, in *job.BatchProposeJobRequest, opts ...grpc.CallOption)) *MockOffchainClient_BatchProposeJob_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.BatchProposeJobRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_BatchProposeJob_Call) Return(_a0 *job.BatchProposeJobResponse, _a1 error) *MockOffchainClient_BatchProposeJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_BatchProposeJob_Call) RunAndReturn(run func(context.Context, *job.BatchProposeJobRequest, ...grpc.CallOption) (*job.BatchProposeJobResponse, error)) *MockOffchainClient_BatchProposeJob_Call { + _c.Call.Return(run) + return _c +} + +// DeleteJob provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) DeleteJob(ctx context.Context, in *job.DeleteJobRequest, opts ...grpc.CallOption) (*job.DeleteJobResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DeleteJob") + } + + var r0 *job.DeleteJobResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.DeleteJobRequest, ...grpc.CallOption) (*job.DeleteJobResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.DeleteJobRequest, ...grpc.CallOption) *job.DeleteJobResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.DeleteJobResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.DeleteJobRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_DeleteJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJob' +type MockOffchainClient_DeleteJob_Call struct { + *mock.Call +} + +// DeleteJob is a helper method to define mock.On call +// - ctx context.Context +// - in *job.DeleteJobRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) DeleteJob(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_DeleteJob_Call { + return &MockOffchainClient_DeleteJob_Call{Call: _e.mock.On("DeleteJob", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_DeleteJob_Call) Run(run func(ctx context.Context, in *job.DeleteJobRequest, opts ...grpc.CallOption)) *MockOffchainClient_DeleteJob_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.DeleteJobRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_DeleteJob_Call) Return(_a0 *job.DeleteJobResponse, _a1 error) *MockOffchainClient_DeleteJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_DeleteJob_Call) RunAndReturn(run func(context.Context, *job.DeleteJobRequest, ...grpc.CallOption) (*job.DeleteJobResponse, error)) *MockOffchainClient_DeleteJob_Call { + _c.Call.Return(run) + return _c +} + +// DisableNode provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) DisableNode(ctx context.Context, in *node.DisableNodeRequest, opts ...grpc.CallOption) (*node.DisableNodeResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for DisableNode") + } + + var r0 *node.DisableNodeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *node.DisableNodeRequest, ...grpc.CallOption) (*node.DisableNodeResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *node.DisableNodeRequest, ...grpc.CallOption) *node.DisableNodeResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*node.DisableNodeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *node.DisableNodeRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_DisableNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableNode' +type MockOffchainClient_DisableNode_Call struct { + *mock.Call +} + +// DisableNode is a helper method to define mock.On call +// - ctx context.Context +// - in *node.DisableNodeRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) DisableNode(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_DisableNode_Call { + return &MockOffchainClient_DisableNode_Call{Call: _e.mock.On("DisableNode", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_DisableNode_Call) Run(run func(ctx context.Context, in *node.DisableNodeRequest, opts ...grpc.CallOption)) *MockOffchainClient_DisableNode_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*node.DisableNodeRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_DisableNode_Call) Return(_a0 *node.DisableNodeResponse, _a1 error) *MockOffchainClient_DisableNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_DisableNode_Call) RunAndReturn(run func(context.Context, *node.DisableNodeRequest, ...grpc.CallOption) (*node.DisableNodeResponse, error)) *MockOffchainClient_DisableNode_Call { + _c.Call.Return(run) + return _c +} + +// EnableNode provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) EnableNode(ctx context.Context, in *node.EnableNodeRequest, opts ...grpc.CallOption) (*node.EnableNodeResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for EnableNode") + } + + var r0 *node.EnableNodeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *node.EnableNodeRequest, ...grpc.CallOption) (*node.EnableNodeResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *node.EnableNodeRequest, ...grpc.CallOption) *node.EnableNodeResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*node.EnableNodeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *node.EnableNodeRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_EnableNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnableNode' +type MockOffchainClient_EnableNode_Call struct { + *mock.Call +} + +// EnableNode is a helper method to define mock.On call +// - ctx context.Context +// - in *node.EnableNodeRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) EnableNode(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_EnableNode_Call { + return &MockOffchainClient_EnableNode_Call{Call: _e.mock.On("EnableNode", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_EnableNode_Call) Run(run func(ctx context.Context, in *node.EnableNodeRequest, opts ...grpc.CallOption)) *MockOffchainClient_EnableNode_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*node.EnableNodeRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_EnableNode_Call) Return(_a0 *node.EnableNodeResponse, _a1 error) *MockOffchainClient_EnableNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_EnableNode_Call) RunAndReturn(run func(context.Context, *node.EnableNodeRequest, ...grpc.CallOption) (*node.EnableNodeResponse, error)) *MockOffchainClient_EnableNode_Call { + _c.Call.Return(run) + return _c +} + +// GetJob provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) GetJob(ctx context.Context, in *job.GetJobRequest, opts ...grpc.CallOption) (*job.GetJobResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetJob") + } + + var r0 *job.GetJobResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.GetJobRequest, ...grpc.CallOption) (*job.GetJobResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.GetJobRequest, ...grpc.CallOption) *job.GetJobResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.GetJobResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.GetJobRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_GetJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJob' +type MockOffchainClient_GetJob_Call struct { + *mock.Call +} + +// GetJob is a helper method to define mock.On call +// - ctx context.Context +// - in *job.GetJobRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) GetJob(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_GetJob_Call { + return &MockOffchainClient_GetJob_Call{Call: _e.mock.On("GetJob", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_GetJob_Call) Run(run func(ctx context.Context, in *job.GetJobRequest, opts ...grpc.CallOption)) *MockOffchainClient_GetJob_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.GetJobRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_GetJob_Call) Return(_a0 *job.GetJobResponse, _a1 error) *MockOffchainClient_GetJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_GetJob_Call) RunAndReturn(run func(context.Context, *job.GetJobRequest, ...grpc.CallOption) (*job.GetJobResponse, error)) *MockOffchainClient_GetJob_Call { + _c.Call.Return(run) + return _c +} + +// GetKeypair provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) GetKeypair(ctx context.Context, in *csa.GetKeypairRequest, opts ...grpc.CallOption) (*csa.GetKeypairResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetKeypair") + } + + var r0 *csa.GetKeypairResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *csa.GetKeypairRequest, ...grpc.CallOption) (*csa.GetKeypairResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *csa.GetKeypairRequest, ...grpc.CallOption) *csa.GetKeypairResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csa.GetKeypairResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *csa.GetKeypairRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_GetKeypair_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeypair' +type MockOffchainClient_GetKeypair_Call struct { + *mock.Call +} + +// GetKeypair is a helper method to define mock.On call +// - ctx context.Context +// - in *csa.GetKeypairRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) GetKeypair(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_GetKeypair_Call { + return &MockOffchainClient_GetKeypair_Call{Call: _e.mock.On("GetKeypair", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_GetKeypair_Call) Run(run func(ctx context.Context, in *csa.GetKeypairRequest, opts ...grpc.CallOption)) *MockOffchainClient_GetKeypair_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*csa.GetKeypairRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_GetKeypair_Call) Return(_a0 *csa.GetKeypairResponse, _a1 error) *MockOffchainClient_GetKeypair_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_GetKeypair_Call) RunAndReturn(run func(context.Context, *csa.GetKeypairRequest, ...grpc.CallOption) (*csa.GetKeypairResponse, error)) *MockOffchainClient_GetKeypair_Call { + _c.Call.Return(run) + return _c +} + +// GetNode provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) GetNode(ctx context.Context, in *node.GetNodeRequest, opts ...grpc.CallOption) (*node.GetNodeResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetNode") + } + + var r0 *node.GetNodeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *node.GetNodeRequest, ...grpc.CallOption) (*node.GetNodeResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *node.GetNodeRequest, ...grpc.CallOption) *node.GetNodeResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*node.GetNodeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *node.GetNodeRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_GetNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNode' +type MockOffchainClient_GetNode_Call struct { + *mock.Call +} + +// GetNode is a helper method to define mock.On call +// - ctx context.Context +// - in *node.GetNodeRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) GetNode(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_GetNode_Call { + return &MockOffchainClient_GetNode_Call{Call: _e.mock.On("GetNode", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_GetNode_Call) Run(run func(ctx context.Context, in *node.GetNodeRequest, opts ...grpc.CallOption)) *MockOffchainClient_GetNode_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*node.GetNodeRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_GetNode_Call) Return(_a0 *node.GetNodeResponse, _a1 error) *MockOffchainClient_GetNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_GetNode_Call) RunAndReturn(run func(context.Context, *node.GetNodeRequest, ...grpc.CallOption) (*node.GetNodeResponse, error)) *MockOffchainClient_GetNode_Call { + _c.Call.Return(run) + return _c +} + +// GetProposal provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) GetProposal(ctx context.Context, in *job.GetProposalRequest, opts ...grpc.CallOption) (*job.GetProposalResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetProposal") + } + + var r0 *job.GetProposalResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.GetProposalRequest, ...grpc.CallOption) (*job.GetProposalResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.GetProposalRequest, ...grpc.CallOption) *job.GetProposalResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.GetProposalResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.GetProposalRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_GetProposal_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposal' +type MockOffchainClient_GetProposal_Call struct { + *mock.Call +} + +// GetProposal is a helper method to define mock.On call +// - ctx context.Context +// - in *job.GetProposalRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) GetProposal(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_GetProposal_Call { + return &MockOffchainClient_GetProposal_Call{Call: _e.mock.On("GetProposal", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_GetProposal_Call) Run(run func(ctx context.Context, in *job.GetProposalRequest, opts ...grpc.CallOption)) *MockOffchainClient_GetProposal_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.GetProposalRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_GetProposal_Call) Return(_a0 *job.GetProposalResponse, _a1 error) *MockOffchainClient_GetProposal_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_GetProposal_Call) RunAndReturn(run func(context.Context, *job.GetProposalRequest, ...grpc.CallOption) (*job.GetProposalResponse, error)) *MockOffchainClient_GetProposal_Call { + _c.Call.Return(run) + return _c +} + +// ListJobs provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) ListJobs(ctx context.Context, in *job.ListJobsRequest, opts ...grpc.CallOption) (*job.ListJobsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ListJobs") + } + + var r0 *job.ListJobsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.ListJobsRequest, ...grpc.CallOption) (*job.ListJobsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.ListJobsRequest, ...grpc.CallOption) *job.ListJobsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.ListJobsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.ListJobsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_ListJobs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListJobs' +type MockOffchainClient_ListJobs_Call struct { + *mock.Call +} + +// ListJobs is a helper method to define mock.On call +// - ctx context.Context +// - in *job.ListJobsRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) ListJobs(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_ListJobs_Call { + return &MockOffchainClient_ListJobs_Call{Call: _e.mock.On("ListJobs", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_ListJobs_Call) Run(run func(ctx context.Context, in *job.ListJobsRequest, opts ...grpc.CallOption)) *MockOffchainClient_ListJobs_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.ListJobsRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_ListJobs_Call) Return(_a0 *job.ListJobsResponse, _a1 error) *MockOffchainClient_ListJobs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_ListJobs_Call) RunAndReturn(run func(context.Context, *job.ListJobsRequest, ...grpc.CallOption) (*job.ListJobsResponse, error)) *MockOffchainClient_ListJobs_Call { + _c.Call.Return(run) + return _c +} + +// ListKeypairs provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) ListKeypairs(ctx context.Context, in *csa.ListKeypairsRequest, opts ...grpc.CallOption) (*csa.ListKeypairsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ListKeypairs") + } + + var r0 *csa.ListKeypairsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *csa.ListKeypairsRequest, ...grpc.CallOption) (*csa.ListKeypairsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *csa.ListKeypairsRequest, ...grpc.CallOption) *csa.ListKeypairsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*csa.ListKeypairsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *csa.ListKeypairsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_ListKeypairs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListKeypairs' +type MockOffchainClient_ListKeypairs_Call struct { + *mock.Call +} + +// ListKeypairs is a helper method to define mock.On call +// - ctx context.Context +// - in *csa.ListKeypairsRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) ListKeypairs(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_ListKeypairs_Call { + return &MockOffchainClient_ListKeypairs_Call{Call: _e.mock.On("ListKeypairs", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_ListKeypairs_Call) Run(run func(ctx context.Context, in *csa.ListKeypairsRequest, opts ...grpc.CallOption)) *MockOffchainClient_ListKeypairs_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*csa.ListKeypairsRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_ListKeypairs_Call) Return(_a0 *csa.ListKeypairsResponse, _a1 error) *MockOffchainClient_ListKeypairs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_ListKeypairs_Call) RunAndReturn(run func(context.Context, *csa.ListKeypairsRequest, ...grpc.CallOption) (*csa.ListKeypairsResponse, error)) *MockOffchainClient_ListKeypairs_Call { + _c.Call.Return(run) + return _c +} + +// ListNodeChainConfigs provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) ListNodeChainConfigs(ctx context.Context, in *node.ListNodeChainConfigsRequest, opts ...grpc.CallOption) (*node.ListNodeChainConfigsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ListNodeChainConfigs") + } + + var r0 *node.ListNodeChainConfigsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *node.ListNodeChainConfigsRequest, ...grpc.CallOption) (*node.ListNodeChainConfigsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *node.ListNodeChainConfigsRequest, ...grpc.CallOption) *node.ListNodeChainConfigsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*node.ListNodeChainConfigsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *node.ListNodeChainConfigsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_ListNodeChainConfigs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListNodeChainConfigs' +type MockOffchainClient_ListNodeChainConfigs_Call struct { + *mock.Call +} + +// ListNodeChainConfigs is a helper method to define mock.On call +// - ctx context.Context +// - in *node.ListNodeChainConfigsRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) ListNodeChainConfigs(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_ListNodeChainConfigs_Call { + return &MockOffchainClient_ListNodeChainConfigs_Call{Call: _e.mock.On("ListNodeChainConfigs", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_ListNodeChainConfigs_Call) Run(run func(ctx context.Context, in *node.ListNodeChainConfigsRequest, opts ...grpc.CallOption)) *MockOffchainClient_ListNodeChainConfigs_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*node.ListNodeChainConfigsRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_ListNodeChainConfigs_Call) Return(_a0 *node.ListNodeChainConfigsResponse, _a1 error) *MockOffchainClient_ListNodeChainConfigs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_ListNodeChainConfigs_Call) RunAndReturn(run func(context.Context, *node.ListNodeChainConfigsRequest, ...grpc.CallOption) (*node.ListNodeChainConfigsResponse, error)) *MockOffchainClient_ListNodeChainConfigs_Call { + _c.Call.Return(run) + return _c +} + +// ListNodes provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) ListNodes(ctx context.Context, in *node.ListNodesRequest, opts ...grpc.CallOption) (*node.ListNodesResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ListNodes") + } + + var r0 *node.ListNodesResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *node.ListNodesRequest, ...grpc.CallOption) (*node.ListNodesResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *node.ListNodesRequest, ...grpc.CallOption) *node.ListNodesResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*node.ListNodesResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *node.ListNodesRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_ListNodes_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListNodes' +type MockOffchainClient_ListNodes_Call struct { + *mock.Call +} + +// ListNodes is a helper method to define mock.On call +// - ctx context.Context +// - in *node.ListNodesRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) ListNodes(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_ListNodes_Call { + return &MockOffchainClient_ListNodes_Call{Call: _e.mock.On("ListNodes", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_ListNodes_Call) Run(run func(ctx context.Context, in *node.ListNodesRequest, opts ...grpc.CallOption)) *MockOffchainClient_ListNodes_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*node.ListNodesRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_ListNodes_Call) Return(_a0 *node.ListNodesResponse, _a1 error) *MockOffchainClient_ListNodes_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_ListNodes_Call) RunAndReturn(run func(context.Context, *node.ListNodesRequest, ...grpc.CallOption) (*node.ListNodesResponse, error)) *MockOffchainClient_ListNodes_Call { + _c.Call.Return(run) + return _c +} + +// ListProposals provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) ListProposals(ctx context.Context, in *job.ListProposalsRequest, opts ...grpc.CallOption) (*job.ListProposalsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ListProposals") + } + + var r0 *job.ListProposalsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.ListProposalsRequest, ...grpc.CallOption) (*job.ListProposalsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.ListProposalsRequest, ...grpc.CallOption) *job.ListProposalsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.ListProposalsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.ListProposalsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_ListProposals_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListProposals' +type MockOffchainClient_ListProposals_Call struct { + *mock.Call +} + +// ListProposals is a helper method to define mock.On call +// - ctx context.Context +// - in *job.ListProposalsRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) ListProposals(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_ListProposals_Call { + return &MockOffchainClient_ListProposals_Call{Call: _e.mock.On("ListProposals", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_ListProposals_Call) Run(run func(ctx context.Context, in *job.ListProposalsRequest, opts ...grpc.CallOption)) *MockOffchainClient_ListProposals_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.ListProposalsRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_ListProposals_Call) Return(_a0 *job.ListProposalsResponse, _a1 error) *MockOffchainClient_ListProposals_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_ListProposals_Call) RunAndReturn(run func(context.Context, *job.ListProposalsRequest, ...grpc.CallOption) (*job.ListProposalsResponse, error)) *MockOffchainClient_ListProposals_Call { + _c.Call.Return(run) + return _c +} + +// ProposeJob provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) ProposeJob(ctx context.Context, in *job.ProposeJobRequest, opts ...grpc.CallOption) (*job.ProposeJobResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for ProposeJob") + } + + var r0 *job.ProposeJobResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.ProposeJobRequest, ...grpc.CallOption) (*job.ProposeJobResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.ProposeJobRequest, ...grpc.CallOption) *job.ProposeJobResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.ProposeJobResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.ProposeJobRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_ProposeJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ProposeJob' +type MockOffchainClient_ProposeJob_Call struct { + *mock.Call +} + +// ProposeJob is a helper method to define mock.On call +// - ctx context.Context +// - in *job.ProposeJobRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) ProposeJob(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_ProposeJob_Call { + return &MockOffchainClient_ProposeJob_Call{Call: _e.mock.On("ProposeJob", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_ProposeJob_Call) Run(run func(ctx context.Context, in *job.ProposeJobRequest, opts ...grpc.CallOption)) *MockOffchainClient_ProposeJob_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.ProposeJobRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_ProposeJob_Call) Return(_a0 *job.ProposeJobResponse, _a1 error) *MockOffchainClient_ProposeJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_ProposeJob_Call) RunAndReturn(run func(context.Context, *job.ProposeJobRequest, ...grpc.CallOption) (*job.ProposeJobResponse, error)) *MockOffchainClient_ProposeJob_Call { + _c.Call.Return(run) + return _c +} + +// RegisterNode provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) RegisterNode(ctx context.Context, in *node.RegisterNodeRequest, opts ...grpc.CallOption) (*node.RegisterNodeResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for RegisterNode") + } + + var r0 *node.RegisterNodeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *node.RegisterNodeRequest, ...grpc.CallOption) (*node.RegisterNodeResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *node.RegisterNodeRequest, ...grpc.CallOption) *node.RegisterNodeResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*node.RegisterNodeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *node.RegisterNodeRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_RegisterNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterNode' +type MockOffchainClient_RegisterNode_Call struct { + *mock.Call +} + +// RegisterNode is a helper method to define mock.On call +// - ctx context.Context +// - in *node.RegisterNodeRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) RegisterNode(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_RegisterNode_Call { + return &MockOffchainClient_RegisterNode_Call{Call: _e.mock.On("RegisterNode", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_RegisterNode_Call) Run(run func(ctx context.Context, in *node.RegisterNodeRequest, opts ...grpc.CallOption)) *MockOffchainClient_RegisterNode_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*node.RegisterNodeRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_RegisterNode_Call) Return(_a0 *node.RegisterNodeResponse, _a1 error) *MockOffchainClient_RegisterNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_RegisterNode_Call) RunAndReturn(run func(context.Context, *node.RegisterNodeRequest, ...grpc.CallOption) (*node.RegisterNodeResponse, error)) *MockOffchainClient_RegisterNode_Call { + _c.Call.Return(run) + return _c +} + +// RevokeJob provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) RevokeJob(ctx context.Context, in *job.RevokeJobRequest, opts ...grpc.CallOption) (*job.RevokeJobResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for RevokeJob") + } + + var r0 *job.RevokeJobResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.RevokeJobRequest, ...grpc.CallOption) (*job.RevokeJobResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.RevokeJobRequest, ...grpc.CallOption) *job.RevokeJobResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.RevokeJobResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.RevokeJobRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_RevokeJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RevokeJob' +type MockOffchainClient_RevokeJob_Call struct { + *mock.Call +} + +// RevokeJob is a helper method to define mock.On call +// - ctx context.Context +// - in *job.RevokeJobRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) RevokeJob(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_RevokeJob_Call { + return &MockOffchainClient_RevokeJob_Call{Call: _e.mock.On("RevokeJob", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_RevokeJob_Call) Run(run func(ctx context.Context, in *job.RevokeJobRequest, opts ...grpc.CallOption)) *MockOffchainClient_RevokeJob_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.RevokeJobRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_RevokeJob_Call) Return(_a0 *job.RevokeJobResponse, _a1 error) *MockOffchainClient_RevokeJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_RevokeJob_Call) RunAndReturn(run func(context.Context, *job.RevokeJobRequest, ...grpc.CallOption) (*job.RevokeJobResponse, error)) *MockOffchainClient_RevokeJob_Call { + _c.Call.Return(run) + return _c +} + +// UpdateJob provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) UpdateJob(ctx context.Context, in *job.UpdateJobRequest, opts ...grpc.CallOption) (*job.UpdateJobResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for UpdateJob") + } + + var r0 *job.UpdateJobResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *job.UpdateJobRequest, ...grpc.CallOption) (*job.UpdateJobResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *job.UpdateJobRequest, ...grpc.CallOption) *job.UpdateJobResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*job.UpdateJobResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *job.UpdateJobRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_UpdateJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateJob' +type MockOffchainClient_UpdateJob_Call struct { + *mock.Call +} + +// UpdateJob is a helper method to define mock.On call +// - ctx context.Context +// - in *job.UpdateJobRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) UpdateJob(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_UpdateJob_Call { + return &MockOffchainClient_UpdateJob_Call{Call: _e.mock.On("UpdateJob", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_UpdateJob_Call) Run(run func(ctx context.Context, in *job.UpdateJobRequest, opts ...grpc.CallOption)) *MockOffchainClient_UpdateJob_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*job.UpdateJobRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_UpdateJob_Call) Return(_a0 *job.UpdateJobResponse, _a1 error) *MockOffchainClient_UpdateJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_UpdateJob_Call) RunAndReturn(run func(context.Context, *job.UpdateJobRequest, ...grpc.CallOption) (*job.UpdateJobResponse, error)) *MockOffchainClient_UpdateJob_Call { + _c.Call.Return(run) + return _c +} + +// UpdateNode provides a mock function with given fields: ctx, in, opts +func (_m *MockOffchainClient) UpdateNode(ctx context.Context, in *node.UpdateNodeRequest, opts ...grpc.CallOption) (*node.UpdateNodeResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for UpdateNode") + } + + var r0 *node.UpdateNodeResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *node.UpdateNodeRequest, ...grpc.CallOption) (*node.UpdateNodeResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *node.UpdateNodeRequest, ...grpc.CallOption) *node.UpdateNodeResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*node.UpdateNodeResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *node.UpdateNodeRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockOffchainClient_UpdateNode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateNode' +type MockOffchainClient_UpdateNode_Call struct { + *mock.Call +} + +// UpdateNode is a helper method to define mock.On call +// - ctx context.Context +// - in *node.UpdateNodeRequest +// - opts ...grpc.CallOption +func (_e *MockOffchainClient_Expecter) UpdateNode(ctx interface{}, in interface{}, opts ...interface{}) *MockOffchainClient_UpdateNode_Call { + return &MockOffchainClient_UpdateNode_Call{Call: _e.mock.On("UpdateNode", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockOffchainClient_UpdateNode_Call) Run(run func(ctx context.Context, in *node.UpdateNodeRequest, opts ...grpc.CallOption)) *MockOffchainClient_UpdateNode_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*node.UpdateNodeRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockOffchainClient_UpdateNode_Call) Return(_a0 *node.UpdateNodeResponse, _a1 error) *MockOffchainClient_UpdateNode_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockOffchainClient_UpdateNode_Call) RunAndReturn(run func(context.Context, *node.UpdateNodeRequest, ...grpc.CallOption) (*node.UpdateNodeResponse, error)) *MockOffchainClient_UpdateNode_Call { + _c.Call.Return(run) + return _c +} + +// NewMockOffchainClient creates a new instance of MockOffchainClient. 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 NewMockOffchainClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MockOffchainClient { + mock := &MockOffchainClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +}