Skip to content

Commit

Permalink
resolve mainnet names
Browse files Browse the repository at this point in the history
  • Loading branch information
RensR committed Oct 22, 2024
1 parent 211f463 commit 41485cf
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 6 deletions.
27 changes: 26 additions & 1 deletion contracts/src/v0.8/ccip/test/MOAFT/CCIPTestSuite.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ library Constants {
function _resolveChainSelector(
uint64 chainSelector
) internal pure returns (string memory) {
// Testnets
if (chainSelector == 3478487238524512106) {
return "Arbitrum Sepolia";
} else if (chainSelector == 8871595565390010547) {
Expand All @@ -41,6 +42,30 @@ library Constants {
} else if (chainSelector == 14767482510784806043) {
return "Avax Fuji";
}
// Mainnets
if (chainSelector == 5009297550715157269) {
return "Ethereum mainnet";
} else if (chainSelector == 4411394078118774322) {
return "Blast";
} else if (chainSelector == 5009297550715157269) {
return "Ethereum mainnet";
} else if (chainSelector == 465200170687744372) {
return "Gnosis";
} else if (chainSelector == 13274425992935471758) {
return "Binance Smart Chain";
} else if (chainSelector == 7264351850409363825) {
return "Mode";
} else if (chainSelector == 3734403246176062136) {
return "Optimism";
} else if (chainSelector == 4051577828743386545) {
return "Polygon";
} else if (chainSelector == 4949039107694359620) {
return "Arbitrum";
} else if (chainSelector == 6433500567565415381) {
return "Avalanche";
} else if (chainSelector == 15971525489660198786) {
return "Base";
}

return "Unknown";
}
Expand Down Expand Up @@ -224,7 +249,7 @@ contract CCIPTestSuite is Test {
deal(token, address(this), TOKENS_TO_SEND * 10);

IERC20(token).approve(address(i_router), TOKENS_TO_SEND);
i_router.ccipSend{value: 1 ether}(
i_router.ccipSend{value: 100 ether}(
destChainSelector,
Client.EVM2AnyMessage({
receiver: abi.encode(_getRandomAddress()),
Expand Down
25 changes: 20 additions & 5 deletions contracts/src/v0.8/ccip/test/MOAFT/chainLoading.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {Test} from "forge-std/Test.sol";
/// <chain>_RPC_URL=''
/// # The Router contract address
/// <chain>_ROUTER=0x0BF3dE8c5D3e8A2B34D2BEeB17ABfCeBaf363A59
/// # The block before the migration was applied. Use 0 if the migration has not been applied yet.
/// # Any block before the migration was applied.
/// <chain>_PRE_BLOCK=6797746
/// # Any block after the migration was applied. Use 0 if the migration has not been applied yet.
/// <chain>_POST_BLOCK=6904314
Expand Down Expand Up @@ -54,8 +54,18 @@ contract ChainLoading is Test {

uint256 internal constant FourHours = 4 * 60 * 60;

string[] internal s_allTestnets = [SEPOLIA, OPT_SEPOLIA, ARB_SEPOLIA];
string[] internal s_allMainnets = [ETHEREUM];
string[] internal s_allTestnets = [
SEPOLIA,
GNOSIS_TESTNET,
BNB_TESTNET,
MODE_TESTNET,
OPT_SEPOLIA,
POLYGON_AMOY,
ARB_SEPOLIA,
AVAX_FUJI,
BASE_SEPOLIA
];
string[] internal s_allMainnets = [BLAST, ETHEREUM, GNOSIS, BNB, MODE, OPTIMISM, POLYGON, ARBITRUM, AVAX, BASE];

mapping(string chainName => ForkedChainTestSetup) public s_chains;

Expand Down Expand Up @@ -88,8 +98,8 @@ contract ChainLoading is Test {
}

function test_all_chains() public {
for (uint256 i = 0; i < s_allTestnets.length; ++i) {
run(s_allTestnets[i]);
for (uint256 i = 0; i < s_allMainnets.length; ++i) {
run(s_allMainnets[i]);
}
}

Expand Down Expand Up @@ -130,6 +140,11 @@ contract ChainLoading is Test {

chain.testSuite.sendAllTokens(false);

if (chain.postMigrationBlock == 0) {
console2.logString("Migration not applied yet");
return;
}

console2.logString(" +------------------------------------------------+");
console2.logString(" | After migration |");
console2.logString(" +------------------------------------------------+");
Expand Down

0 comments on commit 41485cf

Please sign in to comment.