From d5ab3e6f646acb9a5153c9222988f71f0931a9c3 Mon Sep 17 00:00:00 2001 From: Anindita Ghosh <88458927+AnieeG@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:34:39 -0700 Subject: [PATCH] Omit non required contracts (#1158) ## Motivation We don't need price registry for existing deployment ## Solution --- .../ccip-tests/actions/ccip_helpers.go | 46 ++++++++++--------- .../ccip-tests/testsetups/ccip.go | 6 +-- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/integration-tests/ccip-tests/actions/ccip_helpers.go b/integration-tests/ccip-tests/actions/ccip_helpers.go index e2b9b70871..67dd80d7a9 100644 --- a/integration-tests/ccip-tests/actions/ccip_helpers.go +++ b/integration-tests/ccip-tests/actions/ccip_helpers.go @@ -1000,24 +1000,26 @@ func (ccipModule *CCIPCommon) DeployContracts( } // no need to have price registry for existing deployment, we consider that it's already deployed - if ccipModule.PriceRegistry == nil && !ccipModule.ExistingDeployment { - // we will update the price updates later based on source and dest PriceUpdates - ccipModule.PriceRegistry, err = cd.DeployPriceRegistry( - []common.Address{ - common.HexToAddress(ccipModule.FeeToken.Address()), - common.HexToAddress(ccipModule.WrappedNative.Hex()), - }) - if err != nil { - return fmt.Errorf("deploying PriceRegistry shouldn't fail %w", err) - } - err = ccipModule.ChainClient.WaitForEvents() - if err != nil { - return fmt.Errorf("error in waiting for PriceRegistry deployment %w", err) - } - } else { - ccipModule.PriceRegistry, err = cd.NewPriceRegistry(ccipModule.PriceRegistry.EthAddress) - if err != nil { - return fmt.Errorf("getting new PriceRegistry contract shouldn't fail %w", err) + if !ccipModule.ExistingDeployment { + if ccipModule.PriceRegistry == nil { + // we will update the price updates later based on source and dest PriceUpdates + ccipModule.PriceRegistry, err = cd.DeployPriceRegistry( + []common.Address{ + common.HexToAddress(ccipModule.FeeToken.Address()), + common.HexToAddress(ccipModule.WrappedNative.Hex()), + }) + if err != nil { + return fmt.Errorf("deploying PriceRegistry shouldn't fail %w", err) + } + err = ccipModule.ChainClient.WaitForEvents() + if err != nil { + return fmt.Errorf("error in waiting for PriceRegistry deployment %w", err) + } + } else { + ccipModule.PriceRegistry, err = cd.NewPriceRegistry(ccipModule.PriceRegistry.EthAddress) + if err != nil { + return fmt.Errorf("getting new PriceRegistry contract shouldn't fail %w", err) + } } } if ccipModule.MulticallContract == (common.Address{}) && ccipModule.MulticallEnabled { @@ -1210,9 +1212,11 @@ func NewCCIPCommonFromConfig( if err != nil { return nil, err } - newCCIPModule.PriceRegistry, err = newCCIPModule.Deployer.NewPriceRegistry(common.HexToAddress(newCCIPModule.PriceRegistry.Address())) - if err != nil { - return nil, err + if newCCIPModule.PriceRegistry != nil { + newCCIPModule.PriceRegistry, err = newCCIPModule.Deployer.NewPriceRegistry(common.HexToAddress(newCCIPModule.PriceRegistry.Address())) + if err != nil { + return nil, err + } } newCCIPModule.Router, err = newCCIPModule.Deployer.NewRouter(common.HexToAddress(newCCIPModule.Router.Address())) if err != nil { diff --git a/integration-tests/ccip-tests/testsetups/ccip.go b/integration-tests/ccip-tests/testsetups/ccip.go index 39e52164bc..68ef532ea2 100644 --- a/integration-tests/ccip-tests/testsetups/ccip.go +++ b/integration-tests/ccip-tests/testsetups/ccip.go @@ -1240,9 +1240,9 @@ func (o *CCIPTestSetUpOutputs) CreateEnvironment( func createEnvironmentConfig(t *testing.T, envName string, testConfig *CCIPTestConfig, reportPath string) *environment.Config { envConfig := &environment.Config{ - NamespacePrefix: envName, - Test: t, - PreventPodEviction: true, + NamespacePrefix: envName, + Test: t, + // PreventPodEviction: true, //TODO: enable this once we have a way to handle pod eviction } if pointer.GetBool(testConfig.TestGroupInput.StoreLaneConfig) { envConfig.ReportPath = reportPath