Closed Remscar closed 2 years ago
Hey @Remscar , sorry for the late reply!
Could you please provide some code in order to reproduce this issue?
I believe that hardhat might be using a binary search for gas estimation which results in a significant number of calls. Going to try to reproduce locally. Which version of hardhat are you using?
closing this issue for inactivity for now, please reopen with further details on how to reproduce the bug 🥕
Describe the bug I am using a mock to track how many times the
transferFrom
function on an ERC20 token is called. Even though the function only gets called once, the mock says it is called 13 times.I am using
.reset()
on the mock right before the call.Expected behavior The mock should say it has only been called once.
Additional context I have discovered that by setting a
gasLimit
on the transaction, the mock returns the proper number of calls. My suspicion is that when Hardhat is attempting to estimate the gas of the transaction, it is calling the mock many times.