From 677a149a1e88e74e805482c779bbd3d8f296772e Mon Sep 17 00:00:00 2001 From: Michael Street <5597260+MStreet3@users.noreply.github.com> Date: Tue, 19 Nov 2024 23:56:09 +0200 Subject: [PATCH] chore(workflows+app): uses null implementation --- core/services/chainlink/application.go | 3 +-- .../workflows/syncer/workflow_registry.go | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index 9aebcc01f6b..fef741c8c9b 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -23,7 +23,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop" commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" @@ -216,7 +215,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) { // TODO: wire this up to config so we only instantiate it // if a workflow registry address is provided. - workflowRegistrySyncer := syncer.NewWorkflowRegistry[commontypes.ContractReader](nil, nil, nil, nil, "") + workflowRegistrySyncer := syncer.NewNullWorkflowRegistrySyncer() srvcs = append(srvcs, workflowRegistrySyncer) var externalPeerWrapper p2ptypes.PeerWrapper diff --git a/core/services/workflows/syncer/workflow_registry.go b/core/services/workflows/syncer/workflow_registry.go index b9df2110976..21933a542e5 100644 --- a/core/services/workflows/syncer/workflow_registry.go +++ b/core/services/workflows/syncer/workflow_registry.go @@ -554,3 +554,26 @@ func toWorkflowRegistryEventResponse( return resp } + +type nullWorkflowRegistrySyncer struct { + services.Service +} + +func NewNullWorkflowRegistrySyncer() *nullWorkflowRegistrySyncer { + return &nullWorkflowRegistrySyncer{} +} + +// Start +func (u *nullWorkflowRegistrySyncer) Start(context.Context) error { + return nil +} + +// Close +func (u *nullWorkflowRegistrySyncer) Close() error { + return nil +} + +// SecretsFor +func (u *nullWorkflowRegistrySyncer) SecretsFor(context.Context, string, string) (map[string]string, error) { + return nil, nil +}