Update Struct public getter to return whole Struct#2064
Merged
Conversation
NOTE: This works in reality (see ApeWorX/web3.py#1634 (comment)) however our test suite currently can't handle it because of a bug in Web3.py
7951184 to
4c4226d
Compare
iamdefinitelyahuman
approved these changes
Jun 28, 2020
iamdefinitelyahuman
left a comment
Contributor
There was a problem hiding this comment.
I'm amazed at how easy this was. I expected a lot more changes!
Contributor
Author
|
@iamdefinitelyahuman don't jynx me broh |
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.
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