diff options
author | subtly <subtly@users.noreply.github.com> | 2015-05-12 08:04:59 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2015-05-12 08:04:59 +0800 |
commit | f3acbcce2f52ae5f7c62412d828dfe88618d96d8 (patch) | |
tree | b425da4371c633b6ae6e58f89569d4a57a0177f3 /libsolidity/SolidityABIJSON.cpp | |
parent | 07df8175f0190097c3deca11621556f007953e9f (diff) | |
parent | cf23eea716f16ab05e10c8bb63978083a2cbe5a6 (diff) | |
download | dexon-solidity-f3acbcce2f52ae5f7c62412d828dfe88618d96d8.tar dexon-solidity-f3acbcce2f52ae5f7c62412d828dfe88618d96d8.tar.gz dexon-solidity-f3acbcce2f52ae5f7c62412d828dfe88618d96d8.tar.bz2 dexon-solidity-f3acbcce2f52ae5f7c62412d828dfe88618d96d8.tar.lz dexon-solidity-f3acbcce2f52ae5f7c62412d828dfe88618d96d8.tar.xz dexon-solidity-f3acbcce2f52ae5f7c62412d828dfe88618d96d8.tar.zst dexon-solidity-f3acbcce2f52ae5f7c62412d828dfe88618d96d8.zip |
Merge branch 'develop' into discovery
Diffstat (limited to 'libsolidity/SolidityABIJSON.cpp')
-rw-r--r-- | libsolidity/SolidityABIJSON.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/libsolidity/SolidityABIJSON.cpp b/libsolidity/SolidityABIJSON.cpp index 26d0110b..f9bf78d0 100644 --- a/libsolidity/SolidityABIJSON.cpp +++ b/libsolidity/SolidityABIJSON.cpp @@ -525,6 +525,49 @@ BOOST_AUTO_TEST_CASE(constructor_abi) checkInterface(sourceCode, interface); } + +BOOST_AUTO_TEST_CASE(return_param_in_abi) +{ + // bug #1801 + char const* sourceCode = R"( + contract test { + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } + function test(ActionChoices param) {} + function ret() returns(ActionChoices){ + ActionChoices action = ActionChoices.GoLeft; + return action; + } + } + )"; + + char const* interface = R"( + [ + { + "constant" : false, + "inputs" : [], + "name" : "ret", + "outputs" : [ + { + "name" : "", + "type" : "uint8" + } + ], + "type" : "function" + }, + { + "inputs": [ + { + "name": "param", + "type": "uint8" + } + ], + "type": "constructor" + } + ] + )"; + checkInterface(sourceCode, interface); +} + BOOST_AUTO_TEST_SUITE_END() } |