From 9c3f0221feb7be1985bda0ed3b8af11269dcb91f Mon Sep 17 00:00:00 2001 From: Michael Suchacz Date: Mon, 16 Dec 2024 15:43:16 +0100 Subject: [PATCH] removed unnecessary job generator for stream specs --- core/services/job/job_orm_test.go | 3 ++- core/testdata/testspecs/v2_specs.go | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/core/services/job/job_orm_test.go b/core/services/job/job_orm_test.go index af96c733123..27223e0d706 100644 --- a/core/services/job/job_orm_test.go +++ b/core/services/job/job_orm_test.go @@ -43,6 +43,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/services/ocrbootstrap" "github.com/smartcontractkit/chainlink/v2/core/services/pipeline" "github.com/smartcontractkit/chainlink/v2/core/services/relay" + "github.com/smartcontractkit/chainlink/v2/core/services/streams" "github.com/smartcontractkit/chainlink/v2/core/services/vrf/vrfcommon" "github.com/smartcontractkit/chainlink/v2/core/services/webhook" "github.com/smartcontractkit/chainlink/v2/core/services/workflows/syncer" @@ -446,7 +447,7 @@ func TestORM_DeleteJob_DeletesAssociatedRecords(t *testing.T) { t.Run("it creates and deletes records for stream jobs", func(t *testing.T) { ctx := testutils.Context(t) - jb, err := testspecs.GenerateStreamSpecJob(testspecs.GenerateStreamSpec(testspecs.StreamSpecParams{Name: "Test-stream", StreamID: 1})) + jb, err := streams.ValidatedStreamSpec(testspecs.GenerateStreamSpec(testspecs.StreamSpecParams{Name: "Test-stream", StreamID: 1}).Toml()) require.NoError(t, err) err = jobORM.CreateJob(ctx, &jb) require.NoError(t, err) diff --git a/core/testdata/testspecs/v2_specs.go b/core/testdata/testspecs/v2_specs.go index 05180f4f089..d519ace6479 100644 --- a/core/testdata/testspecs/v2_specs.go +++ b/core/testdata/testspecs/v2_specs.go @@ -9,7 +9,6 @@ import ( "time" "github.com/google/uuid" - "github.com/pelletier/go-toml/v2" "github.com/test-go/testify/require" "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" @@ -884,12 +883,6 @@ ds -> ds_parse -> ds_multiply; return StreamSpec{StreamSpecParams: params, toml: toml} } -func GenerateStreamSpecJob(spec StreamSpec) (job.Job, error) { - jb := job.Job{ExternalJobID: uuid.New()} - err := toml.Unmarshal([]byte(spec.Toml()), &jb) - return jb, err -} - // WorkflowJobSpec is a test helper that wraps both the TOML and job.Job representation of a workflow job spec type WorkflowJobSpec struct { toml string