From 4e750379fd9d6846e328c15b54a77173f52f9b59 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 24 Feb 2024 04:02:37 +0100 Subject: [PATCH 1/2] test: remove test marked as internal --- test/StdChains.t.sol | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/StdChains.t.sol b/test/StdChains.t.sol index 321b77ec..f5d5bee4 100644 --- a/test/StdChains.t.sol +++ b/test/StdChains.t.sol @@ -43,11 +43,6 @@ contract StdChainsTest is Test { assertEq(getChain("sepolia").rpcUrl, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001"); } - function testFuzz_Rpc(string memory rpcAlias) internal { - string memory rpcUrl = getChain(rpcAlias).rpcUrl; - vm.createSelectFork(rpcUrl); - } - // Ensure we can connect to the default RPC URL for each chain. // function testRpcs() public { // testRpc("mainnet"); From 778072d755b71b166fdeddc36b14df331b750555 Mon Sep 17 00:00:00 2001 From: Matt Solomon Date: Mon, 11 Mar 2024 12:56:14 -0700 Subject: [PATCH 2/2] test: clarify fn purpose --- test/StdChains.t.sol | 54 +++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/test/StdChains.t.sol b/test/StdChains.t.sol index f5d5bee4..9a8f238b 100644 --- a/test/StdChains.t.sol +++ b/test/StdChains.t.sol @@ -43,30 +43,38 @@ contract StdChainsTest is Test { assertEq(getChain("sepolia").rpcUrl, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001"); } + // Named with a leading underscore to clarify this is not intended to be run as a normal test, + // and is intended to be used in the below `test_Rpcs` test. + function _testRpc(string memory rpcAlias) internal { + string memory rpcUrl = getChain(rpcAlias).rpcUrl; + vm.createSelectFork(rpcUrl); + } + // Ensure we can connect to the default RPC URL for each chain. - // function testRpcs() public { - // testRpc("mainnet"); - // testRpc("goerli"); - // testRpc("sepolia"); - // testRpc("optimism"); - // testRpc("optimism_goerli"); - // testRpc("arbitrum_one"); - // testRpc("arbitrum_one_goerli"); - // testRpc("arbitrum_nova"); - // testRpc("polygon"); - // testRpc("polygon_mumbai"); - // testRpc("avalanche"); - // testRpc("avalanche_fuji"); - // testRpc("bnb_smart_chain"); - // testRpc("bnb_smart_chain_testnet"); - // testRpc("gnosis_chain"); - // testRpc("moonbeam"); - // testRpc("moonriver"); - // testRpc("moonbase"); - // testRpc("base_goerli"); - // testRpc("base"); - // testRpc("fraxtal"); - // testRpc("fraxtal_testnet"); + // Currently commented out since this is slow and public RPCs are flaky, often resulting in failing CI. + // function test_Rpcs() public { + // _testRpc("mainnet"); + // _testRpc("goerli"); + // _testRpc("sepolia"); + // _testRpc("optimism"); + // _testRpc("optimism_goerli"); + // _testRpc("arbitrum_one"); + // _testRpc("arbitrum_one_goerli"); + // _testRpc("arbitrum_nova"); + // _testRpc("polygon"); + // _testRpc("polygon_mumbai"); + // _testRpc("avalanche"); + // _testRpc("avalanche_fuji"); + // _testRpc("bnb_smart_chain"); + // _testRpc("bnb_smart_chain_testnet"); + // _testRpc("gnosis_chain"); + // _testRpc("moonbeam"); + // _testRpc("moonriver"); + // _testRpc("moonbase"); + // _testRpc("base_goerli"); + // _testRpc("base"); + // _testRpc("fraxtal"); + // _testRpc("fraxtal_testnet"); // } function test_ChainNoDefault() public {