Skip to content

Commit

Permalink
WIP fix ocr3 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asoliman92 committed Aug 6, 2024
1 parent 5054d14 commit 51e8ad9
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"testing"
"time"

coretypes "github.com/smartcontractkit/chainlink-common/pkg/types/core/mocks"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
Expand Down Expand Up @@ -131,9 +132,10 @@ func setupNodeOCR3(
CSAETHKeystore: kStore,
}
relayerFactory := chainlink.RelayerFactory{
Logger: lggr,
LoopRegistry: plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), cfg.Tracing()),
GRPCOpts: loop.GRPCOpts{},
Logger: lggr,
LoopRegistry: plugins.NewLoopRegistry(lggr.Named("LoopRegistry"), cfg.Tracing()),
GRPCOpts: loop.GRPCOpts{},
CapabilitiesRegistry: coretypes.NewCapabilitiesRegistry(t),
}
initOps := []chainlink.CoreRelayerChainInitFunc{chainlink.InitEVM(testutils.Context(t), relayerFactory, evmOpts)}
rci, err := chainlink.NewCoreRelayerChainInteroperators(initOps...)
Expand Down
23 changes: 23 additions & 0 deletions core/web/presenters/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,26 @@ func NewStandardCapabilitiesSpec(spec *job.StandardCapabilitiesSpec) *StandardCa
}
}

type CCIPSpec struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
CapabilityVersion string `json:"capabilityVersion"`
CapabilityLabelledName string `json:"capabilityLabelledName"`
OCRKeyBundleIDs map[string]interface{} `json:"ocrKeyBundleIDs"`
P2PKeyID string `json:"p2pKeyID"`
}

func NewCCIPSpec(spec *job.CCIPSpec) *CCIPSpec {
return &CCIPSpec{
CreatedAt: spec.CreatedAt,
UpdatedAt: spec.UpdatedAt,
CapabilityVersion: spec.CapabilityVersion,
CapabilityLabelledName: spec.CapabilityLabelledName,
OCRKeyBundleIDs: spec.OCRKeyBundleIDs,
P2PKeyID: spec.P2PKeyID,
}
}

// JobError represents errors on the job
type JobError struct {
ID int64 `json:"id"`
Expand Down Expand Up @@ -512,6 +532,7 @@ type JobResource struct {
GatewaySpec *GatewaySpec `json:"gatewaySpec"`
WorkflowSpec *WorkflowSpec `json:"workflowSpec"`
StandardCapabilitiesSpec *StandardCapabilitiesSpec `json:"standardCapabilitiesSpec"`
CCIPSpec *CCIPSpec `json:"ccipSpec"`
PipelineSpec PipelineSpec `json:"pipelineSpec"`
Errors []JobError `json:"errors"`
}
Expand Down Expand Up @@ -562,6 +583,8 @@ func NewJobResource(j job.Job) *JobResource {
resource.WorkflowSpec = NewWorkflowSpec(j.WorkflowSpec)
case job.StandardCapabilities:
resource.StandardCapabilitiesSpec = NewStandardCapabilitiesSpec(j.StandardCapabilitiesSpec)
case job.CCIP:
resource.CCIPSpec = NewCCIPSpec(j.CCIPSpec)
case job.LegacyGasStationServer, job.LegacyGasStationSidecar:
// unsupported
}
Expand Down

0 comments on commit 51e8ad9

Please sign in to comment.