Comments (7)
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.
So from my tests: currently, 14 exemples/tests don't give these 3 parameters, 9 do.
So there are 2 approaches:
- We require every example to provide them (annoying), I change the 14 examples
- 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.
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.
Yes I can do that but I cannot do it without resorting to name matching haha
from fuels-rs.
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.
without resorting to name matching haha
Couldn't you just check the types of the first 3 args?
from fuels-rs.
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)
- Investigate the possibility of having connected and unconnected accounts
- Check if `Abigen` is re-exported to fuels reexports (maybe add doc section why we want to do this)
- Make sure all `Future`s are `Send`able
- Investigate if ABI encoder/decoder can accept something that can be turned into an iterator instead of slice
- Revert OutOfGas error when using the produce_blocks function in the provider to go forward in time HOT 4
- Error out on excess bytes in the decoder
- `LogFormatter` should not be public HOT 1
- Investigate if we can remove the `AsciiString` type
- Add option to not derive `tokenizable` and `parameterizable` and split `tokenizable` into two parts (encoding and decoding)
- Check if debug with depth can make a prettier debug output
- User-overwriteable type mappings during the abigen
- Investigate if we can the estimation performed right before the transaction is sent
- Investigate the possibility of using the type state pattern on the contract instance struct
- Delete response method from call handler
- Mention estimation caveat in docs
- Cannot connect to fuel core server HOT 2
- Enable provider connection to testnet test
- gas price variation impacts set max fee
- max fee tolerance is not reflected when covering with base asset
- Memory-write-overlap bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuels-rs.