Skip to content

Commit

Permalink
add unit tests for addWhitelistTokens
Browse files Browse the repository at this point in the history
  • Loading branch information
adu-web3 committed Jun 18, 2024
1 parent 0c69265 commit f7e4a1c
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 212 deletions.
2 changes: 1 addition & 1 deletion script/integration/1_DeployBootstrap.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {CustomProxyAdmin} from "../../src/core/CustomProxyAdmin.sol";
import {Vault} from "../../src/core/Vault.sol";
import {IOperatorRegistry} from "../../src/interfaces/IOperatorRegistry.sol";
import {IVault} from "../../src/interfaces/IVault.sol";
import {MyToken} from "../../test/foundry/MyToken.sol";
import {MyToken} from "../../test/foundry/unit/MyToken.sol";

// Technically this is used for testing but it is marked as a script
// because it is a script that is used to deploy the contracts on Anvil
Expand Down
2 changes: 1 addition & 1 deletion src/core/ClientChainGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ contract ClientChainGateway is
for (uint256 i; i < tokens.length; i++) {
address token = tokens[i];
require(token != address(0), "ClientChainGateway: zero token address");
require(!isWhitelistedToken[token], "ClientChainGateway: token should be not whitelisted before");
require(!isWhitelistedToken[token], "ClientChainGateway: token should not be whitelisted before");

actionArgs = abi.encodePacked(actionArgs, bytes32(bytes20(token)));
}
Expand Down
192 changes: 0 additions & 192 deletions test/foundry/ClientChainGateway.t.sol

This file was deleted.

24 changes: 12 additions & 12 deletions test/foundry/Bootstrap.t.sol → test/foundry/unit/Bootstrap.t.sol
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Bootstrap} from "../../src/core/Bootstrap.sol";
import {ClientChainGateway} from "../../src/core/ClientChainGateway.sol";
import {CustomProxyAdmin} from "../../src/core/CustomProxyAdmin.sol";
import {Vault} from "../../src/core/Vault.sol";

import {IOperatorRegistry} from "../../src/interfaces/IOperatorRegistry.sol";

import {IVault} from "../../src/interfaces/IVault.sol";
import {Origin} from "../../src/lzApp/OAppReceiverUpgradeable.sol";
import {BootstrapStorage} from "../../src/storage/BootstrapStorage.sol";
import {GatewayStorage} from "../../src/storage/GatewayStorage.sol";
import {NonShortCircuitEndpointV2Mock} from "../mocks/NonShortCircuitEndpointV2Mock.sol";
import {Bootstrap} from "src/core/Bootstrap.sol";
import {ClientChainGateway} from "src/core/ClientChainGateway.sol";
import {CustomProxyAdmin} from "src/core/CustomProxyAdmin.sol";
import {Vault} from "src/core/Vault.sol";

import {IOperatorRegistry} from "src/interfaces/IOperatorRegistry.sol";

import {NonShortCircuitEndpointV2Mock} from "../../mocks/NonShortCircuitEndpointV2Mock.sol";
import {MyToken} from "./MyToken.sol";
import {IVault} from "src/interfaces/IVault.sol";
import {Origin} from "src/lzApp/OAppReceiverUpgradeable.sol";
import {BootstrapStorage} from "src/storage/BootstrapStorage.sol";
import {GatewayStorage} from "src/storage/GatewayStorage.sol";

import "@layerzerolabs/lz-evm-protocol-v2/contracts/libs/GUID.sol";

Expand Down
Loading

0 comments on commit f7e4a1c

Please sign in to comment.