From e9334531f001f5328a4cc393e9428b7fe4fa533d Mon Sep 17 00:00:00 2001 From: AnieeG Date: Fri, 8 Nov 2024 10:58:22 -0800 Subject: [PATCH] updates --- deployment/ccip/changeset/home_chain.go | 3 ++- deployment/ccip/changeset/home_chain_test.go | 4 ++-- deployment/ccip/deploy_home_chain.go | 2 +- deployment/ccip/deploy_test.go | 2 +- deployment/ccip/test_helpers.go | 2 +- integration-tests/ccip-tests/testsetups/test_helpers.go | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deployment/ccip/changeset/home_chain.go b/deployment/ccip/changeset/home_chain.go index c8cc1b3713c..1b1c3b60287 100644 --- a/deployment/ccip/changeset/home_chain.go +++ b/deployment/ccip/changeset/home_chain.go @@ -25,8 +25,9 @@ func DeployHomeChain(env deployment.Environment, config interface{}) (deployment if err != nil { return deployment.ChangesetOutput{}, errors.Wrapf(deployment.ErrInvalidConfig, "%v", err) } + ab := deployment.NewMemoryAddressBook() // Note we also deploy the cap reg. - _, err = ccipdeployment.DeployHomeChain(env.Logger, env, env.Chains[cfg.HomeChainSel], cfg.RMNStaticConfig, cfg.RMNDynamicConfig, cfg.NodeOperators, cfg.NodeP2PIDsPerNodeOpAdmin) + _, err = ccipdeployment.DeployHomeChain(env.Logger, env, ab, env.Chains[cfg.HomeChainSel], cfg.RMNStaticConfig, cfg.RMNDynamicConfig, cfg.NodeOperators, cfg.NodeP2PIDsPerNodeOpAdmin) if err != nil { env.Logger.Errorw("Failed to deploy cap reg", "err", err, "addresses", env.ExistingAddresses) return deployment.ChangesetOutput{}, err diff --git a/deployment/ccip/changeset/home_chain_test.go b/deployment/ccip/changeset/home_chain_test.go index 73364541764..f0abdc64437 100644 --- a/deployment/ccip/changeset/home_chain_test.go +++ b/deployment/ccip/changeset/home_chain_test.go @@ -34,9 +34,9 @@ func TestDeployHomeChain(t *testing.T) { "NodeOperator": p2pIds, }, } - _, err = DeployHomeChain(e, homeChainCfg) + output, err := DeployHomeChain(e, homeChainCfg) require.NoError(t, err) - + require.NoError(t, e.ExistingAddresses.Merge(output.AddressBook)) state, err := ccdeploy.LoadOnchainState(e) require.NoError(t, err) require.NotNil(t, state.Chains[homeChainSel].CapabilityRegistry) diff --git a/deployment/ccip/deploy_home_chain.go b/deployment/ccip/deploy_home_chain.go index dff34c8fe25..341f53a0438 100644 --- a/deployment/ccip/deploy_home_chain.go +++ b/deployment/ccip/deploy_home_chain.go @@ -124,13 +124,13 @@ func DeployCapReg( func DeployHomeChain( lggr logger.Logger, e deployment.Environment, + ab deployment.AddressBook, chain deployment.Chain, rmnHomeStatic rmn_home.RMNHomeStaticConfig, rmnHomeDynamic rmn_home.RMNHomeDynamicConfig, nodeOps []capabilities_registry.CapabilitiesRegistryNodeOperator, nodeP2PIDsPerNodeOpAdmin map[string][][32]byte, ) (*ContractDeploy[*capabilities_registry.CapabilitiesRegistry], error) { - ab := e.ExistingAddresses // load existing state state, err := LoadOnchainState(e) if err != nil { diff --git a/deployment/ccip/deploy_test.go b/deployment/ccip/deploy_test.go index 06d9241e41f..63aeacb4bdf 100644 --- a/deployment/ccip/deploy_test.go +++ b/deployment/ccip/deploy_test.go @@ -28,7 +28,7 @@ func TestDeployCCIPContracts(t *testing.T) { nodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) require.NoError(t, err) - _, err = DeployHomeChain(lggr, e, e.Chains[homeChainSel], + _, err = DeployHomeChain(lggr, e, e.ExistingAddresses, e.Chains[homeChainSel], NewTestRMNStaticConfig(), NewTestRMNDynamicConfig(), NewTestNodeOperator(e.Chains[homeChainSel].DeployerKey.From), diff --git a/deployment/ccip/test_helpers.go b/deployment/ccip/test_helpers.go index 5444ee0bfad..74cf98cab9f 100644 --- a/deployment/ccip/test_helpers.go +++ b/deployment/ccip/test_helpers.go @@ -181,7 +181,7 @@ func NewMemoryEnvironment(t *testing.T, lggr logger.Logger, numChains int, numNo envNodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) require.NoError(t, err) e.ExistingAddresses = ab - _, err = DeployHomeChain(lggr, e, chains[homeChainSel], + _, err = DeployHomeChain(lggr, e, e.ExistingAddresses, chains[homeChainSel], NewTestRMNStaticConfig(), NewTestRMNDynamicConfig(), NewTestNodeOperator(chains[homeChainSel].DeployerKey.From), diff --git a/integration-tests/ccip-tests/testsetups/test_helpers.go b/integration-tests/ccip-tests/testsetups/test_helpers.go index 3b81c99b97a..e07262341db 100644 --- a/integration-tests/ccip-tests/testsetups/test_helpers.go +++ b/integration-tests/ccip-tests/testsetups/test_helpers.go @@ -102,7 +102,7 @@ func NewLocalDevEnvironment(t *testing.T, lggr logger.Logger) (ccipdeployment.De envNodes, err := deployment.NodeInfo(e.NodeIDs, e.Offchain) require.NoError(t, err) - _, err = ccipdeployment.DeployHomeChain(lggr, e, chains[homeChainSel], + _, err = ccipdeployment.DeployHomeChain(lggr, *e, e.ExistingAddresses, chains[homeChainSel], ccipdeployment.NewTestRMNStaticConfig(), ccipdeployment.NewTestRMNDynamicConfig(), ccipdeployment.NewTestNodeOperator(chains[homeChainSel].DeployerKey.From),