From a2563d3273c4cef67bb9dc576689dff98ac546d5 Mon Sep 17 00:00:00 2001 From: Aleksandr Bukata Date: Tue, 30 Jul 2024 13:34:46 +0100 Subject: [PATCH] merge --- core/internal/cltest/cltest.go | 28 +++++++++++++++++++++++++ core/services/chainlink/application.go | 5 ++--- core/services/synchronization/common.go | 1 + 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/core/internal/cltest/cltest.go b/core/internal/cltest/cltest.go index 90d4ba471f..6797b44f7e 100644 --- a/core/internal/cltest/cltest.go +++ b/core/internal/cltest/cltest.go @@ -7,6 +7,9 @@ import ( "encoding/json" "errors" "fmt" + "github.com/smartcontractkit/chainlink/v2/core/capabilities" + remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" + p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types" "io" "math/big" "math/rand" @@ -317,6 +320,31 @@ func NewApplicationWithConfig(t testing.TB, cfg chainlink.GeneralConfig, flagsAn auditLogger = audit.NoopLogger } + var capabilitiesRegistry *capabilities.Registry + capabilitiesRegistry = capabilities.NewRegistry(lggr) + for _, dep := range flagsAndDeps { + registry, _ := dep.(*capabilities.Registry) + if registry != nil { + capabilitiesRegistry = registry + } + } + + var dispatcher remotetypes.Dispatcher + for _, dep := range flagsAndDeps { + dispatcher, _ = dep.(remotetypes.Dispatcher) + if dispatcher != nil { + break + } + } + + var peerWrapper p2ptypes.PeerWrapper + for _, dep := range flagsAndDeps { + peerWrapper, _ = dep.(p2ptypes.PeerWrapper) + if peerWrapper != nil { + break + } + } + url := cfg.Database().URL() db, err := pg.NewConnection(url.String(), cfg.Database().Dialect(), cfg.Database()) require.NoError(t, err) diff --git a/core/services/chainlink/application.go b/core/services/chainlink/application.go index 4c5f30871d..e0dd9e8c1b 100644 --- a/core/services/chainlink/application.go +++ b/core/services/chainlink/application.go @@ -4,6 +4,7 @@ import ( "bytes" "context" "fmt" + remotetypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/remote/types" "math/big" "net/http" "sync" @@ -21,7 +22,6 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop" commonservices "github.com/smartcontractkit/chainlink-common/pkg/services" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" - coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core" "github.com/smartcontractkit/chainlink-common/pkg/utils" "github.com/smartcontractkit/chainlink-common/pkg/utils/jsonserializable" "github.com/smartcontractkit/chainlink-common/pkg/utils/mailbox" @@ -59,7 +59,6 @@ import ( externalp2p "github.com/smartcontractkit/chainlink/v2/core/services/p2p/wrapper" "github.com/smartcontractkit/chainlink/v2/core/services/periodicbackup" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" - "github.com/smartcontractkit/chainlink/v2/core/services/promreporter" "github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury" "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/mercury/wsrpc" @@ -530,7 +529,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) { opts.KeyStore, opts.DS, peerWrapper, - telemetryManager, + opts.TelemetryManager, cfg.Capabilities(), ) } else { diff --git a/core/services/synchronization/common.go b/core/services/synchronization/common.go index 394830a76a..a6c0191e3a 100644 --- a/core/services/synchronization/common.go +++ b/core/services/synchronization/common.go @@ -28,6 +28,7 @@ const ( OCR3CCIPCommit TelemetryType = "ocr3-ccip-commit" OCR3CCIPExec TelemetryType = "ocr3-ccip-exec" OCR3CCIPBootstrap TelemetryType = "ocr3-bootstrap" + HeadReport TelemetryType = "head-report" ) type TelemPayload struct {