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)
- Use dynamic supported `fuel-core` version in version check
- Provide support for user-friendly creation of dependent transactions HOT 1
- Predicate validation using the VM within the SDK HOT 1
- Refactor coin cache
- Manual block production with Trigger::Never leads to error
- Cannot fetch Mint transactions through Provider
- Remove `[patch.crates-io]` from `Cargo.toml` once all crates are updated and released HOT 2
- Write some docs for the `Bytes` support
- Explore adding fuzzing tests in the SDK HOT 2
- Can't invoke SRC7 metadata method from the rust SDK due to arbitrary nesting of heap types HOT 2
- bug: `decode_multiple` can overflow
- `client` not exposed or accessible for `Provider`, doesn't allow for extension of extra queries. HOT 1
- Cannot call `msg_sender()` when creating multiple custom assets in Rust SDK HOT 1
- bug: `capacity overflow` while encoding param types
- test: `calculate_num_of_elements` is not tested
- Trim down variants of the `Error` type
- Improve Error wording for "not enough coins to fit the target"
- Add clippy check for overflowing arithmetic
- Error transfering custom assets of amount greater than the amount of owned base asset
- cargo test with harness.rs taking unrealistically long time to finish HOT 2
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.