From 31097f088d176760b43ff13f613eee30fb9b99bf Mon Sep 17 00:00:00 2001 From: Rens Rooimans Date: Thu, 28 Nov 2024 19:39:11 +0100 Subject: [PATCH] fix offchain tests --- core/scripts/ccip/liquiditymanager/util.go | 1 + .../ccip/testhelpers/ccip_contracts.go | 22 ++++++++++++------- .../internal/integration_test.go | 2 +- .../ccip-tests/contracts/contract_deployer.go | 1 + 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/core/scripts/ccip/liquiditymanager/util.go b/core/scripts/ccip/liquiditymanager/util.go index 45aa69ddb8a..d49b49f0ed4 100644 --- a/core/scripts/ccip/liquiditymanager/util.go +++ b/core/scripts/ccip/liquiditymanager/util.go @@ -243,6 +243,7 @@ func deployTokenPoolAndRebalancer( transactor, client, tokenAddress, + 18, []common.Address{}, armProxyAddress, true, diff --git a/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go index 0442f09c47d..ee514c6b195 100644 --- a/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go +++ b/core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go @@ -73,6 +73,8 @@ var ( SourceChainSelector = uint64(11787463284727550157) DestChainID = uint64(1337) DestChainSelector = uint64(3379446385462418246) + + TokenDecimals = uint8(18) ) // Backwards compat, in principle these statuses are version dependent @@ -785,6 +787,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh sourceUser, sourceChain, sourceLinkTokenAddress, + TokenDecimals, []common.Address{}, armProxySourceAddress, true, @@ -801,6 +804,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh sourceUser, sourceChain, sourceWeth9addr, + TokenDecimals, []common.Address{}, armProxySourceAddress, true, @@ -819,6 +823,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh destUser, destChain, destLinkTokenAddress, + TokenDecimals, []common.Address{}, armProxyDestAddress, true, @@ -848,6 +853,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh destUser, destChain, destWeth9addr, + TokenDecimals, []common.Address{}, armProxyDestAddress, true, @@ -882,11 +888,11 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh require.NoError(t, err) _, err = sourceLinkPool.ApplyChainUpdates( sourceUser, + []uint64{}, []lock_release_token_pool.TokenPoolChainUpdate{{ RemoteChainSelector: DestChainSelector, - RemotePoolAddress: abiEncodedDestLinkPool, + RemotePoolAddresses: [][]byte{abiEncodedDestLinkPool}, RemoteTokenAddress: abiEncodedDestLinkTokenAddress, - Allowed: true, OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ IsEnabled: true, Capacity: HundredLink, @@ -907,11 +913,11 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh require.NoError(t, err) _, err = sourceWeth9Pool.ApplyChainUpdates( sourceUser, + []uint64{}, []lock_release_token_pool.TokenPoolChainUpdate{{ RemoteChainSelector: DestChainSelector, - RemotePoolAddress: abiEncodedDestWrappedPool, + RemotePoolAddresses: [][]byte{abiEncodedDestWrappedPool}, RemoteTokenAddress: abiEncodedDestWrappedTokenAddr, - Allowed: true, OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ IsEnabled: true, Capacity: HundredLink, @@ -933,11 +939,11 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh require.NoError(t, err) _, err = destLinkPool.ApplyChainUpdates( destUser, + []uint64{}, []lock_release_token_pool.TokenPoolChainUpdate{{ RemoteChainSelector: SourceChainSelector, - RemotePoolAddress: abiEncodedSourceLinkPool, + RemotePoolAddresses: [][]byte{abiEncodedSourceLinkPool}, RemoteTokenAddress: abiEncodedSourceLinkTokenAddr, - Allowed: true, OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ IsEnabled: true, Capacity: HundredLink, @@ -958,11 +964,11 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh require.NoError(t, err) _, err = destWrappedPool.ApplyChainUpdates( destUser, + []uint64{}, []lock_release_token_pool.TokenPoolChainUpdate{{ RemoteChainSelector: SourceChainSelector, - RemotePoolAddress: abiEncodedSourceWrappedPool, + RemotePoolAddresses: [][]byte{abiEncodedSourceWrappedPool}, RemoteTokenAddress: abiEncodedSourceWrappedTokenAddr, - Allowed: true, OutboundRateLimiterConfig: lock_release_token_pool.RateLimiterConfig{ IsEnabled: true, Capacity: HundredLink, diff --git a/core/services/ocr2/plugins/liquiditymanager/internal/integration_test.go b/core/services/ocr2/plugins/liquiditymanager/internal/integration_test.go index 080e9b82e3d..c9fbc9950d8 100644 --- a/core/services/ocr2/plugins/liquiditymanager/internal/integration_test.go +++ b/core/services/ocr2/plugins/liquiditymanager/internal/integration_test.go @@ -657,7 +657,7 @@ func deployContracts( // deploy lock/release pool targeting the weth9 contract lockReleasePoolAddress, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool( - owner, backend, wethAddress, []common.Address{}, armProxyAddress, true, routerAddress) + owner, backend, wethAddress, 18, []common.Address{}, armProxyAddress, true, routerAddress) require.NoError(t, err, "failed to deploy LockReleaseTokenPool contract") backend.Commit() lockReleasePool, err := lock_release_token_pool.NewLockReleaseTokenPool(lockReleasePoolAddress, backend) diff --git a/integration-tests/ccip-tests/contracts/contract_deployer.go b/integration-tests/ccip-tests/contracts/contract_deployer.go index 579d16da4fc..979b9a8bdd6 100644 --- a/integration-tests/ccip-tests/contracts/contract_deployer.go +++ b/integration-tests/ccip-tests/contracts/contract_deployer.go @@ -505,6 +505,7 @@ func (e *CCIPContractsDeployer) DeployLockReleaseTokenPoolContract(tokenAddr str auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), token, + testhelpers.TokenDecimals, []common.Address{}, rmnProxy, true,