Skip to content

Commit

Permalink
Convert the workflow spec to and from proto
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Jan 28, 2025
1 parent a8fa42c commit 25619c7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/workflows/sdk/testutils/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/smartcontractkit/chainlink-common/pkg/workflows"
"github.com/smartcontractkit/chainlink-common/pkg/workflows/exec"
"github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk"
wasmpb "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm/pb"
)

func NewRunner(ctx context.Context, runtime sdk.Runtime) *Runner {
Expand Down Expand Up @@ -79,7 +80,17 @@ func (r *Runner) Err() error {
}

func (r *Runner) ensureGraph(spec sdk.WorkflowSpec) error {
g, err := workflows.BuildDependencyGraph(spec)
proto, err := wasmpb.WorkflowSpecToProto(&spec)
if err != nil {
return err
}

newspec, err := wasmpb.ProtoToWorkflowSpec(proto)
if err != nil {
return err
}

g, err := workflows.BuildDependencyGraph(*newspec)
if err != nil {
return err
}
Expand Down

0 comments on commit 25619c7

Please sign in to comment.