Git Product home page Git Product logo

Comments (7)

adlerjohn avatar adlerjohn commented on July 20, 2024 2

This is 1) a temporary thing until the compiler is improved and 2) users will always use ABI generated from the compiler. The only time where this implicit convention would be an issue is internally, but internally we just don't use the abigen flavor that removes the first 3 parameters (except to test that it works correctly of course).

from fuels-rs.

iqdecay avatar iqdecay commented on July 20, 2024

So from my tests: currently, 14 exemples/tests don't give these 3 parameters, 9 do.
So there are 2 approaches:

  1. We require every example to provide them (annoying), I change the 14 examples
  2. I remove the parameters in the 9 remaining and I don't check for these parameters in the ABI

I'm thinking of going for (2). Otherwise, if we want freedom to either include them or not in the examples, we need to keep the name matching. But I think (2) is better, and we can "enforce" that people don't provide these arguments in their examples, and if they do, then it's just more annoying for them to call the encoded function.

from fuels-rs.

adlerjohn avatar adlerjohn commented on July 20, 2024

Is it possible to instead have 2 abigen macros, one that ignores the first 3, makes sure there are exactly 4 parameters, and the types of the first 3 are as expected, and one that doesn't?

from fuels-rs.

iqdecay avatar iqdecay commented on July 20, 2024

Yes I can do that but I cannot do it without resorting to name matching haha

from fuels-rs.

iqdecay avatar iqdecay commented on July 20, 2024

image
Would that kind of approach suit you? And then I can propagate this strict_checking back to the macro def, which could even become a flag for the SDK

from fuels-rs.

adlerjohn avatar adlerjohn commented on July 20, 2024

without resorting to name matching haha

Couldn't you just check the types of the first 3 args?

from fuels-rs.

iqdecay avatar iqdecay commented on July 20, 2024

Ah yes sure, but it adds an "implicit" convention: if I feed it something that's not gas, color or amount first but has the right type, then it would not error whereas I would probably like to be warned that my arguments are discarded.

from fuels-rs.

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.