@@ -8,99 +8,66 @@ import (
88 "github.com/stretchr/testify/require"
99
1010 contract_utils "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/utils/operations/contract"
11- "github.com/smartcontractkit/chainlink-ccip/chains/evm/deployment/v1_2_0/operations/router"
11+ "github.com/smartcontractkit/chainlink-ccip/deployment/lanes"
12+ "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets"
1213 "github.com/smartcontractkit/chainlink-deployments-framework/datastore"
1314 "github.com/smartcontractkit/chainlink-deployments-framework/deployment"
1415 "github.com/smartcontractkit/chainlink-deployments-framework/engine/test/environment"
1516
16- "github.com/smartcontractkit/chainlink-ccip/deployment/utils/changesets"
17- "github.com/smartcontractkit/chainlink-ccip/deployment/v1_7_0/adapters"
18- v1_7_0_changesets "github.com/smartcontractkit/chainlink-ccip/deployment/v1_7_0/changesets"
19-
2017 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/committee_verifier"
21- "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/offramp"
22- "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/latest/operations/onramp"
23- evm_adapters "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/adapters"
2418 v1_7_0 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/changesets"
2519 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/create2_factory"
2620 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/operations/executor"
2721 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/sequences"
2822 "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v1_7_0/testsetup"
29- "github.com/smartcontractkit/chainlink-ccip/ccv/chains/evm/deployment/v2_0_0/operations/fee_quoter"
3023)
3124
32- func makeChainConfig (chainSelector uint64 , remoteChainSelector uint64 ) v1_7_0_changesets.ChainConfig {
33- return v1_7_0_changesets.ChainConfig {
34- ChainSelector : chainSelector ,
35- Router : datastore.AddressRef {
36- Type : datastore .ContractType (router .ContractType ),
37- Version : router .Version ,
38- },
39- OnRamp : datastore.AddressRef {
40- Type : datastore .ContractType (onramp .ContractType ),
41- Version : onramp .Version ,
42- },
43- CommitteeVerifiers : []adapters.CommitteeVerifierConfig [datastore.AddressRef ]{
25+ func makeChainConfig (chainSelector uint64 , remoteChainSelector uint64 ) lanes.ChainDefinition {
26+ return lanes.ChainDefinition {
27+ Selector : chainSelector ,
28+ CommitteeVerifiers : []lanes.CommitteeVerifierConfig [datastore.AddressRef ]{
4429 {
4530 CommitteeVerifier : []datastore.AddressRef {
4631 {
47- Type : datastore .ContractType (committee_verifier .ContractType ),
48- Version : committee_verifier .Version ,
32+ ChainSelector : chainSelector ,
33+ Type : datastore .ContractType (committee_verifier .ContractType ),
34+ Version : committee_verifier .Version ,
4935 },
5036 {
51- Type : datastore .ContractType (sequences .CommitteeVerifierResolverType ),
52- Version : semver .MustParse ("1.7.0" ),
37+ ChainSelector : chainSelector ,
38+ Type : datastore .ContractType (sequences .CommitteeVerifierResolverType ),
39+ Version : semver .MustParse ("1.7.0" ),
5340 },
5441 },
55- RemoteChains : map [uint64 ]adapters .CommitteeVerifierRemoteChainConfig {
42+ RemoteChains : map [uint64 ]lanes .CommitteeVerifierRemoteChainConfig {
5643 remoteChainSelector : testsetup .CreateBasicCommitteeVerifierRemoteChainConfig (),
5744 },
5845 },
5946 },
60- FeeQuoter : datastore.AddressRef {
61- Type : datastore .ContractType (fee_quoter .ContractType ),
62- Version : fee_quoter .Version ,
63- },
64- OffRamp : datastore.AddressRef {
65- Type : datastore .ContractType (offramp .ContractType ),
66- Version : offramp .Version ,
47+ DefaultInboundCCVs : []datastore.AddressRef {
48+ {
49+ ChainSelector : chainSelector ,
50+ Type : datastore .ContractType (committee_verifier .ContractType ),
51+ Version : committee_verifier .Version ,
52+ },
6753 },
68- RemoteChains : map [uint64 ]adapters.RemoteChainConfig [datastore.AddressRef , datastore.AddressRef ]{
69- remoteChainSelector : {
70- AllowTrafficFrom : true ,
71- OnRamps : []datastore.AddressRef {
72- {
73- Type : datastore .ContractType (onramp .ContractType ),
74- Version : onramp .Version ,
75- },
76- },
77- OffRamp : datastore.AddressRef {
78- Type : datastore .ContractType (offramp .ContractType ),
79- Version : offramp .Version ,
80- },
81- DefaultInboundCCVs : []datastore.AddressRef {
82- {
83- Type : datastore .ContractType (committee_verifier .ContractType ),
84- Version : committee_verifier .Version ,
85- },
86- },
87- DefaultOutboundCCVs : []datastore.AddressRef {
88- {
89- Type : datastore .ContractType (committee_verifier .ContractType ),
90- Version : committee_verifier .Version ,
91- },
92- },
93- DefaultExecutor : datastore.AddressRef {
94- Type : datastore .ContractType (executor .ProxyType ),
95- Version : executor .Version ,
96- Qualifier : "default" ,
97- },
98- FeeQuoterDestChainConfig : testsetup .CreateBasicFeeQuoterDestChainConfig (),
99- ExecutorDestChainConfig : testsetup .CreateBasicExecutorDestChainConfig (),
100- AddressBytesLength : 20 ,
101- BaseExecutionGasCost : 80_000 ,
54+ DefaultOutboundCCVs : []datastore.AddressRef {
55+ {
56+ ChainSelector : chainSelector ,
57+ Type : datastore .ContractType (committee_verifier .ContractType ),
58+ Version : committee_verifier .Version ,
10259 },
10360 },
61+ DefaultExecutor : datastore.AddressRef {
62+ ChainSelector : chainSelector ,
63+ Type : datastore .ContractType (executor .ProxyType ),
64+ Version : executor .Version ,
65+ Qualifier : "default" ,
66+ },
67+ FeeQuoterDestChainConfig : testsetup .CreateBasicFeeQuoterDestChainConfig (),
68+ ExecutorDestChainConfig : testsetup .CreateBasicExecutorDestChainConfig (),
69+ AddressBytesLength : 20 ,
70+ BaseExecutionGasCost : 80_000 ,
10471 }
10572}
10673
@@ -122,8 +89,7 @@ func TestChainFamilyAdapter(t *testing.T) {
12289 require .NoError (t , err , "Failed to create test environment" )
12390 require .NotNil (t , e , "Environment should be created" )
12491
125- chainFamilyRegistry := adapters .NewChainFamilyRegistry ()
126- chainFamilyRegistry .RegisterChainFamily ("evm" , & evm_adapters.ChainFamilyAdapter {})
92+ chainFamilyRegistry := lanes .GetLaneAdapterRegistry ()
12793 mcmsRegistry := changesets .GetRegistry ()
12894
12995 // On each chain, deploy chain contracts
@@ -156,13 +122,16 @@ func TestChainFamilyAdapter(t *testing.T) {
156122
157123 // Configure chains for lanes
158124 e .OperationsBundle = testsetup .BundleWithFreshReporter (e .OperationsBundle )
159- _ , err = v1_7_0_changesets .ConfigureChainsForLanes (chainFamilyRegistry , mcmsRegistry ).Apply (* e , v1_7_0_changesets.ConfigureChainsForLanesConfig {
160- Chains : []v1_7_0_changesets.ChainConfig {
161- makeChainConfig (chainA , chainB ),
162- makeChainConfig (chainB , chainA ),
125+ _ , err = lanes .ConnectChains (chainFamilyRegistry , mcmsRegistry ).Apply (* e , lanes.ConnectChainsConfig {
126+ Lanes : []lanes.LaneConfig {
127+ {
128+ ChainA : makeChainConfig (chainA , chainB ),
129+ ChainB : makeChainConfig (chainB , chainA ),
130+ Version : semver .MustParse ("2.0.0" ),
131+ },
163132 },
164133 })
165- require .NoError (t , err , "Failed to apply ConfigureChainsForLanes changeset" )
134+ require .NoError (t , err , "Failed to apply ConnectChains changeset" )
166135 })
167136 }
168137}
0 commit comments