Update Struct public getter to return whole Struct #2064
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.
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