GithubHelp home page GithubHelp logo

Comments (4)

carver avatar carver commented on June 24, 2024

No objection here. I find it very difficult to parse those tests for correctness, as is.

from eth-abi.

davesque avatar davesque commented on June 24, 2024

Thoughts on this @pipermerriam ?

from eth-abi.

pipermerriam avatar pipermerriam commented on June 24, 2024

Agreed. Writing all of those tests was largely an experiment and I'd say it's failed as 1) they are very hard to read, and 2) they are effectively a second implementation of the logic (like you said).

from eth-abi.

pipermerriam avatar pipermerriam commented on June 24, 2024

Simplifying them to something like the following might make a lot of sense:

  • if it fails decoding: no assertions (unless we can think of good ones)
  • assertions that numeric values are strictly positive for unsigned types.
  • maybe assertions that decoded values are negative if we can reliably look at the right bit.
  • assertions that numeric values are in the appropriate range for the given type.
  • assertions that the value is an integer for types which should only yield integers.
  • assertions that the resulting type is of the appropriate type for the decoder.
  • assertions that on encoding the resulting value is the right length for any fixed length encoders.

from eth-abi.

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.