Giter VIP home page Giter VIP logo

Comments (1)

cgewecke avatar cgewecke commented on August 29, 2024

@barakman Sorry for the slow response, missed this.

More generally, a common set of error messages, regardless of the EVM used, would be ideal.

Agree. This difference goes back to the pre-byzantium chain which did not return any information about whether a transaction was successful or not. In order to make testing possible, ganache had a policy of appending errors to the response so that web3 would trigger a helpful message.

Post-byzantium, the mainnet clients append a status field to the receipt indicating whether or not a tx was successful. Additionally, ganache-cli now has a mode that emulates them. You should see the same error pattern as geth if you run it like this:

ganache-cli --noVMErrorsOnRPCResponse

The error object also contains the receipt, so you be able to catch the error and do this:

catch(err){
  parseInt(err.receipt.status) === 0 // Failure
  parseInt(err.receipt.status) === 1  // Success
} 

Truffle continues to add a message that includes key phrases like revert in order to maintain backwards compatibility with testing libraries like Zeppelin's and to provide useful information about what happened.

from truffle-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.