-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
receive() function fails in tests when using hardhat's console.log (and other weird behaviour) #4917
Comments
Hi @porobov , could you please check the commit link? I'm receiving a 404 error when trying to access it. |
Oops, apologies for that @ChristopherDedominici. Yes, it was private. Made it public. Here's also a .env template if the code will require it (I noticed it was in .gitignore).
|
Thanks @porobov, I'll take a look |
Updated many packages, including: Latest node and npm. Made another checkpoint Steps to reproduce (running it on localhost now):
|
@ChristopherDedominici I don't think it's the only problem of |
Version of Hardhat
2.12.6
What happened?
I have receive() function in a dedicated contract presented below.
I'm testing it with Hardhat using forked mainnet and get two bugs:
console.log
breaks testsmsg.sender == 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
also breaks tests. While definitelyaddress(WETH) == 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Errors happen when WETH contract sends ETH to my contract.
When uncommenting `console.log' the error is:
When commenting address error is as follows. I already tried to investigate it before and found out that
msg.sender
andaddress(WETH)
while same come in different letter cases (lower case and mixed). It only happened in this function.Minimal reproduction steps
This is hard to reproduce. I made a git checkpoint commit where it is easy to do.
porobov/meh-resurrections@562eb0d
Steps to reproduce:
Search terms
console.log breaks tests receive function fails
The text was updated successfully, but these errors were encountered: