Skip to content

Commit

Permalink
add tests for get/set pool
Browse files Browse the repository at this point in the history
  • Loading branch information
RensR committed Apr 4, 2024
1 parent a95c6a8 commit e8e3892
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 36 deletions.
58 changes: 31 additions & 27 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ CommitStore_verify:testPausedReverts() (gas: 18438)
CommitStore_verify:testTooManyLeavesReverts() (gas: 36830)
DefensiveExampleTest:testHappyPathSuccess() (gas: 171544)
DefensiveExampleTest:testRecovery() (gas: 395150)
E2E:testE2E_3MessagesSuccess_gas() (gas: 1004675)
EVM2EVMOffRamp__releaseOrMintTokens:test_RateLimitErrors_Reverts() (gas: 585091)
EVM2EVMOffRamp__releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 135738)
E2E:testE2E_3MessagesSuccess_gas() (gas: 1004747)
EVM2EVMOffRamp__releaseOrMintTokens:test_RateLimitErrors_Reverts() (gas: 585181)
EVM2EVMOffRamp__releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 135756)
EVM2EVMOffRamp__releaseOrMintTokens:test__releaseOrMintTokens_PoolIsNotAContract_Reverts() (gas: 25631)
EVM2EVMOffRamp__releaseOrMintTokens:test__releaseOrMintTokens_PoolIsNotAPool_Reverts() (gas: 27779)
EVM2EVMOffRamp__releaseOrMintTokens:test_fuzz__releaseOrMintTokens_AnyRevertIsCaught_Success(uint256) (runs: 10024, μ: 27924, ~: 21420)
EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 166838)
EVM2EVMOffRamp__releaseOrMintTokens:test_fuzz__releaseOrMintTokens_AnyRevertIsCaught_Success(uint256) (runs: 10024, μ: 27918, ~: 21420)
EVM2EVMOffRamp__releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 166856)
EVM2EVMOffRamp__report:testReportSuccess() (gas: 127311)
EVM2EVMOffRamp__trialExecute:testRateLimitErrorSuccess() (gas: 210531)
EVM2EVMOffRamp__trialExecute:testTokenHandlingErrorIsCaughtSuccess() (gas: 218854)
EVM2EVMOffRamp__trialExecute:test_trialExecuteSuccess() (gas: 269699)
EVM2EVMOffRamp__trialExecute:testRateLimitErrorSuccess() (gas: 210549)
EVM2EVMOffRamp__trialExecute:testTokenHandlingErrorIsCaughtSuccess() (gas: 218872)
EVM2EVMOffRamp__trialExecute:test_trialExecuteSuccess() (gas: 269717)
EVM2EVMOffRamp_ccipReceive:testReverts() (gas: 17071)
EVM2EVMOffRamp_constructor:testCommitStoreAlreadyInUseReverts() (gas: 150209)
EVM2EVMOffRamp_constructor:testConstructorSuccess() (gas: 4883326)
Expand All @@ -117,7 +117,7 @@ EVM2EVMOffRamp_execute:testAlreadyExecutedReverts() (gas: 137262)
EVM2EVMOffRamp_execute:testEmptyReportReverts() (gas: 19001)
EVM2EVMOffRamp_execute:testInvalidMessageIdReverts() (gas: 34053)
EVM2EVMOffRamp_execute:testInvalidSourceChainReverts() (gas: 49290)
EVM2EVMOffRamp_execute:testInvalidSourcePoolAddressSuccess() (gas: 420746)
EVM2EVMOffRamp_execute:testInvalidSourcePoolAddressSuccess() (gas: 420782)
EVM2EVMOffRamp_execute:testManualExecutionNotYetEnabledReverts() (gas: 44083)
EVM2EVMOffRamp_execute:testMessageTooLargeReverts() (gas: 150077)
EVM2EVMOffRamp_execute:testPausedReverts() (gas: 99885)
Expand All @@ -127,21 +127,21 @@ EVM2EVMOffRamp_execute:testRouterYULCallReverts() (gas: 413733)
EVM2EVMOffRamp_execute:testSingleMessageNoTokensSuccess() (gas: 173491)
EVM2EVMOffRamp_execute:testSingleMessageToNonCCIPReceiverSuccess() (gas: 246206)
EVM2EVMOffRamp_execute:testSingleMessagesNoTokensSuccess_gas() (gas: 114605)
EVM2EVMOffRamp_execute:testSkippedIncorrectNonceStillExecutesSuccess() (gas: 368388)
EVM2EVMOffRamp_execute:testSkippedIncorrectNonceStillExecutesSuccess() (gas: 368406)
EVM2EVMOffRamp_execute:testSkippedIncorrectNonceSuccess() (gas: 51823)
EVM2EVMOffRamp_execute:testStrictUntouchedToSuccessSuccess() (gas: 130918)
EVM2EVMOffRamp_execute:testTokenDataMismatchReverts() (gas: 49698)
EVM2EVMOffRamp_execute:testTwoMessagesWithTokensAndGESuccess() (gas: 497721)
EVM2EVMOffRamp_execute:testTwoMessagesWithTokensSuccess_gas() (gas: 440486)
EVM2EVMOffRamp_execute:testTwoMessagesWithTokensAndGESuccess() (gas: 497757)
EVM2EVMOffRamp_execute:testTwoMessagesWithTokensSuccess_gas() (gas: 440522)
EVM2EVMOffRamp_execute:testUnexpectedTokenDataReverts() (gas: 32971)
EVM2EVMOffRamp_execute:testUnhealthyReverts() (gas: 486877)
EVM2EVMOffRamp_execute:testUnhealthyReverts() (gas: 486913)
EVM2EVMOffRamp_execute:testUnsupportedNumberOfTokensReverts() (gas: 61407)
EVM2EVMOffRamp_executeSingleMessage:testMessageSenderReverts() (gas: 20562)
EVM2EVMOffRamp_executeSingleMessage:testNoTokensSuccess() (gas: 48050)
EVM2EVMOffRamp_executeSingleMessage:testNonContractSuccess() (gas: 20122)
EVM2EVMOffRamp_executeSingleMessage:testNonContractWithTokensSuccess() (gas: 239183)
EVM2EVMOffRamp_executeSingleMessage:testTokenHandlingErrorReverts() (gas: 172272)
EVM2EVMOffRamp_executeSingleMessage:testTokensSuccess() (gas: 269952)
EVM2EVMOffRamp_executeSingleMessage:testNonContractWithTokensSuccess() (gas: 239201)
EVM2EVMOffRamp_executeSingleMessage:testTokenHandlingErrorReverts() (gas: 172290)
EVM2EVMOffRamp_executeSingleMessage:testTokensSuccess() (gas: 269970)
EVM2EVMOffRamp_executeSingleMessage:testZeroGasDONExecutionReverts() (gas: 48598)
EVM2EVMOffRamp_execute_upgrade:testV2NonceNewSenderStartsAtZeroSuccess() (gas: 232113)
EVM2EVMOffRamp_execute_upgrade:testV2NonceStartsAtV1NonceSuccess() (gas: 280056)
Expand All @@ -157,7 +157,7 @@ EVM2EVMOffRamp_manuallyExecute:testManualExecGasLimitMismatchReverts() (gas: 433
EVM2EVMOffRamp_manuallyExecute:testManualExecInvalidGasLimitReverts() (gas: 25958)
EVM2EVMOffRamp_manuallyExecute:testManualExecSuccess() (gas: 189449)
EVM2EVMOffRamp_manuallyExecute:testManualExecWithGasOverrideSuccess() (gas: 190120)
EVM2EVMOffRamp_manuallyExecute:testReentrancyManualExecuteFails() (gas: 2060856)
EVM2EVMOffRamp_manuallyExecute:testReentrancyManualExecuteFails() (gas: 2060874)
EVM2EVMOffRamp_metadataHash:testMetadataHashSuccess() (gas: 6064)
EVM2EVMOffRamp_setDynamicConfig:testNonOwnerReverts() (gas: 40310)
EVM2EVMOffRamp_setDynamicConfig:testRouterZeroAddressReverts() (gas: 38520)
Expand All @@ -182,7 +182,7 @@ EVM2EVMOnRamp_forwardFromRouter:testPriceNotFoundForTokenReverts() (gas: 35137)
EVM2EVMOnRamp_forwardFromRouter:testShouldIncrementSeqNumAndNonceSuccess() (gas: 169359)
EVM2EVMOnRamp_forwardFromRouter:testShouldStoreLinkFees() (gas: 104547)
EVM2EVMOnRamp_forwardFromRouter:testShouldStoreNonLinkFees() (gas: 123825)
EVM2EVMOnRamp_forwardFromRouter:testSourceTokenDataTooLargeReverts() (gas: 3471783)
EVM2EVMOnRamp_forwardFromRouter:testSourceTokenDataTooLargeReverts() (gas: 3540948)
EVM2EVMOnRamp_forwardFromRouter:testTooManyTokensReverts() (gas: 28283)
EVM2EVMOnRamp_forwardFromRouter:testUnhealthyReverts() (gas: 43114)
EVM2EVMOnRamp_forwardFromRouter:testUnsupportedTokenReverts() (gas: 108972)
Expand Down Expand Up @@ -247,15 +247,15 @@ EVM2EVMOnRamp_withdrawNonLinkFees:testNonOwnerOrAdminReverts() (gas: 15284)
EVM2EVMOnRamp_withdrawNonLinkFees:testSettlingBalanceSuccess() (gas: 240232)
EVM2EVMOnRamp_withdrawNonLinkFees:testWithdrawNonLinkFeesSuccess() (gas: 50117)
EVM2EVMOnRamp_withdrawNonLinkFees:testWithdrawToZeroAddressReverts() (gas: 12865)
LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquiditySuccess() (gas: 3033500)
LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquiditySuccess() (gas: 3066580)
LockReleaseTokenPool_lockOrBurn:testLockOrBurnWithAllowListReverts() (gas: 27488)
LockReleaseTokenPool_lockOrBurn:testLockOrBurnWithAllowListSuccess() (gas: 73204)
LockReleaseTokenPool_lockOrBurn:testLockOrBurnWithAllowListSuccess() (gas: 73216)
LockReleaseTokenPool_lockOrBurn:testPoolBurnRevertNotHealthyReverts() (gas: 70518)
LockReleaseTokenPool_provideLiquidity:testLiquidityNotAcceptedReverts() (gas: 3033178)
LockReleaseTokenPool_provideLiquidity:testLiquidityNotAcceptedReverts() (gas: 3066258)
LockReleaseTokenPool_provideLiquidity:test_UnauthorizedReverts() (gas: 11379)
LockReleaseTokenPool_releaseOrMint:testChainNotAllowedReverts() (gas: 57533)
LockReleaseTokenPool_releaseOrMint:testPoolMintNotHealthyReverts() (gas: 65209)
LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMintSuccess() (gas: 194438)
LockReleaseTokenPool_releaseOrMint:testChainNotAllowedReverts() (gas: 57548)
LockReleaseTokenPool_releaseOrMint:testPoolMintNotHealthyReverts() (gas: 65224)
LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMintSuccess() (gas: 194452)
LockReleaseTokenPool_setChainRateLimiterConfig:testNonExistentChainReverts() (gas: 17024)
LockReleaseTokenPool_setChainRateLimiterConfig:testOnlyOwnerOrRateLimitAdminReverts() (gas: 68408)
LockReleaseTokenPool_setChainRateLimiterConfig:testOnlyOwnerReverts() (gas: 17146)
Expand All @@ -264,7 +264,7 @@ LockReleaseTokenPool_setRateLimitAdmin:testSetRateLimitAdminSuccess() (gas: 3195
LockReleaseTokenPool_setRebalancer:testSetRebalancerReverts() (gas: 11009)
LockReleaseTokenPool_setRebalancer:testSetRebalancerSuccess() (gas: 14834)
LockReleaseTokenPool_supportsInterface:testSupportsInterfaceSuccess() (gas: 8431)
LockReleaseTokenPool_withdrawalLiquidity:testInsufficientLiquidityReverts() (gas: 59800)
LockReleaseTokenPool_withdrawalLiquidity:testInsufficientLiquidityReverts() (gas: 59803)
LockReleaseTokenPool_withdrawalLiquidity:test_UnauthorizedReverts() (gas: 11310)
MerkleMultiProofTest:testCVE_2023_34459() (gas: 5458)
MerkleMultiProofTest:testEmptyLeafReverts() (gas: 3575)
Expand Down Expand Up @@ -387,7 +387,7 @@ TokenAdminRegistry_setPool:test_setPool_Success() (gas: 26550)
TokenPoolWithAllowList_applyAllowListUpdates:testOnlyOwnerReverts() (gas: 12060)
TokenPoolWithAllowList_applyAllowListUpdates:testSetAllowListSkipsZeroSuccess() (gas: 20421)
TokenPoolWithAllowList_applyAllowListUpdates:testSetAllowListSuccess() (gas: 175762)
TokenPoolWithAllowList_applyAllowListUpdates:test_AllowListNotEnabledReverts() (gas: 2259682)
TokenPoolWithAllowList_applyAllowListUpdates:test_AllowListNotEnabledReverts() (gas: 2328846)
TokenPoolWithAllowList_getAllowList:testGetAllowListSuccess() (gas: 20177)
TokenPoolWithAllowList_getAllowListEnabled:testGetAllowListEnabledSuccess() (gas: 5491)
TokenPoolWithAllowList_setRouter:testSetRouterSuccess() (gas: 24003)
Expand All @@ -396,8 +396,9 @@ TokenPool_applyChainUpdates:testInvalidRatelimitRateReverts() (gas: 487559)
TokenPool_applyChainUpdates:testNonExistentChainReverts() (gas: 17468)
TokenPool_applyChainUpdates:testOnlyCallableByOwnerReverts() (gas: 11336)
TokenPool_applyChainUpdates:testSuccess() (gas: 420528)
TokenPool_constructor:testZeroAddressNotAllowedReverts() (gas: 70768)
TokenPool_constructor:testZeroAddressNotAllowedReverts() (gas: 70852)
TokenPool_constructor:test_immutableFieldsSuccess() (gas: 16693)
TokenPool_getRemotePool:test_getRemotePool_Success() (gas: 247127)
TokenPool_onlyOffRamp:test_CallerIsNotARampOnRouterReverts() (gas: 252404)
TokenPool_onlyOffRamp:test_ChainNotAllowedReverts() (gas: 268776)
TokenPool_onlyOffRamp:test_onlyOffRampSuccess() (gas: 325372)
Expand All @@ -406,6 +407,9 @@ TokenPool_onlyOnRamp:test_ChainNotAllowedReverts() (gas: 232744)
TokenPool_onlyOnRamp:test_onlyOnRampSuccess() (gas: 280254)
TokenPool_setChainRateLimiterConfig:testNonExistentChainReverts() (gas: 14901)
TokenPool_setChainRateLimiterConfig:testOnlyOwnerReverts() (gas: 12465)
TokenPool_setRemotePool:test_setRemotePool_NonExistentChain_Reverts() (gas: 15654)
TokenPool_setRemotePool:test_setRemotePool_OnlyOwner_Reverts() (gas: 13224)
TokenPool_setRemotePool:test_setRemotePool_Success() (gas: 255490)
TokenProxy_ccipSend:testCcipSendGasShouldBeZeroReverts() (gas: 17077)
TokenProxy_ccipSend:testCcipSendInsufficientAllowanceReverts() (gas: 133062)
TokenProxy_ccipSend:testCcipSendInvalidTokenReverts() (gas: 15863)
Expand Down
4 changes: 2 additions & 2 deletions contracts/gas-snapshots/rebalancer.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Rebalancer_addLiquidity:test_addLiquiditySuccess() (gas: 249272)
Rebalancer_rebalanceLiquidity:test_InsufficientLiquidityReverts() (gas: 19570)
Rebalancer_rebalanceLiquidity:test_InvalidRemoteChainReverts() (gas: 162331)
Rebalancer_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess() (gas: 8160294)
Rebalancer_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess_AlreadyFinalized() (gas: 7827484)
Rebalancer_rebalanceLiquidity:test_rebalanceBetweenPoolsSuccess_AlreadyFinalized() (gas: 7900200)
Rebalancer_rebalanceLiquidity:test_rebalanceLiquiditySuccess() (gas: 348848)
Rebalancer_removeLiquidity:test_InsufficientLiquidityReverts() (gas: 156437)
Rebalancer_removeLiquidity:test_OnlyOwnerReverts() (gas: 10923)
Expand All @@ -33,6 +33,6 @@ Rebalancer_setCrossChainRebalancer:test_ZeroAddressReverts() (gas: 21630)
Rebalancer_setCrossChainRebalancer:test_ZeroChainSelectorReverts() (gas: 13102)
Rebalancer_setCrossChainRebalancer:test_setCrossChainRebalancerSuccess() (gas: 157897)
Rebalancer_setLocalLiquidityContainer:test_OnlyOwnerReverts() (gas: 10986)
Rebalancer_setLocalLiquidityContainer:test_setLocalLiquidityContainerSuccess() (gas: 3091139)
Rebalancer_setLocalLiquidityContainer:test_setLocalLiquidityContainerSuccess() (gas: 3163938)
Rebalancer_setMinimumLiquidity:test_OnlyOwnerReverts() (gas: 10925)
Rebalancer_setMinimumLiquidity:test_setMinimumLiquiditySuccess() (gas: 36097)
6 changes: 3 additions & 3 deletions contracts/src/v0.8/ccip/onRamp/EVM2EVMOnRamp.sol
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ contract EVM2EVMOnRamp is IEVM2AnyOnRamp, ILinkAvailable, AggregateRateLimiter,
bytes("") // any future extraArgs component would be added here
);

// Since the DON has to pay for the tokenData to be included on the destination chain, we cap the length of the tokenData.
// Since the DON has to pay for the extraData to be included on the destination chain, we cap the length of the extraData.
// This prevents gas bomb attacks on the NOPs. We use destBytesOverhead as a proxy to cap the number of bytes we accept.
// As destBytesOverhead accounts for tokenData + offchainData, this caps the worst case abuse to the number of bytes reserved for offchainData.
// As destBytesOverhead accounts for extraData + offchainData, this caps the worst case abuse to the number of bytes reserved for offchainData.
// It therefore fully mitigates gas bombs for most tokens, as most tokens don't use offchainData.
if (extraData.length > s_tokenTransferFeeConfig[tokenAndAmount.token].destBytesOverhead) {
revert SourceTokenDataTooLarge(tokenAndAmount.token);
Expand Down Expand Up @@ -440,7 +440,7 @@ contract EVM2EVMOnRamp is IEVM2AnyOnRamp, ILinkAvailable, AggregateRateLimiter,
return IPool(ITokenAdminRegistry(s_dynamicConfig.tokenAdminRegistry).getPool(address(sourceToken)));
}

/// Not sure if this function still makes sense with 100+ tokens, but we need to keep it because the Router expects it
/// TODO Not sure if this function still makes sense with 100+ tokens, but we need to keep it because the Router expects it
function getSupportedTokens(uint64 /*destChainSelector*/ ) external pure returns (address[] memory) {
return new address[](0);
}
Expand Down
5 changes: 5 additions & 0 deletions contracts/src/v0.8/ccip/pools/TokenPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ abstract contract TokenPool is IPool, OwnerIsCreator, IERC165 {
RateLimiter.Config inboundRateLimiterConfig
);
event ChainRemoved(uint64 remoteChainSelector);
event RemotePoolSet(uint64 indexed remoteChainSelector, bytes previousPoolAddress, bytes remotePoolAddress);
event AllowListAdd(address sender);
event AllowListRemove(address sender);
event RouterUpdated(address oldRouter, address newRouter);
Expand Down Expand Up @@ -149,7 +150,11 @@ abstract contract TokenPool is IPool, OwnerIsCreator, IERC165 {
/// @param remotePoolAddress The address of the remote pool.
function setRemotePool(uint64 remoteChainSelector, bytes calldata remotePoolAddress) external onlyOwner {
if (!isSupportedChain(remoteChainSelector)) revert NonExistentChain(remoteChainSelector);

bytes memory prevAddress = s_remoteChainConfigs[remoteChainSelector].remotePoolAddress;
s_remoteChainConfigs[remoteChainSelector].remotePoolAddress = remotePoolAddress;

emit RemotePoolSet(remoteChainSelector, prevAddress, remotePoolAddress);
}

/// @notice Checks whether a chain selector is permissioned on this contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ contract OnRampTokenPoolReentrancy is EVM2EVMOnRampSetup {
Internal.PoolUpdate[] memory adds = new Internal.PoolUpdate[](1);
adds[0].token = address(s_sourceToken);
adds[0].pool = address(s_maliciousTokenPool);

s_tokenAdminRegistry.setPool(address(s_sourceToken), address(s_maliciousTokenPool));

s_sourceToken.transfer(address(s_facadeClient), 1e18);
Expand Down
70 changes: 67 additions & 3 deletions contracts/src/v0.8/ccip/test/pools/TokenPool.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,73 @@ contract TokenPool_constructor is TokenPoolSetup {
}
}

contract TokenPool_getRemotePool is TokenPoolSetup {
function test_getRemotePool_Success() public {
uint64 chainSelector = 123124;
address remotePool = makeAddr("remotePool");

// Zero indicates nothing is set
assertEq(0, s_tokenPool.getRemotePool(chainSelector).length);

TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1);
chainUpdates[0] = TokenPool.ChainUpdate({
remoteChainSelector: chainSelector,
remotePoolAddress: abi.encode(remotePool),
allowed: true,
outboundRateLimiterConfig: getOutboundRateLimiterConfig(),
inboundRateLimiterConfig: getInboundRateLimiterConfig()
});
s_tokenPool.applyChainUpdates(chainUpdates);

assertEq(remotePool, abi.decode(s_tokenPool.getRemotePool(chainSelector), (address)));
}
}

contract TokenPool_setRemotePool is TokenPoolSetup {
event RemotePoolSet(uint64 indexed remoteChainSelector, bytes previousPoolAddress, bytes remotePoolAddress);

function test_setRemotePool_Success() public {
uint64 chainSelector = DEST_CHAIN_SELECTOR;
address initialPool = makeAddr("remotePool");
// The new pool is a non-evm pool, as it doesn't fit in the normal 160 bits
bytes memory newPool = abi.encode(type(uint256).max);

TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1);
chainUpdates[0] = TokenPool.ChainUpdate({
remoteChainSelector: chainSelector,
remotePoolAddress: abi.encode(initialPool),
allowed: true,
outboundRateLimiterConfig: getOutboundRateLimiterConfig(),
inboundRateLimiterConfig: getInboundRateLimiterConfig()
});
s_tokenPool.applyChainUpdates(chainUpdates);

vm.expectEmit();
emit RemotePoolSet(chainSelector, abi.encode(initialPool), newPool);

s_tokenPool.setRemotePool(chainSelector, newPool);

assertEq(keccak256(newPool), keccak256(s_tokenPool.getRemotePool(chainSelector)));
}

// Reverts

function test_setRemotePool_NonExistentChain_Reverts() public {
uint64 chainSelector = 123124;
bytes memory remotePool = abi.encode(makeAddr("remotePool"));

vm.expectRevert(abi.encodeWithSelector(TokenPool.NonExistentChain.selector, chainSelector));
s_tokenPool.setRemotePool(chainSelector, remotePool);
}

function test_setRemotePool_OnlyOwner_Reverts() public {
vm.startPrank(STRANGER);

vm.expectRevert("Only callable by owner");
s_tokenPool.setRemotePool(123124, abi.encode(makeAddr("remotePool")));
}
}

contract TokenPool_applyChainUpdates is TokenPoolSetup {
event ChainAdded(
uint64 chainSelector, RateLimiter.Config outboundRateLimiterConfig, RateLimiter.Config inboundRateLimiterConfig
Expand Down Expand Up @@ -538,7 +605,6 @@ contract TokenPoolWithAllowListSetup is TokenPoolSetup {
}
}

/// @notice #getAllowListEnabled
contract TokenPoolWithAllowList_getAllowListEnabled is TokenPoolWithAllowListSetup {
function testGetAllowListEnabledSuccess() public {
assertTrue(s_tokenPool.getAllowListEnabled());
Expand All @@ -562,7 +628,6 @@ contract TokenPoolWithAllowList_setRouter is TokenPoolWithAllowListSetup {
}
}

/// @notice #getAllowList
contract TokenPoolWithAllowList_getAllowList is TokenPoolWithAllowListSetup {
function testGetAllowListSuccess() public {
address[] memory setAddresses = s_tokenPool.getAllowList();
Expand All @@ -572,7 +637,6 @@ contract TokenPoolWithAllowList_getAllowList is TokenPoolWithAllowListSetup {
}
}

/// @notice #setAllowList
contract TokenPoolWithAllowList_applyAllowListUpdates is TokenPoolWithAllowListSetup {
event AllowListAdd(address sender);
event AllowListRemove(address sender);
Expand Down

0 comments on commit e8e3892

Please sign in to comment.