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

feat(abigen): use AbiType when parsing Function abi signature fails at compile time #647

Merged
merged 9 commits into from
Dec 4, 2021

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Dec 3, 2021

Motivation

Fix #538

Solution

The reason why #538 happened is, because ethabis native tuple parser is used to parse the abi attribute that gets generated during abigen! expansion. abigen! is able to resolve custom datatypes at this stage and add a valid! abi signature this why.
However during EthAbiType expansion, the signature can't be parsed by ethabi's tuple parser because it struggles with nested tuples. In which case we use our AbiType::param_type trait to construct the ParamTypes, that we need for decoding, at runtime.

PR Checklist

  • Added Tests
  • Added Documentation
  • Updated the changelog

@mattsse mattsse changed the title feat(abigen): use AbiType when parsing Function abi fails at compile time feat(abigen): use AbiType when parsing Function abi signature fails at compile time Dec 3, 2021
@sveitser
Copy link
Contributor

sveitser commented Dec 4, 2021

Awesome and thank you so much! Tried the PR and it looks like the problems in #538 are indeed gone with this change. 🥳

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

lfg

@gakonst gakonst merged commit 2a3fcbb into gakonst:master Dec 4, 2021
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.

Abigen fails with some nested structs
3 participants