Skip to content

Commit

Permalink
remove deployCCIPContracts (#15586)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG authored Dec 10, 2024
1 parent 45898fc commit aae1def
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
15 changes: 14 additions & 1 deletion deployment/ccip/changeset/cs_add_chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,23 @@ func TestAddChainInbound(t *testing.T) {
for _, chain := range initialDeploy {
chainConfig[chain] = DefaultOCRParams(e.FeedChainSel, nil, nil)
}
err = deployCCIPContracts(e.Env, newAddresses, NewChainsConfig{
newChainCfg := NewChainsConfig{
HomeChainSel: e.HomeChainSel,
FeedChainSel: e.FeedChainSel,
ChainConfigByChain: chainConfig,
}
e.Env, err = commonchangeset.ApplyChangesets(t, e.Env, nil, []commonchangeset.ChangesetApplication{
{
Changeset: commonchangeset.WrapChangeSet(DeployChainContracts),
Config: DeployChainContractsConfig{
ChainSelectors: newChainCfg.Chains(),
HomeChainSelector: newChainCfg.HomeChainSel,
},
},
{
Changeset: commonchangeset.WrapChangeSet(ConfigureNewChains),
Config: newChainCfg,
},
})
require.NoError(t, err)

Expand Down
32 changes: 0 additions & 32 deletions deployment/ccip/changeset/cs_deploy_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,38 +65,6 @@ func (c DeployChainContractsConfig) Validate() error {
return nil
}

// deployCCIPContracts assumes the following contracts are deployed:
// - Capability registry
// - CCIP home
// - RMN home
// - Fee tokens on all chains.
// and present in ExistingAddressBook.
// It then deploys the rest of the CCIP chain contracts to the selected chains
// registers the nodes with the capability registry and creates a DON for
// each new chain.
func deployCCIPContracts(
e deployment.Environment,
ab deployment.AddressBook,
c NewChainsConfig) error {
err := deployChainContractsForChains(e, ab, c.HomeChainSel, c.Chains())
if err != nil {
e.Logger.Errorw("Failed to deploy chain contracts", "err", err)
return err
}
err = e.ExistingAddresses.Merge(ab)
if err != nil {
e.Logger.Errorw("Failed to merge address book", "err", err)
return err
}
err = configureChain(e, c)
if err != nil {
e.Logger.Errorw("Failed to add chain", "err", err)
return err
}

return nil
}

func deployChainContractsForChains(
e deployment.Environment,
ab deployment.AddressBook,
Expand Down

0 comments on commit aae1def

Please sign in to comment.