From d63d25f0b508b3f6a1fed38bd1cfa859d412af4b Mon Sep 17 00:00:00 2001 From: krehermann Date: Wed, 5 Jun 2024 07:57:22 -0600 Subject: [PATCH] fix comments --- core/services/job/models.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/core/services/job/models.go b/core/services/job/models.go index eca637fa03d..4c6190a0b8e 100644 --- a/core/services/job/models.go +++ b/core/services/job/models.go @@ -842,8 +842,9 @@ type LiquidityBalancerSpec struct { } type WorkflowSpec struct { - ID int32 `toml:"-"` - WorkflowID string `toml:"workflowId"` // content hash + ID int32 `toml:"-"` + // TODO it may be possible to compute the workflow id from the hash(yaml, owner, name) and remove this field + WorkflowID string `toml:"workflowId"` // globally unique identifier for the workflow, specified by the user Workflow string `toml:"workflow"` WorkflowOwner string `toml:"workflowOwner"` // hex string representation of 20 bytes WorkflowName string `toml:"workflowName"` // 10 byte plain text name @@ -858,14 +859,14 @@ var ( ) const ( - workflowIDLen = 64 // content hash - // owner and name are constrained the onchain representation i + workflowIDLen = 64 // conveniently the same length as a sha256 hash + // owner and name are constrained the onchain representation in [github.com/smartcontractkit/chainlink-common/blob/main/pkg/capabilities/consensus/ocr3/types/Metadata] workflowOwnerLen = 40 // hex string representation of 20 bytes workflowNameLen = 10 // plain text name ) // Validate checks the length of the workflow id, owner and name -// which are constrained by the onchain representation in [github.com/smartcontractkit/chainlink-common/blob/main/pkg/capabilities/consensus/ocr3/types/Metadata] +// that latter two are constrained by the onchain representation in [github.com/smartcontractkit/chainlink-common/blob/main/pkg/capabilities/consensus/ocr3/types/Metadata] func (w *WorkflowSpec) Validate() error { if len(w.WorkflowID) != workflowIDLen { return fmt.Errorf("%w: incorrect length for id %s: expected %d, got %d", ErrInvalidWorkflowID, w.WorkflowID, workflowIDLen, len(w.WorkflowID))