From 4fd2f17189a24276712cb6a56b52655a09a4a0f0 Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Wed, 27 Nov 2024 12:29:11 +0100 Subject: [PATCH] fix usdc test --- deployment/ccip/changeset/consts.go | 2 ++ deployment/ccip/changeset/test_helpers.go | 8 ++++++-- deployment/ccip/changeset/test_usdc_helpers.go | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/deployment/ccip/changeset/consts.go b/deployment/ccip/changeset/consts.go index 8d5e64ccde7..2c3d1c60e48 100644 --- a/deployment/ccip/changeset/consts.go +++ b/deployment/ccip/changeset/consts.go @@ -6,6 +6,8 @@ const ( LinkSymbol TokenSymbol = "LINK" WethSymbol TokenSymbol = "WETH" USDCSymbol TokenSymbol = "USDC" + USDCName string = "USD Coin" LinkDecimals = 18 WethDecimals = 18 + UsdcDecimals = 6 ) diff --git a/deployment/ccip/changeset/test_helpers.go b/deployment/ccip/changeset/test_helpers.go index 5e8705d4757..9e1db1f50fd 100644 --- a/deployment/ccip/changeset/test_helpers.go +++ b/deployment/ccip/changeset/test_helpers.go @@ -16,6 +16,7 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/pkg/errors" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + "github.com/smartcontractkit/chainlink-ccip/pluginconfig" commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" @@ -137,10 +138,13 @@ func DeployTestContracts(t *testing.T, Chains: make(map[uint64]CCIPChainState), }, ab, chains[homeChainSel]) require.NoError(t, err) + _, err = DeployFeeds(lggr, ab, chains[feedChainSel], linkPrice, wethPrice) require.NoError(t, err) + evmChainID, err := chainsel.ChainIdFromSelector(homeChainSel) require.NoError(t, err) + return deployment.CapabilityRegistryConfig{ EVMChainID: evmChainID, Contract: capReg.Address, @@ -929,7 +933,7 @@ func deployTransferTokenOneEnd( tokenContract, err := deployment.DeployContract(lggr, chain, addressBook, func(chain deployment.Chain) deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677] { - USDCTokenAddr, tx, token, err2 := burn_mint_erc677.DeployBurnMintERC677( + tokenAddress, tx, token, err2 := burn_mint_erc677.DeployBurnMintERC677( chain.DeployerKey, chain.Client, tokenSymbol, @@ -938,7 +942,7 @@ func deployTransferTokenOneEnd( big.NewInt(0).Mul(big.NewInt(1e9), big.NewInt(1e18)), ) return deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ - USDCTokenAddr, token, tx, deployment.NewTypeAndVersion(BurnMintToken, deployment.Version1_0_0), err2, + tokenAddress, token, tx, deployment.NewTypeAndVersion(BurnMintToken, deployment.Version1_0_0), err2, } }) if err != nil { diff --git a/deployment/ccip/changeset/test_usdc_helpers.go b/deployment/ccip/changeset/test_usdc_helpers.go index 4a39f4e7ba1..4f96070e63c 100644 --- a/deployment/ccip/changeset/test_usdc_helpers.go +++ b/deployment/ccip/changeset/test_usdc_helpers.go @@ -134,10 +134,10 @@ func DeployUSDC( tokenAddress, tx, tokenContract, err2 := burn_mint_erc677.DeployBurnMintERC677( chain.DeployerKey, chain.Client, - "USDC Token", - "USDC", - uint8(18), - big.NewInt(0).Mul(big.NewInt(1e9), big.NewInt(1e18)), + USDCName, + string(USDCSymbol), + UsdcDecimals, + big.NewInt(0), ) return deployment.ContractDeploy[*burn_mint_erc677.BurnMintERC677]{ Address: tokenAddress,