Skip to content

Commit

Permalink
Omit non required contracts (#1158)
Browse files Browse the repository at this point in the history
## Motivation
We don't need price registry for existing deployment

## Solution
  • Loading branch information
AnieeG authored Jul 8, 2024
1 parent 5db8286 commit d5ab3e6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 24 deletions.
46 changes: 25 additions & 21 deletions integration-tests/ccip-tests/actions/ccip_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/ccip-tests/testsetups/ccip.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d5ab3e6

Please sign in to comment.