Skip to content

Commit

Permalink
chore(workflows+app): uses null implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
MStreet3 committed Nov 19, 2024
1 parent f171581 commit 677a149
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
3 changes: 1 addition & 2 deletions core/services/chainlink/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
23 changes: 23 additions & 0 deletions core/services/workflows/syncer/workflow_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 677a149

Please sign in to comment.