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

API: call() is broken for view functions with an array as the last parameter #234

Open
mikec opened this issue Jan 13, 2019 · 1 comment
Labels
bug Something isn't working component: api

Comments

@mikec
Copy link
Contributor

mikec commented Jan 13, 2019

Executing a "call" on a view function in the smart contract is broken for functions with an array as the last input param.

? this.contract.methods[method](...params.slice(0, -1)).call(lastParam)

It's checking to see if the last parameter is an object (which is true if the last param is an array) and it's making the assumption that if it's an object, it's the call options object.

@sohkai sohkai added the bug Something isn't working label Jan 14, 2019
@sohkai
Copy link
Contributor

sohkai commented Jan 14, 2019

We should likely use the ABI to check the number of arguments expected, as implemented here: https://github.com/aragon/aragon.js/blob/master/packages/aragon-wrapper/src/index.js#L1110

@stale stale bot added the abandoned label Jul 13, 2019
@sohkai sohkai removed the abandoned label Jul 13, 2019
@stale stale bot added the abandoned label Jan 9, 2020
@aragon aragon deleted a comment from stale bot Jan 11, 2020
@stale stale bot removed the abandoned label Jan 11, 2020
@aragon aragon deleted a comment from stale bot Jan 29, 2020
@sohkai sohkai changed the title "call" is broken for view functions with an array as the last parameter API: call() is broken for view functions with an array as the last parameter Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: api
Projects
None yet
Development

No branches or pull requests

2 participants