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

Unable to parse tuple response #266

Closed
wafcio opened this issue Apr 3, 2024 · 1 comment
Closed

Unable to parse tuple response #266

wafcio opened this issue Apr 3, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@wafcio
Copy link
Contributor

wafcio commented Apr 3, 2024

Response from JSON API in tuple format doesn't work and fails every time.

The problem is located here: https://github.com/q9f/eth.rb/blob/main/lib/eth/abi.rb#L79

Type.parse(t)

should have a second argument - components; otherwise, for a tuple, the expectation is raised.

undefined method `none?' for nil

You can check it by calling Ethereum contract 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9, method: "getReserveData", argument "0xdAC17F958D2ee523a2206206994597C13D831ec7"

@q9f q9f added the duplicate This issue or pull request already exists label Apr 16, 2024
@q9f
Copy link
Owner

q9f commented Apr 16, 2024

duplicate of #102

decoding tuples is not implemented unfortunately. maybe some day we can integrate the new abi decoder written by @wuminzhe - maybe take a look?

https://github.com/wuminzhe/abi_coder_rb

the answer is more complicated than adding another parameter to parse, unfortunately.

@q9f q9f closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants