-
Notifications
You must be signed in to change notification settings - Fork 683
Ganache does not return a detailed exception #2935
Comments
I also try to add flag |
What did it used to return for you? |
This could be related to this recent change: https://github.com/trufflesuite/ganache/releases/tag/v7.0.1#user-content-v7.0.1-fixes-0 |
I use it for hardhat tests.
I can replace this with the following, but then I won't be able to track the exception error. This is very important for testing the operation of smart contracts!
|
My hunch is that this may be a Waffle bug. |
But if I use the Ganache app on Mac or run tests on any public node, there are no errors. Error only in P.s in old package |
Just checked on the The error is only in new versions! I use the following package versions:
|
Ganache UI currently uses an old version of ganache. The old version of ganache returned the revert reason string in a non-standard way, we now align with Geth. Tools like Waffle likely handled our non-standard format; I believe we now return the reason the same way Geth does. So the error is in old versions, tools like waffle handled the non-standard formatting. Have you tried the waffle alpha release (4.0.0-alpha.21)? https://www.npmjs.com/package/ethereum-waffle/v/4.0.0-alpha.21 |
It's also doesn't work on alpha version |
When I tested via private Geth node, I also had no problems... |
It could be related to TrueFiEng/Waffle#646 Waffle doesn't detect the revert reason on a testnet. |
I have no problems with Waffle. I also ran tests on my private Geth node. Everything went fine, the problem is only with ganache |
What Geth version are you running? |
1.10.1 |
Ah, I didn't noticed ethers.js in the error the first time. Does ethers-io/ethers.js#2849 leave any clues? |
It appears Ganache is working as intended. The transaction is reverted with a reason string; it is returned as encoded (as it should be). The tools (either hardhat, ethers.js, or waffle) don't seem to be handling it correctly. I'll discuss further with @MicaiahReid to be sure I'm not missing anything. |
It's return reason string on version 7.0.0 |
Ganache 7.0.0 and earlier returned this data incorrectly, this was fixed in |
Close for issue maintenance. Please open a new issue if needed. |
on version 7.2.0, revert reasons/messages are always |
@Silur , can you open your own issue with reproduction steps? |
I opened an issue in the hardhat repo because I still have the same problem: NomicFoundation/hardhat#3441 |
According to the hardhat dev, the issue still appears when using ethers.js without hardhat so I think we should reopen this issue (see NomicFoundation/hardhat#3441 for details and reproductivity) |
Are you sure this isn't an Ethers issue? |
There is no issue when I'm using the hardhat testnet |
It sounds like they put in a workaround. I'm just unable to get to a computer for a few days to look into this further. |
@joelamouche can you run Ganache with the |
|
Hi! I found an error that Ganache does not return a detailed exception when calling contract function.
I use Ganache in Docker
trufflesuite/ganache:v7.0.4
And Run it how:
Everything works, but does not return a detailed exception error when calling the contract.
What do I get instead of getting a Time Limit exception:
AssertionError: Expected transaction to be reverted with Time limit, but other exception was thrown: Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (error={"name":"ProviderError","code":-32000,"_isProviderError":true,"data":"0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000a54696d65206c696d697400000000000000000000000000000000000000000000"}, data="0x", code=CALL_EXCEPTION, version=providers/5.6.4)
P.s in old package
trufflesuite/ganache-cli
everything works fine and I get a detailed error!The text was updated successfully, but these errors were encountered: