-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support Tuple
in Enum
and Enum
in Tuple
#213
Conversation
ef31d32
to
e00f4de
Compare
* Previously, inside a `struct` we were considering only `struct` types, and inside `enum` we were considering only `enum` types. We know look for either.
* run `cargo t workflow_enum_inside_struct` with all other tests from the harness commented-out (LOL)
- The code at this point expands correctly, and the test runs
57de094
to
5e12f92
Compare
* The test fails with `Expected `Tuple` found `Enum(xxx)`
Moving this summary of our conversation here so it's explicit what needs to be done:
|
- It now supports `Enum` types, and also does not expand the custom types, whatever the number of arguments.
packages/fuels-abigen-macro/tests/test_projects/enum_inside_struct/Forc.toml
Outdated
Show resolved
Hide resolved
packages/fuels-abigen-macro/tests/test_projects/enum_inside_struct/Forc.toml
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just re-reading what I did, it's way too big lol
packages/fuels-abigen-macro/tests/test_projects/enum_inside_struct/Forc.toml
Outdated
Show resolved
Hide resolved
@vnepveu Is this still a draft? Or officially ready for review? Let me know so I can take another deep pass. |
It's definitely ready for review just thought I'd review myself as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking really good. Great job on this -- this is no simple feat 😃. Just left some comments and improvement suggestions.
This PR definitely closes #53 by testing support for Struct inside Enum and Enum inside Struct types as function arguments in smart contracts. * It was only supported as function outputs since #213.I * In #275 support was added for the Enum type as function argument, and it turns out that nested custom types as function argument worked right-away with this.
This PR closes #53 by supporting nested
struct
andenums
as return types.It also closes #63 because of refactoring.
Some caveats:
inputs
, but the infrastructure is theoritically here. I'm waiting for theRESERV00
bug to be solved to see if it works