Skip to content
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

Can't get tx receipt of reverted transaction #2612

Closed
szerintedmi opened this issue Mar 29, 2019 · 2 comments · Fixed by #2616
Closed

Can't get tx receipt of reverted transaction #2612

szerintedmi opened this issue Mar 29, 2019 · 2 comments · Fixed by #2616
Labels
Bug Addressing a bug

Comments

@szerintedmi
Copy link

Description

A tx which reverted never resolves and I can't get the receipt of the reverted transaction: receipt is not available neither in catch args or in error event args

Expected behavior

In case a transaction reverts or runs out of gas:

const receipt = await dummyContract.methods.revertMe().send()
  .on("transactionHash", <should be triggered with tx hash>)
  .on("receipt", 
     <should be triggered with tx receipt , receipt.status set to false>)
  .on("confirmation", 
      <should be triggered for each confirmation with 
             confirmation number and with tx receipt, receipt.status set to false>)
  .on("error", <should be triggered with error and receipt>)
  .catch( <IMHO it should NOT be triggered in VM reverts or out of gas
     rather resolve the call and let the caller handle it on error event or based on 
      resolved receipt's status 
      or at least should be triggered with (error, receipt)  )

Actual behavior

on VM error I can't retrieve the receipt in any of these ways:

  • it's not passed to error event
  • it's not passed to catch block (although I think catch block shouldn't be reached in this scenario)
  • no receipt or confirmation event called
  • the tx never resolves so even the resolved so returned receipt can't be used

Steps to reproduce the behavior

https://github.com/Augmint/web3js_integration_tests/blob/master/test/fails.js

Error Logs

N/A

Gists

https://github.com/Augmint/web3js_integration_tests/blob/master/test/fails.js

Versions

  • web3.js: beta51
  • nodejs: 8.15.3
  • browser: N/A
  • ethereum node: ganache-cli v6.4.1
@dileepfrog
Copy link

The latest release breaks the receipt event see #2601

@nivida nivida added the Bug Addressing a bug label Mar 29, 2019
@nivida
Copy link
Contributor

nivida commented Mar 29, 2019

Thanks for opening this issue! I will fix this and probably release it on Tuesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Addressing a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants