@@ -62,31 +62,31 @@ contract ChainwebPluginTest is ChainwebTest(2, 0) {
6262 assertEq (uint256 (stored), chainId, "Storage slot 0 does not match chainId " );
6363 }
6464
65- // function test_setupChainsForScript() public {
66- // Chainweb newChainweb = new Chainweb(vm, 2, block.chainid, 0, "");
67- // newChainweb.setupChainsForScript();
68- // string memory hostUrl = newChainweb.getHostUrl();
69- // assertEq(hostUrl, "");
70-
71- // // After setup, should be able to switch to both chains
72- // uint256[] memory chainIds = newChainweb.getChainIds();
73- // for (uint256 i = 0; i < chainIds.length; i++) {
74- // // This will revert if setupChainsForScript did not set up forks
75- // newChainweb.switchChain(chainIds[i]);
76- // uint256 activeChainId = newChainweb.getActiveChainId();
77- // assertEq(activeChainId, chainIds[i]);
78- // }
79- // }
80-
81- // function test_getHostUrl() public {
82- // // getHostUrl() should return the host URL set in the Chainweb constructor
83- // // The default in ChainwebTest is "" (empty string)
84- // assertEq(chainweb.getHostUrl(), "");
85- // // Deploy a new Chainweb with a custom host URL and check
86- // string memory customUrl = "http://localhost:8080";
87- // Chainweb customChainweb = new Chainweb(4, block.chainid, 0, customUrl);
88- // assertEq(customChainweb.getHostUrl(), customUrl);
89- // }
65+ function test_setupChainsForScript () public {
66+ Chainweb newChainweb = new Chainweb (2 , block .chainid , 0 , "" );
67+ newChainweb.setupChainsForScript ();
68+ string memory hostUrl = newChainweb.getHostUrl ();
69+ assertEq (hostUrl, "" );
70+
71+ // After setup, should be able to switch to both chains
72+ uint256 [] memory chainIds = newChainweb.getChainIds ();
73+ for (uint256 i = 0 ; i < chainIds.length ; i++ ) {
74+ // This will revert if setupChainsForScript did not set up forks
75+ newChainweb.switchChain (chainIds[i]);
76+ uint256 activeChainId = newChainweb.getActiveChainId ();
77+ assertEq (activeChainId, chainIds[i]);
78+ }
79+ }
80+
81+ function test_getHostUrl () public {
82+ // getHostUrl() should return the host URL set in the Chainweb constructor
83+ // The default in ChainwebTest is "" (empty string)
84+ assertEq (chainweb.getHostUrl (), "" );
85+ // Deploy a new Chainweb with a custom host URL and check
86+ string memory customUrl = "http://localhost:8080 " ;
87+ Chainweb customChainweb = new Chainweb (4 , block .chainid , 0 , customUrl);
88+ assertEq (customChainweb.getHostUrl (), customUrl);
89+ }
9090
9191 function test_ActiveChainId () public {
9292 uint256 [] memory chainIds = chainweb.getChainIds ();
0 commit comments