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

fix array/tuple decoding #32

Merged

Conversation

ayrat555
Copy link
Collaborator

@ayrat555 ayrat555 commented May 18, 2020

Fixes #30

Two bugs I found:

  1. Decoding of dynamic array types is wrong.

This line (https://github.com/poanetwork/ex_abi/blob/master/lib/abi/type_decoder.ex#L247) assumes that items in the dynamic array are 32 bytes long. Size of dynamics types is not known and determined by prefix

  1. Decoding of tuples is wrong. Size prefix in decoded tuples is not considered.

Notes:

  • The code became were obscure. I think it'll be easier to re-write the library.

@vbaranov vbaranov self-requested a review May 19, 2020 06:40
Copy link
Collaborator

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good.

@vbaranov vbaranov merged commit 598f74c into poanetwork:master May 19, 2020
@vbaranov vbaranov changed the title [WIP] fix array/tuple decoding fix array/tuple decoding May 19, 2020
@ayrat555
Copy link
Collaborator Author

ayrat555 commented May 19, 2020

This PR was merged too early :(. I'll continue my work #33

@vbaranov
Copy link
Collaborator

I can revert it. Let me know.

@ayrat555
Copy link
Collaborator Author

t it has some code improvements (I removed unused functions and fixed dynamic arrays).

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 this pull request may close these issues.

parsing regression
2 participants