From 875d583ba1332acf2391d3ab3b214128c1faa2dc Mon Sep 17 00:00:00 2001 From: Gabriel Paradiso Date: Mon, 18 Nov 2024 16:00:03 -0300 Subject: [PATCH] feat: expose workflow key to clo --- .mockery.yaml | 1 + core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +- core/services/feeds/service.go | 22 ++ core/services/feeds/service_test.go | 86 ++-- core/services/keystore/mocks/workflow.go | 474 +++++++++++++++++++++++ deployment/go.mod | 2 +- deployment/go.sum | 4 +- go.mod | 2 +- go.sum | 4 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +- integration-tests/load/go.mod | 2 +- integration-tests/load/go.sum | 4 +- 14 files changed, 568 insertions(+), 45 deletions(-) create mode 100644 core/services/keystore/mocks/workflow.go diff --git a/.mockery.yaml b/.mockery.yaml index 711d70f59e9..b12941f7093 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -234,6 +234,7 @@ packages: config: filename: starknet.go VRF: + Workflow: github.com/smartcontractkit/chainlink/v2/core/services/ocr: interfaces: OCRContractTrackerDB: diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 63167093ed4..e464223610b 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -411,7 +411,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 719ea492a88..b26354f648b 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1419,8 +1419,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeDUAjvCXRh08+4xBRX33owH5MqC522JdelM0= github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 h1:r8shFMAbMmhAcXWrj/etTbdv+ghyzFpiK/uCOP5ijgE= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e h1:XxTWJ9VIXK+XuAjP5131PqqBn0NEt5lBvnRAWRdqy8A= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= diff --git a/core/services/feeds/service.go b/core/services/feeds/service.go index f986d1753af..3b66e0dd22b 100644 --- a/core/services/feeds/service.go +++ b/core/services/feeds/service.go @@ -31,6 +31,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" "github.com/smartcontractkit/chainlink/v2/core/services/ocr" ocr2 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/validate" "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" @@ -126,6 +127,7 @@ type service struct { p2pKeyStore keystore.P2P ocr1KeyStore keystore.OCR ocr2KeyStore keystore.OCR2 + workflowKeyStore keystore.Workflow jobSpawner job.Spawner gCfg GeneralConfig featCfg FeatureConfig @@ -168,6 +170,7 @@ func NewService( csaKeyStore: keyStore.CSA(), ocr1KeyStore: keyStore.OCR(), ocr2KeyStore: keyStore.OCR2(), + workflowKeyStore: keyStore.Workflow(), gCfg: gCfg, featCfg: fCfg, insecureCfg: insecureCfg, @@ -275,9 +278,15 @@ func (s *service) SyncNodeInfo(ctx context.Context, id int64) error { cfgMsgs = append(cfgMsgs, cfgMsg) } + workflowKey, err := s.getWorkflowKey() + if err != nil { + return errors.Wrap(err, "could not fetch workflow key") + } + if _, err = fmsClient.UpdateNode(ctx, &pb.UpdateNodeRequest{ Version: s.version, ChainConfigs: cfgMsgs, + WorkflowKey: workflowKey.PublicKeyString(), }); err != nil { return err } @@ -1143,6 +1152,19 @@ func (s *service) getCSAPrivateKey() (privkey []byte, err error) { return keys[0].Raw(), nil } +// getWorkflowKey gets the server's Workflow key +// because we will have only one key, we can get the first key +func (s *service) getWorkflowKey() (*workflowkey.Key, error) { + keys, err := s.workflowKeyStore.GetAll() + if err != nil { + return nil, err + } + if len(keys) < 1 { + return nil, errors.New("Workflow key does not exist") + } + return &keys[0], nil +} + // observeJobProposalCounts is a helper method that queries the repository for the count of // job proposals by status and then updates prometheus gauges. func (s *service) observeJobProposalCounts(ctx context.Context) error { diff --git a/core/services/feeds/service_test.go b/core/services/feeds/service_test.go index 115695d8514..62ffe8f27a6 100644 --- a/core/services/feeds/service_test.go +++ b/core/services/feeds/service_test.go @@ -38,6 +38,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/csakey" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/keystest" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocrkey" + "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" ksmocks "github.com/smartcontractkit/chainlink/v2/core/services/keystore/mocks" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/versioning" @@ -146,16 +147,17 @@ chainID = 1337 type TestService struct { feeds.Service - orm *mocks.ORM - jobORM *jobmocks.ORM - connMgr *mocks.ConnectionsManager - spawner *jobmocks.Spawner - fmsClient *mocks.FeedsManagerClient - csaKeystore *ksmocks.CSA - p2pKeystore *ksmocks.P2P - ocr1Keystore *ksmocks.OCR - ocr2Keystore *ksmocks.OCR2 - legacyChains legacyevm.LegacyChainContainer + orm *mocks.ORM + jobORM *jobmocks.ORM + connMgr *mocks.ConnectionsManager + spawner *jobmocks.Spawner + fmsClient *mocks.FeedsManagerClient + csaKeystore *ksmocks.CSA + p2pKeystore *ksmocks.P2P + ocr1Keystore *ksmocks.OCR + ocr2Keystore *ksmocks.OCR2 + workflowKeystore *ksmocks.Workflow + legacyChains legacyevm.LegacyChainContainer } func setupTestService(t *testing.T) *TestService { @@ -168,15 +170,16 @@ func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s * t.Helper() var ( - orm = mocks.NewORM(t) - jobORM = jobmocks.NewORM(t) - connMgr = mocks.NewConnectionsManager(t) - spawner = jobmocks.NewSpawner(t) - fmsClient = mocks.NewFeedsManagerClient(t) - csaKeystore = ksmocks.NewCSA(t) - p2pKeystore = ksmocks.NewP2P(t) - ocr1Keystore = ksmocks.NewOCR(t) - ocr2Keystore = ksmocks.NewOCR2(t) + orm = mocks.NewORM(t) + jobORM = jobmocks.NewORM(t) + connMgr = mocks.NewConnectionsManager(t) + spawner = jobmocks.NewSpawner(t) + fmsClient = mocks.NewFeedsManagerClient(t) + csaKeystore = ksmocks.NewCSA(t) + p2pKeystore = ksmocks.NewP2P(t) + ocr1Keystore = ksmocks.NewOCR(t) + ocr2Keystore = ksmocks.NewOCR2(t) + workflowKeystore = ksmocks.NewWorkflow(t) ) lggr := logger.TestLogger(t) @@ -192,21 +195,23 @@ func setupTestServiceCfg(t *testing.T, overrideCfg func(c *chainlink.Config, s * keyStore.On("P2P").Return(p2pKeystore) keyStore.On("OCR").Return(ocr1Keystore) keyStore.On("OCR2").Return(ocr2Keystore) + keyStore.On("Workflow").Return(workflowKeystore) svc := feeds.NewService(orm, jobORM, db, spawner, keyStore, gcfg, gcfg.Feature(), gcfg.Insecure(), gcfg.JobPipeline(), gcfg.OCR(), gcfg.OCR2(), legacyChains, lggr, "1.0.0", nil) svc.SetConnectionsManager(connMgr) return &TestService{ - Service: svc, - orm: orm, - jobORM: jobORM, - connMgr: connMgr, - spawner: spawner, - fmsClient: fmsClient, - csaKeystore: csaKeystore, - p2pKeystore: p2pKeystore, - ocr1Keystore: ocr1Keystore, - ocr2Keystore: ocr2Keystore, - legacyChains: legacyChains, + Service: svc, + orm: orm, + jobORM: jobORM, + connMgr: connMgr, + spawner: spawner, + fmsClient: fmsClient, + csaKeystore: csaKeystore, + p2pKeystore: p2pKeystore, + ocr1Keystore: ocr1Keystore, + ocr2Keystore: ocr2Keystore, + workflowKeystore: workflowKeystore, + legacyChains: legacyChains, } } @@ -576,6 +581,10 @@ func Test_Service_CreateChainConfig(t *testing.T) { svc = setupTestService(t) ) + workflowKey, err := workflowkey.New() + require.NoError(t, err) + svc.workflowKeystore.On("GetAll").Return([]workflowkey.Key{workflowKey}, nil) + svc.orm.On("CreateChainConfig", mock.Anything, cfg).Return(int64(1), nil) svc.orm.On("GetManager", mock.Anything, mgr.ID).Return(&mgr, nil) svc.connMgr.On("GetClient", mgr.ID).Return(svc.fmsClient, nil) @@ -596,6 +605,7 @@ func Test_Service_CreateChainConfig(t *testing.T) { Ocr2Config: &proto.OCR2Config{Enabled: false}, }, }, + WorkflowKey: workflowKey.ID(), }).Return(&proto.UpdateNodeResponse{}, nil) actual, err := svc.CreateChainConfig(testutils.Context(t), cfg) @@ -640,6 +650,10 @@ func Test_Service_DeleteChainConfig(t *testing.T) { svc = setupTestService(t) ) + workflowKey, err := workflowkey.New() + require.NoError(t, err) + svc.workflowKeystore.On("GetAll").Return([]workflowkey.Key{workflowKey}, nil) + svc.orm.On("GetChainConfig", mock.Anything, cfg.ID).Return(&cfg, nil) svc.orm.On("DeleteChainConfig", mock.Anything, cfg.ID).Return(cfg.ID, nil) svc.orm.On("GetManager", mock.Anything, mgr.ID).Return(&mgr, nil) @@ -648,6 +662,7 @@ func Test_Service_DeleteChainConfig(t *testing.T) { svc.fmsClient.On("UpdateNode", mock.Anything, &proto.UpdateNodeRequest{ Version: nodeVersion.Version, ChainConfigs: []*proto.ChainConfig{}, + WorkflowKey: workflowKey.ID(), }).Return(&proto.UpdateNodeResponse{}, nil) actual, err := svc.DeleteChainConfig(testutils.Context(t), cfg.ID) @@ -725,6 +740,10 @@ func Test_Service_UpdateChainConfig(t *testing.T) { svc = setupTestService(t) ) + workflowKey, err := workflowkey.New() + require.NoError(t, err) + svc.workflowKeystore.On("GetAll").Return([]workflowkey.Key{workflowKey}, nil) + svc.orm.On("UpdateChainConfig", mock.Anything, cfg).Return(int64(1), nil) svc.orm.On("GetChainConfig", mock.Anything, cfg.ID).Return(&cfg, nil) svc.connMgr.On("GetClient", mgr.ID).Return(svc.fmsClient, nil) @@ -745,6 +764,7 @@ func Test_Service_UpdateChainConfig(t *testing.T) { Ocr2Config: &proto.OCR2Config{Enabled: false}, }, }, + WorkflowKey: workflowKey.ID(), }).Return(&proto.UpdateNodeResponse{}, nil) actual, err := svc.UpdateChainConfig(testutils.Context(t), cfg) @@ -1625,6 +1645,9 @@ func Test_Service_SyncNodeInfo(t *testing.T) { ocrKey, err := ocrkey.NewV2() require.NoError(t, err) + workflowKey, err := workflowkey.New() + require.NoError(t, err) + var ( multiaddr = "/dns4/chain.link/tcp/1234/p2p/16Uiu2HAm58SP7UL8zsnpeuwHfytLocaqgnyaYKP8wu7qRdrixLju" mgr = &feeds.FeedsManager{ID: 1} @@ -1672,6 +1695,8 @@ func Test_Service_SyncNodeInfo(t *testing.T) { svc.p2pKeystore.On("Get", p2pKey.PeerID()).Return(p2pKey, nil) svc.ocr1Keystore.On("Get", ocrKey.GetID()).Return(ocrKey, nil) + svc.workflowKeystore.On("GetAll").Return([]workflowkey.Key{workflowKey}, nil) + svc.fmsClient.On("UpdateNode", mock.Anything, &proto.UpdateNodeRequest{ Version: nodeVersion.Version, ChainConfigs: []*proto.ChainConfig{ @@ -1712,6 +1737,7 @@ func Test_Service_SyncNodeInfo(t *testing.T) { }, }, }, + WorkflowKey: workflowKey.ID(), }).Return(&proto.UpdateNodeResponse{}, nil) err = svc.SyncNodeInfo(testutils.Context(t), mgr.ID) diff --git a/core/services/keystore/mocks/workflow.go b/core/services/keystore/mocks/workflow.go new file mode 100644 index 00000000000..f19045cecc4 --- /dev/null +++ b/core/services/keystore/mocks/workflow.go @@ -0,0 +1,474 @@ +// Code generated by mockery v2.46.3. DO NOT EDIT. + +package mocks + +import ( + context "context" + + mock "github.com/stretchr/testify/mock" + + workflowkey "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/workflowkey" +) + +// Workflow is an autogenerated mock type for the Workflow type +type Workflow struct { + mock.Mock +} + +type Workflow_Expecter struct { + mock *mock.Mock +} + +func (_m *Workflow) EXPECT() *Workflow_Expecter { + return &Workflow_Expecter{mock: &_m.Mock} +} + +// Add provides a mock function with given fields: ctx, key +func (_m *Workflow) Add(ctx context.Context, key workflowkey.Key) error { + ret := _m.Called(ctx, key) + + if len(ret) == 0 { + panic("no return value specified for Add") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, workflowkey.Key) error); ok { + r0 = rf(ctx, key) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Workflow_Add_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Add' +type Workflow_Add_Call struct { + *mock.Call +} + +// Add is a helper method to define mock.On call +// - ctx context.Context +// - key workflowkey.Key +func (_e *Workflow_Expecter) Add(ctx interface{}, key interface{}) *Workflow_Add_Call { + return &Workflow_Add_Call{Call: _e.mock.On("Add", ctx, key)} +} + +func (_c *Workflow_Add_Call) Run(run func(ctx context.Context, key workflowkey.Key)) *Workflow_Add_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(workflowkey.Key)) + }) + return _c +} + +func (_c *Workflow_Add_Call) Return(_a0 error) *Workflow_Add_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_Add_Call) RunAndReturn(run func(context.Context, workflowkey.Key) error) *Workflow_Add_Call { + _c.Call.Return(run) + return _c +} + +// Create provides a mock function with given fields: ctx +func (_m *Workflow) Create(ctx context.Context) (workflowkey.Key, error) { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for Create") + } + + var r0 workflowkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (workflowkey.Key, error)); ok { + return rf(ctx) + } + if rf, ok := ret.Get(0).(func(context.Context) workflowkey.Key); ok { + r0 = rf(ctx) + } else { + r0 = ret.Get(0).(workflowkey.Key) + } + + if rf, ok := ret.Get(1).(func(context.Context) error); ok { + r1 = rf(ctx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Workflow_Create_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Create' +type Workflow_Create_Call struct { + *mock.Call +} + +// Create is a helper method to define mock.On call +// - ctx context.Context +func (_e *Workflow_Expecter) Create(ctx interface{}) *Workflow_Create_Call { + return &Workflow_Create_Call{Call: _e.mock.On("Create", ctx)} +} + +func (_c *Workflow_Create_Call) Run(run func(ctx context.Context)) *Workflow_Create_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Workflow_Create_Call) Return(_a0 workflowkey.Key, _a1 error) *Workflow_Create_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Workflow_Create_Call) RunAndReturn(run func(context.Context) (workflowkey.Key, error)) *Workflow_Create_Call { + _c.Call.Return(run) + return _c +} + +// Delete provides a mock function with given fields: ctx, id +func (_m *Workflow) Delete(ctx context.Context, id string) (workflowkey.Key, error) { + ret := _m.Called(ctx, id) + + if len(ret) == 0 { + panic("no return value specified for Delete") + } + + var r0 workflowkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (workflowkey.Key, error)); ok { + return rf(ctx, id) + } + if rf, ok := ret.Get(0).(func(context.Context, string) workflowkey.Key); ok { + r0 = rf(ctx, id) + } else { + r0 = ret.Get(0).(workflowkey.Key) + } + + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Workflow_Delete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Delete' +type Workflow_Delete_Call struct { + *mock.Call +} + +// Delete is a helper method to define mock.On call +// - ctx context.Context +// - id string +func (_e *Workflow_Expecter) Delete(ctx interface{}, id interface{}) *Workflow_Delete_Call { + return &Workflow_Delete_Call{Call: _e.mock.On("Delete", ctx, id)} +} + +func (_c *Workflow_Delete_Call) Run(run func(ctx context.Context, id string)) *Workflow_Delete_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Workflow_Delete_Call) Return(_a0 workflowkey.Key, _a1 error) *Workflow_Delete_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Workflow_Delete_Call) RunAndReturn(run func(context.Context, string) (workflowkey.Key, error)) *Workflow_Delete_Call { + _c.Call.Return(run) + return _c +} + +// EnsureKey provides a mock function with given fields: ctx +func (_m *Workflow) EnsureKey(ctx context.Context) error { + ret := _m.Called(ctx) + + if len(ret) == 0 { + panic("no return value specified for EnsureKey") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context) error); ok { + r0 = rf(ctx) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Workflow_EnsureKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'EnsureKey' +type Workflow_EnsureKey_Call struct { + *mock.Call +} + +// EnsureKey is a helper method to define mock.On call +// - ctx context.Context +func (_e *Workflow_Expecter) EnsureKey(ctx interface{}) *Workflow_EnsureKey_Call { + return &Workflow_EnsureKey_Call{Call: _e.mock.On("EnsureKey", ctx)} +} + +func (_c *Workflow_EnsureKey_Call) Run(run func(ctx context.Context)) *Workflow_EnsureKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Workflow_EnsureKey_Call) Return(_a0 error) *Workflow_EnsureKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Workflow_EnsureKey_Call) RunAndReturn(run func(context.Context) error) *Workflow_EnsureKey_Call { + _c.Call.Return(run) + return _c +} + +// Export provides a mock function with given fields: id, password +func (_m *Workflow) Export(id string, password string) ([]byte, error) { + ret := _m.Called(id, password) + + if len(ret) == 0 { + panic("no return value specified for Export") + } + + var r0 []byte + var r1 error + if rf, ok := ret.Get(0).(func(string, string) ([]byte, error)); ok { + return rf(id, password) + } + if rf, ok := ret.Get(0).(func(string, string) []byte); ok { + r0 = rf(id, password) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]byte) + } + } + + if rf, ok := ret.Get(1).(func(string, string) error); ok { + r1 = rf(id, password) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Workflow_Export_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Export' +type Workflow_Export_Call struct { + *mock.Call +} + +// Export is a helper method to define mock.On call +// - id string +// - password string +func (_e *Workflow_Expecter) Export(id interface{}, password interface{}) *Workflow_Export_Call { + return &Workflow_Export_Call{Call: _e.mock.On("Export", id, password)} +} + +func (_c *Workflow_Export_Call) Run(run func(id string, password string)) *Workflow_Export_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string), args[1].(string)) + }) + return _c +} + +func (_c *Workflow_Export_Call) Return(_a0 []byte, _a1 error) *Workflow_Export_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Workflow_Export_Call) RunAndReturn(run func(string, string) ([]byte, error)) *Workflow_Export_Call { + _c.Call.Return(run) + return _c +} + +// Get provides a mock function with given fields: id +func (_m *Workflow) Get(id string) (workflowkey.Key, error) { + ret := _m.Called(id) + + if len(ret) == 0 { + panic("no return value specified for Get") + } + + var r0 workflowkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(string) (workflowkey.Key, error)); ok { + return rf(id) + } + if rf, ok := ret.Get(0).(func(string) workflowkey.Key); ok { + r0 = rf(id) + } else { + r0 = ret.Get(0).(workflowkey.Key) + } + + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(id) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Workflow_Get_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Get' +type Workflow_Get_Call struct { + *mock.Call +} + +// Get is a helper method to define mock.On call +// - id string +func (_e *Workflow_Expecter) Get(id interface{}) *Workflow_Get_Call { + return &Workflow_Get_Call{Call: _e.mock.On("Get", id)} +} + +func (_c *Workflow_Get_Call) Run(run func(id string)) *Workflow_Get_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(string)) + }) + return _c +} + +func (_c *Workflow_Get_Call) Return(_a0 workflowkey.Key, _a1 error) *Workflow_Get_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Workflow_Get_Call) RunAndReturn(run func(string) (workflowkey.Key, error)) *Workflow_Get_Call { + _c.Call.Return(run) + return _c +} + +// GetAll provides a mock function with given fields: +func (_m *Workflow) GetAll() ([]workflowkey.Key, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAll") + } + + var r0 []workflowkey.Key + var r1 error + if rf, ok := ret.Get(0).(func() ([]workflowkey.Key, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []workflowkey.Key); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]workflowkey.Key) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Workflow_GetAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAll' +type Workflow_GetAll_Call struct { + *mock.Call +} + +// GetAll is a helper method to define mock.On call +func (_e *Workflow_Expecter) GetAll() *Workflow_GetAll_Call { + return &Workflow_GetAll_Call{Call: _e.mock.On("GetAll")} +} + +func (_c *Workflow_GetAll_Call) Run(run func()) *Workflow_GetAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Workflow_GetAll_Call) Return(_a0 []workflowkey.Key, _a1 error) *Workflow_GetAll_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Workflow_GetAll_Call) RunAndReturn(run func() ([]workflowkey.Key, error)) *Workflow_GetAll_Call { + _c.Call.Return(run) + return _c +} + +// Import provides a mock function with given fields: ctx, keyJSON, password +func (_m *Workflow) Import(ctx context.Context, keyJSON []byte, password string) (workflowkey.Key, error) { + ret := _m.Called(ctx, keyJSON, password) + + if len(ret) == 0 { + panic("no return value specified for Import") + } + + var r0 workflowkey.Key + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, []byte, string) (workflowkey.Key, error)); ok { + return rf(ctx, keyJSON, password) + } + if rf, ok := ret.Get(0).(func(context.Context, []byte, string) workflowkey.Key); ok { + r0 = rf(ctx, keyJSON, password) + } else { + r0 = ret.Get(0).(workflowkey.Key) + } + + if rf, ok := ret.Get(1).(func(context.Context, []byte, string) error); ok { + r1 = rf(ctx, keyJSON, password) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Workflow_Import_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Import' +type Workflow_Import_Call struct { + *mock.Call +} + +// Import is a helper method to define mock.On call +// - ctx context.Context +// - keyJSON []byte +// - password string +func (_e *Workflow_Expecter) Import(ctx interface{}, keyJSON interface{}, password interface{}) *Workflow_Import_Call { + return &Workflow_Import_Call{Call: _e.mock.On("Import", ctx, keyJSON, password)} +} + +func (_c *Workflow_Import_Call) Run(run func(ctx context.Context, keyJSON []byte, password string)) *Workflow_Import_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].([]byte), args[2].(string)) + }) + return _c +} + +func (_c *Workflow_Import_Call) Return(_a0 workflowkey.Key, _a1 error) *Workflow_Import_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Workflow_Import_Call) RunAndReturn(run func(context.Context, []byte, string) (workflowkey.Key, error)) *Workflow_Import_Call { + _c.Call.Return(run) + return _c +} + +// NewWorkflow creates a new instance of Workflow. 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 NewWorkflow(t interface { + mock.TestingT + Cleanup(func()) +}) *Workflow { + mock := &Workflow{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/deployment/go.mod b/deployment/go.mod index 0e9b16bad92..728da80957c 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -404,7 +404,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index b21fdc94975..f5421f3186b 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1394,8 +1394,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeDUAjvCXRh08+4xBRX33owH5MqC522JdelM0= github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 h1:r8shFMAbMmhAcXWrj/etTbdv+ghyzFpiK/uCOP5ijgE= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e h1:XxTWJ9VIXK+XuAjP5131PqqBn0NEt5lBvnRAWRdqy8A= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= diff --git a/go.mod b/go.mod index e6039802f93..08359da29bc 100644 --- a/go.mod +++ b/go.mod @@ -81,7 +81,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 - github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 + github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 diff --git a/go.sum b/go.sum index 270966b2a91..83a9ebfca1e 100644 --- a/go.sum +++ b/go.sum @@ -1086,8 +1086,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e/go.mod h1:iK3BNHKCLgSgkOyiu3iE7sfZ20Qnuk7xwjV/yO/6gnQ= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 h1:r8shFMAbMmhAcXWrj/etTbdv+ghyzFpiK/uCOP5ijgE= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e h1:XxTWJ9VIXK+XuAjP5131PqqBn0NEt5lBvnRAWRdqy8A= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index e3054210700..37550d1cad6 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -417,7 +417,7 @@ require ( github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index b2ea8488a23..98501b4c302 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1415,8 +1415,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeDUAjvCXRh08+4xBRX33owH5MqC522JdelM0= github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 h1:r8shFMAbMmhAcXWrj/etTbdv+ghyzFpiK/uCOP5ijgE= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e h1:XxTWJ9VIXK+XuAjP5131PqqBn0NEt5lBvnRAWRdqy8A= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 9a1fb0d62ab..354f4351c98 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -424,7 +424,7 @@ require ( github.com/smartcontractkit/chainlink-automation v0.8.1 // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect - github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect + github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 // indirect github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index 9b3962dd1a5..734ea8338ee 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1402,8 +1402,8 @@ github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e/go.mod h1:iK3BNHKCLgSgkOyiu3iE7sfZ20Qnuk7xwjV/yO/6gnQ= github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6AnNt+Wg64sVG+XSA49c= github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= -github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1 h1:r8shFMAbMmhAcXWrj/etTbdv+ghyzFpiK/uCOP5ijgE= +github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.1/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e h1:XxTWJ9VIXK+XuAjP5131PqqBn0NEt5lBvnRAWRdqy8A= github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241115191142-8b8369c1f44e/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA=