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

Allow ComputedType to be passed to the set method on ABI types like Uint #266

Closed
barnjamin opened this issue Apr 5, 2022 · 0 comments
Closed
Assignees
Labels
new-feature-request Feature request that needs triage Team Scytale

Comments

@barnjamin
Copy link
Contributor

Problem

At the moment the only way to set something like the return value of a subroutine or an array element as the value of an ABI type is to use the store_into method or the use method. Neither of these are obvious to someone without looking up exactly what is available to them.

Solution

Allow the set method to accept a ComputedType and call the store_into method internally.

This allows for a more natural syntax

#...

(v := abi.Uint64()).set(arr[i.load()])

# Or for a tuple

(acct := abi.String()).set(tpl[0])
(balance := abi.Uint64()).set(tpl[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Scytale
Projects
None yet
Development

No branches or pull requests

3 participants