Skip to content

Commit

Permalink
fix offchain tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RensR committed Nov 28, 2024
1 parent c204696 commit 31097f0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
1 change: 1 addition & 0 deletions core/scripts/ccip/liquiditymanager/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ func deployTokenPoolAndRebalancer(
transactor,
client,
tokenAddress,
18,
[]common.Address{},
armProxyAddress,
true,
Expand Down
22 changes: 14 additions & 8 deletions core/services/ocr2/plugins/ccip/testhelpers/ccip_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -785,6 +787,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh
sourceUser,
sourceChain,
sourceLinkTokenAddress,
TokenDecimals,
[]common.Address{},
armProxySourceAddress,
true,
Expand All @@ -801,6 +804,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh
sourceUser,
sourceChain,
sourceWeth9addr,
TokenDecimals,
[]common.Address{},
armProxySourceAddress,
true,
Expand All @@ -819,6 +823,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh
destUser,
destChain,
destLinkTokenAddress,
TokenDecimals,
[]common.Address{},
armProxyDestAddress,
true,
Expand Down Expand Up @@ -848,6 +853,7 @@ func SetupCCIPContracts(t *testing.T, sourceChainID, sourceChainSelector, destCh
destUser,
destChain,
destWeth9addr,
TokenDecimals,
[]common.Address{},
armProxyDestAddress,
true,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ func (e *CCIPContractsDeployer) DeployLockReleaseTokenPoolContract(tokenAddr str
auth,
wrappers.MustNewWrappedContractBackend(e.evmClient, nil),
token,
testhelpers.TokenDecimals,
[]common.Address{},
rmnProxy,
true,
Expand Down

0 comments on commit 31097f0

Please sign in to comment.