Fix ChainwebChainId deployment during setupChainsForTests - #12
Conversation
024ea4f to
2227b2a
Compare
| string(abi.encodePacked(_hostUrl, "/chain/", vm.toString(i + _chainwebChainIdOffset), "/evm/rpc")); | ||
| console.log("Using custom RPC URL:", url); | ||
| _chainForks.push(vm.createFork(url)); | ||
| _chainForks.push(vm.createSelectFork(url)); |
There was a problem hiding this comment.
this will select the last chain as default. thats the thing we want?
There was a problem hiding this comment.
Yes, there must be an active fork for vm.activFork() to succeed below.
There was a problem hiding this comment.
Actually, the use of selectFork() is generally an issue in any code that is called in constructors of scripts and tests (not just sub-contracts).
selectFork() is also already used elsewhere. A fix for that broader issue is proposed in #13.
hswopeams
left a comment
There was a problem hiding this comment.
The tests all succeed in this branch, but the script doesn't run correctly.
If I start up anvil in one terminal from the top-level and then in another terminal change to /examples/Counter and then run
forge script --multi script/Counter.s.sol:CounterScript \
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \
--broadcast
as instructed in the README,
I get this warning:
== Logs ==
Setting main RPC node for 5 chains
Forking http://127.0.0.1:26695
Forking http://127.0.0.1:6865
Forking http://127.0.0.1:20208
Forking http://127.0.0.1:7667
Forking http://127.0.0.1:7048
Switched to chain: 20
Running script on chain: 31337
Switched to chain: 21
Running script on chain: 31338
Switched to chain: 22
Running script on chain: 31339
Switched to chain: 23
Running script on chain: 31340
Switched to chain: 24
Running script on chain: 31341
Switched to chain: 20
Active chain ID: 20
Switched to chain: 21
Active chain ID: 21
Switched to chain: 22
Active chain ID: 22
Switched to chain: 23
Active chain ID: 23
Switched to chain: 24
Active chain ID: 24
Setting up 5 EVMs.
Warning: Script contains a transaction to 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 which does not contain any code.
Do you wish to continue? [y/n]
If I say "yes", the script runs but doesn't complete. It hangs on pending transactions
|
Closing because the examples/Counter/script/Counter.s.sol script doesn't work in this branch. PR 13 supersedes this PR. Tests and scripts work in that PR branch, which has been merged. |
No description provided.