Skip to content

Commit

Permalink
Add enum for CapabilityType
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-cordenier committed Aug 14, 2024
1 parent 6470106 commit cb25d0b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions core/capabilities/integration_tests/keystone_contracts_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ import (
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
)

const (
CapabilityTypeTrigger = 0
CapabilityTypeAction = 1
CapabilityTypeConsensus = 2
CapabilityTypeTarget = 3
)

type peer struct {
PeerID string
Signer string
Expand Down Expand Up @@ -101,7 +108,7 @@ func setupCapabilitiesRegistryContract(ctx context.Context, t *testing.T, workfl
streamsTrigger := kcr.CapabilitiesRegistryCapability{
LabelledName: "streams-trigger",
Version: "1.0.0",
CapabilityType: 0, // Trigger
CapabilityType: CapabilityTypeTrigger,
}
sid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, streamsTrigger.LabelledName, streamsTrigger.Version)
require.NoError(t, err)
Expand All @@ -110,7 +117,7 @@ func setupCapabilitiesRegistryContract(ctx context.Context, t *testing.T, workfl
LabelledName: "write_geth-testnet",
Version: "1.0.0",

CapabilityType: 3, // Target
CapabilityType: CapabilityTypeTarget,
}
wid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, writeChain.LabelledName, writeChain.Version)
if err != nil {
Expand All @@ -120,7 +127,7 @@ func setupCapabilitiesRegistryContract(ctx context.Context, t *testing.T, workfl
ocr := kcr.CapabilitiesRegistryCapability{
LabelledName: "offchain_reporting",
Version: "1.0.0",
CapabilityType: 2, // Consensus
CapabilityType: CapabilityTypeConsensus,
}
ocrid, err := reg.GetHashedCapabilityId(&bind.CallOpts{}, ocr.LabelledName, ocr.Version)
require.NoError(t, err)
Expand Down

0 comments on commit cb25d0b

Please sign in to comment.