-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
txPromise.wait() reverts but transaction is successfull. #564
Comments
A transaction should almost always succeed, since all success means is that the network accepted the transaction. It does not know if the execution will succeed or revert, and it does not care. When you wait for the receipt (which is what Do you have a link to the code? It seems odd to me to get that error. It seems like it is trying to parse an error, but there isn’t one to parse... |
When I said that the transaction is successful I meant that the transaction is successfully mined. Code is here: |
I am facing exact issue. .wait() is reverting. I understand that a transaction would be mostly always successful that's why I put an estimate instruction before the transaction instruction in try catch block so that estimate would revert.
First try catch executes successfully, the second one fails. I checked with the tx hash on Rinkeby test net, transaction shows successfully mined. Error that .wait() throws is:
|
@zemse Can you try this on v5? It looks like either an event is being emitted with insufficient data. This came up recently with contracts compiled on Solidity 4.x with the function marked as |
@ricmoo This is possible that it is related. Back then I didn’t observe the contract version. I was helping a colleague with ethers.js code (who was probably using 4.x Solidity) I have been applying .wait() almost in all test cases that I write to verify logs. This is definitely not a problem with latest Solidity versions. If anyone is getting this problem, if it’s possible for you to upgrade the compiler version and redeploy yiur contracts, you can probably get this solved by yourself. However is there any workaround for those who have production contracts written in 0.4.x and want to replicate the .wait() utility? |
@ricmoo I having the same issue, here is the transaction: https://ropsten.etherscan.io/tx/0x7928c57dc5c49479867593b32f3e7816d89b506d8496e94e7a3afdb9b40a7bd6, its status is success but throws an |
Maybe it's a problem from gas station network, since I'm using |
Never mind, not related to ethers |
I believe the OP was solved in 5.0.12 release (see #891 (comment), #992). If that's not the case please reopen. |
The transactions I try to submit are successful (kovan) but the code fails.
Here is the code with extensive logs
And the logs:
The ABI for approveAndCall is
I just don't get what I'm doing wrong !
The text was updated successfully, but these errors were encountered: