Skip to content

Commit

Permalink
price registry not required for existing deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Jul 8, 2024
1 parent 5db8286 commit e3c65d5
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 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

0 comments on commit e3c65d5

Please sign in to comment.