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 decode function with array types #14

Merged
merged 5 commits into from
Jan 14, 2019

Conversation

pthomalla
Copy link
Contributor

fix to #12

lib/abi.ex Outdated Show resolved Hide resolved
@ayrat555
Copy link
Collaborator

@pgebal thanks for the review!
@pthomalla I'll merge it when @pgebal 's comments are resolved

Copy link
Collaborator

@ayrat555 ayrat555 left a comment

Choose a reason for hiding this comment

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

lgtm. I'll test it tomorrow and release a new version if everything is ok

Copy link
Collaborator

@ayrat555 ayrat555 left a comment

Choose a reason for hiding this comment

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

it still crashes when decoding example from the issue #12

@pthomalla
Copy link
Contributor Author

pthomalla commented Jan 13, 2019

function_selector =
  ABI.FunctionSelector.parse_specification_item(%{
    "type" => "function",
    "name" => "baz",
    "inputs" => [
      %{"name" => "value1", "type" => "uint32[]"},
      %{"name" => "value1", "type" => "uint32[]"}
    ],
    "outputs" => []
  })

data = ABI.TypeEncoder.encode([[1, 2, 3, 4], [4, 5, 6]], function_selector)
ABI.TypeDecode.decode(data, function_selector)

it works but method_id in FunctionSelector shout be set

I could turn off a check of method_id if this is preferred

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.

3 participants