Skip to content

Return Base-level struct as Tuple#2114

Merged
fubuloubu merged 4 commits into
vyperlang:masterfrom
fubuloubu:bug/abi-struct
Jul 26, 2020
Merged

Return Base-level struct as Tuple#2114
fubuloubu merged 4 commits into
vyperlang:masterfrom
fubuloubu:bug/abi-struct

Conversation

@fubuloubu

Copy link
Copy Markdown
Contributor

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