Skip to content

Update Struct public getter to return whole Struct#2064

Merged
fubuloubu merged 4 commits into
vyperlang:masterfrom
fubuloubu:bug/struct-getter
Jun 28, 2020
Merged

Update Struct public getter to return whole Struct#2064
fubuloubu merged 4 commits into
vyperlang:masterfrom
fubuloubu:bug/struct-getter

Conversation

@fubuloubu

Copy link
Copy Markdown
Contributor

Closes: #1702

What I did

We had some funky handling prior for struct members because of a bug in web3py. This PR makes the correct change to support returning structs from public getters directly, making it compatible with how Solidity handles it.

How I did it

Just returning the struct name as a type directly instead of iterating over it's members

How to verify it

I updated the tests to use the tuple sequence returned from the public getter. Also note the xfail on the one test case that couldn't be handled by web3py's current configuration. We can remove this once web3py releases a fix, or we change to using Brownie

Description for the changelog

Public getters for structs now return the whole struct

Cute Animal Picture

exhausted

@iamdefinitelyahuman iamdefinitelyahuman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm amazed at how easy this was. I expected a lot more changes!

@fubuloubu fubuloubu merged commit 22bef3a into vyperlang:master Jun 28, 2020
@fubuloubu

Copy link
Copy Markdown
Contributor Author

@iamdefinitelyahuman don't jynx me broh

@fubuloubu fubuloubu deleted the bug/struct-getter branch June 28, 2020 18:33
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.

Struct getter collisions

2 participants