Skip to content

Commit

Permalink
Ccip-4158 - Initial Add Chain changeset (#15349)
Browse files Browse the repository at this point in the history
* Move files

* Move more files

* Move the rest

* Move some files to internal

* Get building

* Move a bunch of home chain stuff to internal

* Update README

* Fix integration tests

* More merge conflicts

* More merge conflicts

* updates

* changes

* changes

* changes

* more changes

* fix go mod

* quick fix

* fix tests

* more optimize

* more fix

* remove unnecessary methods

* fix review comments

* fixes

* add a test

* more fix

* more review comments

* fix ApplyChangesets

---------

Co-authored-by: connorwstein <[email protected]>
  • Loading branch information
AnieeG and connorwstein authored Nov 21, 2024
1 parent a883b59 commit d2817c5
Show file tree
Hide file tree
Showing 26 changed files with 738 additions and 382 deletions.
3 changes: 2 additions & 1 deletion deployment/ccip/changeset/active_candidate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock"

"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

"github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal"
cctypes "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
Expand All @@ -25,7 +26,7 @@ func TestActiveCandidate(t *testing.T) {
t.Skipf("to be enabled after latest cl-ccip is compatible")

lggr := logger.TestLogger(t)
tenv := NewMemoryEnvironmentWithJobsAndContracts(t, lggr, 3, 5)
tenv := NewMemoryEnvironmentWithJobsAndContracts(t, lggr, 3, 5, nil)
e := tenv.Env
state, err := LoadOnchainState(tenv.Env)
require.NoError(t, err)
Expand Down
9 changes: 5 additions & 4 deletions deployment/ccip/changeset/add_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestAddChainInbound(t *testing.T) {
// We deploy to the rest.
initialDeploy := e.Env.AllChainSelectorsExcluding([]uint64{newChain})
newAddresses := deployment.NewMemoryAddressBook()
err = DeployPrerequisiteChainContracts(e.Env, newAddresses, initialDeploy)
err = deployPrerequisiteChainContracts(e.Env, newAddresses, initialDeploy, nil)
require.NoError(t, err)
require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses))

Expand All @@ -59,15 +59,15 @@ func TestAddChainInbound(t *testing.T) {
require.NoError(t, e.Env.ExistingAddresses.Merge(out.AddressBook))
newAddresses = deployment.NewMemoryAddressBook()
tokenConfig := NewTestTokenConfig(state.Chains[e.FeedChainSel].USDFeeds)
err = DeployCCIPContracts(e.Env, newAddresses, DeployCCIPContractConfig{
err = deployCCIPContracts(e.Env, newAddresses, NewChainsConfig{
HomeChainSel: e.HomeChainSel,
FeedChainSel: e.FeedChainSel,
ChainsToDeploy: initialDeploy,
TokenConfig: tokenConfig,
OCRSecrets: deployment.XXXGenerateTestOCRSecrets(),
})
require.NoError(t, err)
require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses))

state, err = LoadOnchainState(e.Env)
require.NoError(t, err)

Expand All @@ -94,7 +94,8 @@ func TestAddChainInbound(t *testing.T) {
require.NoError(t, e.Env.ExistingAddresses.Merge(out.AddressBook))

newAddresses = deployment.NewMemoryAddressBook()
err = DeployPrerequisiteChainContracts(e.Env, newAddresses, []uint64{newChain})

err = deployPrerequisiteChainContracts(e.Env, newAddresses, []uint64{newChain}, nil)
require.NoError(t, err)
require.NoError(t, e.Env.ExistingAddresses.Merge(newAddresses))
newAddresses = deployment.NewMemoryAddressBook()
Expand Down
3 changes: 2 additions & 1 deletion deployment/ccip/changeset/add_lane_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

commonutils "github.com/smartcontractkit/chainlink-common/pkg/utils"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

"github.com/smartcontractkit/chainlink/deployment"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/offramp"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/router"
Expand All @@ -20,7 +21,7 @@ import (
func TestAddLane(t *testing.T) {
t.Parallel()
// We add more chains to the chainlink nodes than the number of chains where CCIP is deployed.
e := NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), 2, 4)
e := NewMemoryEnvironmentWithJobsAndContracts(t, logger.TestLogger(t), 2, 4, nil)
// Here we have CR + nodes set up, but no CCIP contracts deployed.
state, err := LoadOnchainState(e.Env)
require.NoError(t, err)
Expand Down
Loading

0 comments on commit d2817c5

Please sign in to comment.