Given example code:
struct MyStruct:
a: address
b: uint256
@public
@constant
def foo(s: MyStruct) -> MyStruct:
return s
The current ABI output is:
{'abi': [{'name': 'foo',
'outputs': [{'type': 'address', 'name': 'out'},
{'type': 'uint256', 'name': 'out'}],
'inputs': [{'type': '(address,uint256)', 'name': 's'}],
'constant': True,
'payable': False,
'type': 'function'}]}
Referencing the current location of ABI documentation:
https://solidity.readthedocs.io/en/latest/abi-spec.html#handling-tuple-types
The expected output should be:
{'abi': [{'name': 'foo',
'outputs': [{'type': 'tuple', 'components': [
{'type': 'address', 'name': 'a'},
{'type': 'uint256', 'name': 'b'}]
}],
'inputs': [{'type': 'tuple', 'name': 's', 'components': [
{'type': 'address', 'name': 'a'},
{'type': 'uint256', 'name': 'b'}]
}],
'constant': True,
'payable': False,
'type': 'function'}]}
We should update the way structs are produced in the ABI in order to be compliant with the ABI v2 updates.
Also, may be related to: #932

For reference:
https://github.com/charles-cooper/vyper/commit/9ca6aaf511d21803c646388ec0185f841c82aa7f
(The special case here might not be needed for ABIv2 https://github.com/charles-cooper/vyper/commit/da51e5c1a0a4b61fd9c9454ae5d2b0d797631a52)
https://github.com/charles-cooper/vyper/commit/ba553f6ecb69a800c0155ad78d9bed3119fb93c1
@fubuloubu The expected JSON ABI looks correct except that the name of the input 's' should appear in the JSON ABI like so:
{'abi': [{'name': 'foo',
'outputs': [{'type': 'tuple', 'components': [
{'type': 'address', 'name': 'a'},
{'type': 'uint256', 'name': 'b'}]
}],
'inputs': [{'type': 'tuple', 'name': 's', 'components': [
{'type': 'address', 'name': 'a'},
{'type': 'uint256', 'name': 'b'}]
}],
'constant': True,
'payable': False,
'type': 'function'}]}
Updated!