-
Notifications
You must be signed in to change notification settings - Fork 31
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
Make Results Iterable #12
Comments
Very nice! Will check it out on Monday!
…Sent from my iPhone
On Nov 8, 2017, at 4:15 PM, Josiah Savary ***@***.***> wrote:
ethjs-abi
Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.
Before opening a new issue, you may find an answer in already closed issues:
https://github.com/ethjs/ethjs-abi/issues?q=is%3Aissue+is%3Aclosed
Issue Type
Bug (https://github.com/ethjs/ethjs-abi/blob/master/.github/CONTRIBUTING.md#bug-reports)
Feature (https://github.com/ethjs/ethjs-abi/blob/master/.github/CONTRIBUTING.md#feature-requests)
Description
I'd love to have Symbol.iterator implemented on the Result data structure. This would enable destructuring assignment, spreads, etc, when handling values returned from contracts. Additionally, iteration should only be performed over numerically indexed keys.
Steps to reproduce
Using the decodeParams function with any valid parameters, the following code will currently throw:
const [a, b, c] = decodeParams(...);
Only the following works currently:
const values = decodeParams(...);
const a = values[0]
const b = values[1]
const c = values[2]
Versions
Node/NPM: ***@***.***
Browser: any
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@SilentCicero awesome. Keep me posted :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ethjs-abi
Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.
Before opening a new issue, you may find an answer in already closed issues:
https://github.com/ethjs/ethjs-abi/issues?q=is%3Aissue+is%3Aclosed
Issue Type
Description
I'd love to have
Symbol.iterator
implemented on theResult
data structure. This would enable destructuring assignment, spreads, etc, when handling values returned from contracts. Additionally, iteration should only be performed over numerically indexed keys.Steps to reproduce
Using the
decodeParams
function with any valid parameters, the following code will currently throw:Only the following works currently:
Versions
The text was updated successfully, but these errors were encountered: