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

Return Base-level struct as Tuple #2114

Merged
merged 4 commits into from
Jul 26, 2020
Merged

Conversation

fubuloubu
Copy link
Member

Fixes: #2113

What I did

Solidity returns the members or components of a struct/tuple when it is the only thing being returned (as a gas-saving measure). This lead to some minor incompatibilities with Solidity, and there was a strange bug in our test suite that I believe was introduced in v0.2.0. Unsure if this issue persisted before, but I believe it to be a minor issue that is easily worked around by changing the ABI that Vyper outputs in those rare circumstances where the ABI was inconsistent with the encoding.

How I did it

inserted one line into vyper/signatures/function_signature.py

How to verify it

Had to update several tests that returned a tuple instead of a list from eth_abi

Description for the changelog

Return tuple members directly if they are the only return value

Cute Animal Picture

Orangutan

@fubuloubu fubuloubu merged commit bba2340 into vyperlang:master Jul 26, 2020
@fubuloubu fubuloubu deleted the bug/abi-struct branch July 26, 2020 05:22
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.

Incorrect ABI for returning struct from a mapping
2 participants