Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit 2580112

Browse files
committed
cleanup
1 parent baca4c1 commit 2580112

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

src/Chainweb.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface IChainwebChainId {
1111
function getChainId() external view returns (uint32);
1212
}
1313

14-
abstract contract Chainweb is CommonBase {
14+
contract Chainweb is CommonBase {
1515
uint24 private _numberOfChains;
1616
uint256 private _chainIdOffset;
1717
uint24 private _chainwebChainIdOffset;
@@ -211,7 +211,7 @@ abstract contract ChainwebTest is Chainweb, Test {
211211
}
212212
}
213213

214-
contract ChainwebScript is Chainweb, ChainwebConfigReader, Script {
214+
abstract contract ChainwebScript is Chainweb, ChainwebConfigReader, Script {
215215
Chainweb public chainweb;
216216
ChainwebConfig private config;
217217

test/Chainweb.t.sol

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)