Skip to content

Commit

Permalink
Combine cap dirs (#1248)
Browse files Browse the repository at this point in the history
## Motivation
CCIP cap code in one place

## Solution
Move tests + cap code into capabilities/ccip
  • Loading branch information
connorwstein authored Aug 1, 2024
1 parent 835b4d4 commit e8f60ed
Show file tree
Hide file tree
Showing 53 changed files with 124 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ packages:
outpkg: mock_optimism_dispute_game_factory
interfaces:
OptimismDisputeGameFactoryInterface:
github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types:
github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types:
interfaces:
CCIPOracle:
OracleCreator:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ import (
"testing"
"time"

"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/integrationhelpers"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"

confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper"
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"

"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/arm_proxy_contract"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config"
Expand All @@ -29,11 +35,6 @@ import (
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/link_token"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr3/plugins/ccip_integration_tests/integrationhelpers"

confighelper2 "github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper"
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"

chainsel "github.com/smartcontractkit/chain-selectors"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"testing"
"time"

"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/integrationhelpers"

mapset "github.com/deckarep/golang-set/v2"
"github.com/onsi/gomega"

Expand All @@ -13,12 +15,11 @@ import (

cciptypes "github.com/smartcontractkit/chainlink-common/pkg/types/ccipocr3"

"github.com/stretchr/testify/require"

capcfg "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/services/ocr3/plugins/ccip_integration_tests/integrationhelpers"

"github.com/stretchr/testify/require"
)

func TestHomeChainReader(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import (
"testing"
"time"

configsevm "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
Expand All @@ -22,8 +25,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ocr3_config_encoder"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
configsevm "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/configs/evm"
cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"

"github.com/smartcontractkit/chainlink-common/pkg/types"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ import (
"testing"
"time"

"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/validate"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
gethtypes "github.com/ethereum/go-ethereum/core/types"
"github.com/jmoiron/sqlx"

"github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/validate"
"github.com/smartcontractkit/chainlink/v2/core/services/job"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package common_test
import (
"testing"

capcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"

"github.com/ethereum/go-ethereum/accounts/abi/bind/backends"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
Expand All @@ -11,7 +13,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
capcommon "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/common"
)

func Test_HashedCapabilityId(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package ccipcapability
package ccip

import (
"context"
"fmt"
"time"

"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"
configsevm "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/configs/evm"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/launcher"
"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/oraclecreator"

ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types"

"github.com/smartcontractkit/chainlink-ccip/pkg/consts"
Expand All @@ -17,10 +22,6 @@ import (
"github.com/smartcontractkit/chainlink/v2/core/config"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
"github.com/smartcontractkit/chainlink/v2/core/logger"
"github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/common"
configsevm "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/configs/evm"
"github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/launcher"
"github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/oraclecreator"
"github.com/smartcontractkit/chainlink/v2/core/services/job"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/ocr2key"
Expand Down
1 change: 1 addition & 0 deletions core/capabilities/ccip/delegate_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package ccip
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DON deletion is permanent.

## Architecture Diagram

![CCIP Capability Launcher](./ccip_capability_launcher.png)
![CCIP Capability Launcher](ccip_capability_launcher.png)

The above diagram shows how the CCIP capability launcher interacts with the rest of the components
in the CCIP system.
Expand All @@ -41,7 +41,7 @@ in order to match the configuration that was posted on-chain in the CR and the C

## Config State Diagram

![CCIP Config State Machine](./ccip_config_state_machine.png)
![CCIP Config State Machine](ccip_config_state_machine.png)

CCIP's blue/green deployment paradigm is intentionally kept as simple as possible.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package launcher
import (
"fmt"

cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"go.uber.org/multierr"

ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader"
cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types"
)

// blueGreenDeployment represents a blue-green deployment of OCR instances.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"errors"
"testing"

cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
mocktypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types/mocks"

"github.com/stretchr/testify/require"

ccipreaderpkg "github.com/smartcontractkit/chainlink-ccip/pkg/reader"
cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types"
mocktypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types/mocks"
)

func Test_ccipDeployment_Close(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package launcher
import (
"fmt"

"github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"

ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types"

kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
"github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/common"
"github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import (
"reflect"
"testing"

capcommon "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/common"

ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types"
"github.com/stretchr/testify/require"

kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
capcommon "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/common"
"github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey"
"github.com/smartcontractkit/chainlink/v2/core/services/p2p/types"
"github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"testing"
"time"

it "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/ccip_integration_tests/integrationhelpers"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"github.com/onsi/gomega"
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/ccip_config"
"github.com/smartcontractkit/chainlink/v2/core/internal/testutils"
"github.com/smartcontractkit/chainlink/v2/core/logger"
cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types"
it "github.com/smartcontractkit/chainlink/v2/core/services/ocr3/plugins/ccip_integration_tests/integrationhelpers"
"github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"sync"
"time"

cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"

"go.uber.org/multierr"

ragep2ptypes "github.com/smartcontractkit/libocr/ragep2p/types"
Expand All @@ -16,7 +18,6 @@ import (
ccipreader "github.com/smartcontractkit/chainlink-ccip/pkg/reader"
kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry"
"github.com/smartcontractkit/chainlink/v2/core/logger"
cctypes "github.com/smartcontractkit/chainlink/v2/core/services/ccipcapability/types"
"github.com/smartcontractkit/chainlink/v2/core/services/job"
p2ptypes "github.com/smartcontractkit/chainlink/v2/core/services/p2p/types"
"github.com/smartcontractkit/chainlink/v2/core/services/registrysyncer"
Expand Down
Loading

0 comments on commit e8f60ed

Please sign in to comment.