Return Base-level struct as Tuple#2114
Merged
Merged
Conversation
1e8b869 to
b8571b8
Compare
iamdefinitelyahuman
approved these changes
Jul 25, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyHow to verify it
Had to update several tests that returned a tuple instead of a list from
eth_abiDescription for the changelog
Return tuple members directly if they are the only return value
Cute Animal Picture