Return Base-level struct as Tuple #2114
Merged
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.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