Skip to content
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: return Enums containing heap types at depth 1 #1106

Merged
merged 41 commits into from
Oct 6, 2023

Conversation

iqdecay
Copy link
Contributor

@iqdecay iqdecay commented Aug 28, 2023

This PR enables returning heap types surrounded in an Enum type. It notably enables returning
a Result<Vec> for instance from a contract call.

Closes #940.

Main disavantages from this approach:

  • We are injecting more custom bytecode
  • The interdependencies of the decoder and the bytecode make the code hard to navigate
  • Enum can contain only one variant that uses a heap type inside. It could be extended to having an arbitrary number of them, but they would all have to have the same encoding width. This is a personal design choice, open to criticism.

@iqdecay iqdecay marked this pull request as draft August 28, 2023 13:17
@FuelLabs FuelLabs locked as spam and limited conversation to collaborators Aug 28, 2023
@FuelLabs FuelLabs deleted a comment from roshnidhanjal21 Aug 28, 2023
@FuelLabs FuelLabs deleted a comment from roshnidhanjal21 Aug 28, 2023
@FuelLabs FuelLabs deleted a comment from roshnidhanjal21 Aug 28, 2023
@FuelLabs FuelLabs deleted a comment from roshnidhanjal21 Aug 28, 2023
@iqdecay iqdecay self-assigned this Aug 28, 2023
@iqdecay iqdecay marked this pull request as ready for review August 29, 2023 14:26
@iqdecay iqdecay marked this pull request as draft August 29, 2023 14:26
@iqdecay iqdecay force-pushed the iqdecay/feat-wrapped-bytes-output branch from 6637200 to 575da0d Compare August 30, 2023 13:41
@iqdecay iqdecay marked this pull request as ready for review August 30, 2023 23:12
@iqdecay iqdecay force-pushed the iqdecay/feat-wrapped-bytes-output branch from 5150518 to ba5955c Compare September 14, 2023 13:04
iqdecay and others added 3 commits October 3, 2023 14:50
Co-authored-by: Ahmed Sagdati <37515857+segfault-magnet@users.noreply.github.com>
Co-authored-by: Ahmed Sagdati <37515857+segfault-magnet@users.noreply.github.com>
MujkicA
MujkicA previously approved these changes Oct 4, 2023
segfault-magnet
segfault-magnet previously approved these changes Oct 4, 2023
@iqdecay iqdecay merged commit f51e76f into master Oct 6, 2023
39 checks passed
@iqdecay iqdecay deleted the iqdecay/feat-wrapped-bytes-output branch October 6, 2023 16:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request package:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Returning a wrapped Bytes type from contracts
5 participants