Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vyper --version
python --version
pip freeze
eth-tester==0.1.0b39 py-evm==0.2.0a42 pytest==5.0.1 vyper==0.1.0b10 web3==5.0.0b2
When @public functions which return structs are returned inline from other @public functions, the output is nonsense values.
@public
In the following code, wrap_get_my_struct_WORKING returns the correct data, whereas wrap_get_my_struct_BROKEN returns nonsense.
wrap_get_my_struct_WORKING
wrap_get_my_struct_BROKEN
struct MyStruct: e1: decimal e2: timestamp # @dev Construct a MyStruct. @public @constant def get_my_struct(_e1: decimal, _e2: timestamp) -> MyStruct: return MyStruct({e1: _e1, e2: _e2}) # @dev Wrap self.get_my_struct. @public @constant def wrap_get_my_struct_WORKING(_e1: decimal) -> MyStruct: testing: MyStruct = self.get_my_struct(_e1, block.timestamp) return testing # @dev Wrap self.get_my_struct. @public @constant def wrap_get_my_struct_BROKEN(_e1: decimal) -> MyStruct: return self.get_my_struct(_e1, block.timestamp)
The text was updated successfully, but these errors were encountered:
debug struct issue
84c2e58
vyperlang/vyper#1551
Successfully merging a pull request may close this issue.
Version Information
vyper --version
): 0.1.0b10python --version
): Python 3.7.2pip freeze
):What's your issue about?
When
@public
functions which return structs are returned inline from other@public
functions, the output is nonsense values.In the following code,
wrap_get_my_struct_WORKING
returns the correct data, whereaswrap_get_my_struct_BROKEN
returns nonsense.The text was updated successfully, but these errors were encountered: