-
Notifications
You must be signed in to change notification settings - Fork 1.9k
bug(forge test
): forked tests are crashing when using WSS RPC URL
#10326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Abelaby can you provide code sample to reproduce? thank you |
@Abelaby can you also confirm whether you're using a WebSocket URL? |
Hi @grandizzy , Using this script // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import {Test} from "forge-std/Test.sol";
contract ForkTest is Test{
address internal constant wethAddress = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
IWETH weth;
function setUp() public{
vm.createSelectFork(
"mainnet"
);
weth = IWETH(wethAddress);
}
function testDepositWETH() public{
address alice = makeAddr("alice");
vm.deal(alice, 1 ether);
vm.startPrank(alice);
IWETH(weth).deposit{value: 1 ether}();
}
}
interface IWETH{
function deposit() external payable;
function withdraw(uint wad) external;
function balanceOf(address owner) external view returns (uint);
} I'm able to reproduce the issue, I've added my rpc in .env file. And running One thing I've noticed is that, this happens only when using public rpc like |
@yash-atreya yes I was, seems like that was the issue. |
forge test
): forked tests are crashing when using WSS RPC URL
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge Version: 1.1.0-nightly Commit SHA: 1da4d32 Build Timestamp: 2025-04-17T06:02:01.528588390Z (1744869721) Build Profile: maxperf
What version of Foundryup are you on?
Commit SHA: 1da4d32 Build Timestamp: 2025-04-17T06:02:01.528588390Z (1744869721) Build Profile: maxperf
What command(s) is the bug in?
forge test
Operating System
Windows
Describe the bug
I'm running in wsl and encountered this issue while running tests for an audit. Foundryup didn't fix the issue. Non fork tests seem to be running fine. Providing console output here.
The text was updated successfully, but these errors were encountered: