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

Make Results Iterable #12

Open
1 of 2 tasks
jozanza opened this issue Nov 8, 2017 · 2 comments
Open
1 of 2 tasks

Make Results Iterable #12

jozanza opened this issue Nov 8, 2017 · 2 comments

Comments

@jozanza
Copy link

jozanza commented Nov 8, 2017

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 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 result = decodeParams(...);
const a = result[0]
const b = result[1]
const c = result[2]

Versions

  • Node/NPM: 8.6.0/yarn@1.1.0
  • Browser: any
@SilentCicero
Copy link
Member

SilentCicero commented Nov 8, 2017 via email

@jozanza
Copy link
Author

jozanza commented Nov 8, 2017

@SilentCicero awesome. Keep me posted :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants