Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 180259f

Browse files
committed
Bartek review comment
1 parent 4f4fb5f commit 180259f

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

integration-tests/ccip-tests/actions/ccip_helpers.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,6 @@ func (ccipModule *CCIPCommon) DeployContracts(
993993
token := ccipModule.BridgeTokens[i]
994994
// usdc pool need to be the first one in the slice
995995
if ccipModule.IsUSDCDeployment() && i == 0 {
996-
//ccipModule.Logger.Println("Enter USDC")
997996
// deploy usdc token pool in case of usdc deployment
998997
if ccipModule.TokenMessenger == nil {
999998
return fmt.Errorf("TokenMessenger contract address is not provided")
@@ -1008,36 +1007,39 @@ func (ccipModule *CCIPCommon) DeployContracts(
10081007

10091008
ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, usdcPool)
10101009
} else if ccipModule.IsLBTCDeployment() && i == 0 {
1010+
if ccipModule.RMNContract == nil {
1011+
return fmt.Errorf("RMNContract is not initialized")
1012+
}
10111013
rmnContract := *ccipModule.RMNContract
1014+
10121015
destPoolData, err := hex.DecodeString(LBTCValidDestPoolData) // valid 32 bytes should call attestation api
10131016
if err != nil {
1014-
return fmt.Errorf("decoding dest pool data shouldn't fail %w", err)
1017+
return errors.Wrapf(err, "decoding dest pool data shouldn't fail")
10151018
}
10161019
if !pointer.GetBool(ccipModule.LBTCDestPoolDataAs32Bytes) {
10171020
// non 32 bytes data should not call attestation api and instead consider it as deposit payload.
10181021
// lombard has both attested and non-attested flow
10191022
destPoolData = []byte{0x12, 0x34, 0x56, 0x78}
10201023
}
1021-
//
10221024
lbtcPool, err := ccipModule.tokenDeployer.DeployMockLBTCTokenPoolContract(token.Address(), rmnContract, ccipModule.Router.Instance.Address(), destPoolData)
10231025
if err != nil {
1024-
return fmt.Errorf("deploying mock lbtc bridge token pool shouldn't fail %w", err)
1026+
return errors.Wrapf(err, "deploying mock lbtc bridge token pool shouldn't fail")
10251027
}
10261028
lbtcInstance, err := burn_mint_erc677.NewBurnMintERC677(token.ContractAddress, ccipModule.ChainClient.Backend())
10271029
if err != nil {
1028-
return fmt.Errorf("failed to get dest usdc token instance: %w", err)
1030+
return errors.Wrapf(err, "failed to get dest usdc token instance")
10291031
}
10301032
opts, err := ccipModule.tokenDeployer.Client().TransactionOpts(token.OwnerWallet)
10311033
if err != nil {
1032-
return fmt.Errorf("failed to get transaction opts: %w", err)
1034+
return errors.Wrapf(err, "failed to get transaction opts")
10331035
}
10341036
tx, err := lbtcInstance.GrantMintAndBurnRoles(opts, common.HexToAddress(lbtcPool.Address()))
10351037
if err != nil {
1036-
return fmt.Errorf("granting minter role to owner shouldn't fail %w", err)
1038+
return errors.Wrapf(err, "granting minter role to owner shouldn't fail")
10371039
}
10381040
err = ccipModule.tokenDeployer.Client().ProcessTransaction(tx)
10391041
if err != nil {
1040-
return fmt.Errorf("failed to process grant mint role %w", err)
1042+
return errors.Wrapf(err, "failed to process grant mint role")
10411043
}
10421044

10431045
ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, lbtcPool)

0 commit comments

Comments
 (0)