From 5a1f556b60dbcbae27e2f8b281770b0b715fc3e9 Mon Sep 17 00:00:00 2001 From: vyzaldysanchez Date: Mon, 22 Apr 2024 10:53:25 -0400 Subject: [PATCH] Fixes typo and remove unnecessary logs --- .changeset/olive-knives-happen.md | 2 +- core/services/ocr2/delegate.go | 8 ++++++++ core/services/ocr2/validate/validate.go | 2 -- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.changeset/olive-knives-happen.md b/.changeset/olive-knives-happen.md index 217b3890478..7f522c96ff1 100644 --- a/.changeset/olive-knives-happen.md +++ b/.changeset/olive-knives-happen.md @@ -2,4 +2,4 @@ "chainlink": patch --- -#internal Generic Pluging `onchainSigningStrategy` support +#internal Generic Plugin `onchainSigningStrategy` support diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index da6d6a1b6e7..469f9dd5958 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -28,6 +28,7 @@ import ( ocr2keepers21 "github.com/smartcontractkit/chainlink-automation/pkg/v3/plugin" "github.com/smartcontractkit/chainlink-common/pkg/loop/reportingplugins/ocr3" "github.com/smartcontractkit/chainlink-common/pkg/sqlutil" + "github.com/smartcontractkit/chainlink/v2/core/config/env" "github.com/smartcontractkit/chainlink-vrf/altbn_128" @@ -547,6 +548,13 @@ func (d *Delegate) newServicesGenericPlugin( if err != nil { return nil, err } + // NOTE: we don't need to validate the strategy, since that happens as part of creating the job. + // See: validate/validate.go's `validateSpec`. + onchainSigningStrategy := validate.OCR2OnchainSigningStrategy{} + err = json.Unmarshal(spec.OnchainSigningStrategy.Bytes(), &onchainSigningStrategy) + if err != nil { + return nil, err + } plugEnv := env.NewPlugin(pCfg.PluginName) diff --git a/core/services/ocr2/validate/validate.go b/core/services/ocr2/validate/validate.go index a383534782b..906b0474c90 100644 --- a/core/services/ocr2/validate/validate.go +++ b/core/services/ocr2/validate/validate.go @@ -209,7 +209,6 @@ func (o *OCR2OnchainSigningStrategy) PublicKey() (string, error) { } func validateGenericPluginSpec(ctx context.Context, spec *job.OCR2OracleSpec, rc plugins.RegistrarConfig) error { - fmt.Println("running validateGenericPluginSpec") p := OCR2GenericPluginConfig{} err := json.Unmarshal(spec.PluginConfig.Bytes(), &p) if err != nil { @@ -233,7 +232,6 @@ func validateGenericPluginSpec(ctx context.Context, spec *job.OCR2OracleSpec, rc if err != nil { return err } - fmt.Println("public key", pk) if pk == "" { return errors.New("generic config invalid: must provide public key for the onchain signing strategy") }