Skip to content

Commit

Permalink
relax contract input criteria for existing deployment (#1007)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG authored Jun 12, 2024
1 parent 15ef365 commit 12b7c43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions integration-tests/ccip-tests/actions/ccip_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -992,10 +992,8 @@ func (ccipModule *CCIPCommon) DeployContracts(noOfTokens int,
ccipModule.BridgeTokenPools = pools
}

if ccipModule.PriceRegistry == nil {
if ccipModule.ExistingDeployment {
return fmt.Errorf("price registry contract address is not provided in lane config")
}
// 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{
Expand Down Expand Up @@ -1023,11 +1021,9 @@ func (ccipModule *CCIPCommon) DeployContracts(noOfTokens int,
}

// if the version is after 1.4.0, we need to deploy TokenAdminRegistry
if ccipModule.NeedTokenAdminRegistry() {
// no need to have token admin registry for existing deployment, we consider that it's already deployed
if ccipModule.NeedTokenAdminRegistry() && !ccipModule.ExistingDeployment {
if ccipModule.TokenAdminRegistry == nil {
if ccipModule.ExistingDeployment {
return fmt.Errorf("token admin registry contract address is not provided in lane config")
}
// deploy token admin registry
ccipModule.TokenAdminRegistry, err = cd.DeployTokenAdminRegistry()
if err != nil {
Expand Down Expand Up @@ -1061,6 +1057,7 @@ func (ccipModule *CCIPCommon) DeployContracts(noOfTokens int,
}
}
log.Info().Msg("finished deploying common contracts")

// approve router to spend fee token
return ccipModule.ApproveTokens()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type CommonContracts struct {
PriceAggregators map[string]string `json:"price_aggregators,omitempty"`
ARM string `json:"arm"`
Router string `json:"router"`
PriceRegistry string `json:"price_registry"`
PriceRegistry string `json:"price_registry,omitempty"`
WrappedNative string `json:"wrapped_native"`
Multicall string `json:"multicall,omitempty"`
TokenTransmitter string `json:"token_transmitter,omitempty"`
Expand Down

0 comments on commit 12b7c43

Please sign in to comment.