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

Extend data handling for types larger than a WORD #139

Closed
digorithm opened this issue Mar 4, 2022 · 2 comments · Fixed by #161
Closed

Extend data handling for types larger than a WORD #139

digorithm opened this issue Mar 4, 2022 · 2 comments · Fixed by #161
Labels
enhancement New feature or request

Comments

@digorithm
Copy link
Member

This is a follow-up to #112. Currently, we're checking for returned data size only for Strings and b256:

impl ParamType {
    // Checks whether the `ParamType` is bigger than a `WORD`
    pub fn bigger_than_word(&self) -> bool {
        match *self {
            Self::B256 => true,
            Self::String(size) => size > 8,
            _ => false,
            // More types will be handled later.
            // Currently, the support for arrays in the SDK is broken
            // due to a change to the array definition in Sway.
        }
    }
}

We need to extend this for the other types, more specifically custom types; Struct([u8]) should be smaller than a WORD, but Struct([u8, B256]) isn't.

@nfurfaro
Copy link

I think this is the last pain point for now on the SDK side of things for my work on the stdlib.
Any chance a fix might make it into the next release?
@digorithm

@digorithm
Copy link
Member Author

Yeah that's the plan, next release should include it. I'm wrapping up something else and then I'll be working on this one, which shouldn't take too long!

Repository owner moved this from Todo to Done in Fuel Network Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants