Closed milkyklim closed 1 year ago
ape
$ ape --version 0.5.9 $ ape plugins list Installed Plugins: etherscan 0.1.0b3 tokens 0.1.0b5.dev2+g9dc883e vyper 0.5.2 solidity 0.5.4 foundry 0.5.2
ape-config.yaml
name: test plugins: - name: vyper - name: solidity - name: tokens - name: ethereum - name: foundry ethereum: default_network: mainnet-fork mainnet_fork: default_provider: foundry foundry: port: auto fork: ethereum: mainnet: upstream_provider: geth geth: ethereum: mainnet: uri: ${WEB3_PROVIDER_URI}
This gets compiled:
# @version 0.3.7 MAX_NUM: public(constant(uint256)) = 10 struct MyStruct: one: uint256 two: uint256 there: uint256 @view @external def get_values() -> (DynArray[uint256, MAX_NUM], DynArray[MyStruct, MAX_NUM]): _ids: DynArray[uint256, MAX_NUM] = [] _my_structs: DynArray[MyStruct, MAX_NUM] = [] return _ids, _my_structs
When I try to call .get_values() in ape I get an error:
.get_values()
TypeError: __init__() missing 3 required positional arguments: 'one', 'two', and 'there'
--
Diving into this, it seems like for the second return type it is returning an empty tuple instead of an empty list from ape.utils.abi.StructParser.parse
ape.utils.abi.StructParser.parse
Environment information
ape
and plugin versions:ape-config.yaml
:What went wrong?
This gets compiled:
When I try to call
.get_values()
in ape I get an error:TypeError: __init__() missing 3 required positional arguments: 'one', 'two', and 'there'
How can it be fixed?
--