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

Modifications to how ABI data types are represented #1846

Merged
merged 2 commits into from Feb 6, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

  1. Include a name field in the ABI when representing tuple types. For inputs, the name is equal to the variable name of the struct. For outputs, the name is "". This is consistent with how Solidity represents tuples.
  2. For output types, change the given name from "out" to "". Again - this makes the Vyper ABI more consistent with Solidity.

This is related to, but does require, #1842. As @michwill pointed out, there is a bug when attempting to import a JSON interface that uses structs. Adding the "name" field fixes the bug and leads to another conversation: we do not currently support tuple types when importing interfaces. And that will be the subject of another PR :)

How I did it

Modifications to vyper/signatures/function_signature.py. See diff.

How to verify it

Run the tests. I updated cases that were failing based on the change.

Cute Animal Picture

image

@fubuloubu fubuloubu merged commit 6ea96f0 into vyperlang:master Feb 6, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the abi-struct-names branch February 6, 2020 17:18
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.

None yet

2 participants