You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A stubbed function of a mock contract is reverting on something in the contract logic. This doesn't make sense to me since it shouldn't care about the contract logic if stubbed. When running the unit test, we get the error Error: Transaction reverted: function returned an unexpected amount of data. The line corresponding to the error is purchaseTokenInstance.decimals() where purchaseTokenInstance is a IERC20MetadataUpgradable. If I use Hardhat console logging, the function doesn't actually execute and spit out values. Reproduction steps
Describe the bug
A stubbed function of a mock contract is reverting on something in the contract logic. This doesn't make sense to me since it shouldn't care about the contract logic if stubbed. When running the unit test, we get the error
Error: Transaction reverted: function returned an unexpected amount of data
. The line corresponding to the error ispurchaseTokenInstance.decimals()
where purchaseTokenInstance is a IERC20MetadataUpgradable. If I use Hardhat console logging, the function doesn't actually execute and spit out values.Reproduction steps
contract.function.returns(BigNumber.from("1000"));
Expected behavior
calls contract.function should just return ("1000") in unit tests, instead of reverting as in the description.
The text was updated successfully, but these errors were encountered: