aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/SolidityABIJSON.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-05-12 16:58:19 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-05-12 16:58:19 +0800
commit617dbcb9dd218d6cb3ef8423704df4514eedbd42 (patch)
treeb425da4371c633b6ae6e58f89569d4a57a0177f3 /libsolidity/SolidityABIJSON.cpp
parentb3a3b2f2600d68ddadd7991971f932e9b695818e (diff)
parentcf23eea716f16ab05e10c8bb63978083a2cbe5a6 (diff)
downloaddexon-solidity-617dbcb9dd218d6cb3ef8423704df4514eedbd42.tar
dexon-solidity-617dbcb9dd218d6cb3ef8423704df4514eedbd42.tar.gz
dexon-solidity-617dbcb9dd218d6cb3ef8423704df4514eedbd42.tar.bz2
dexon-solidity-617dbcb9dd218d6cb3ef8423704df4514eedbd42.tar.lz
dexon-solidity-617dbcb9dd218d6cb3ef8423704df4514eedbd42.tar.xz
dexon-solidity-617dbcb9dd218d6cb3ef8423704df4514eedbd42.tar.zst
dexon-solidity-617dbcb9dd218d6cb3ef8423704df4514eedbd42.zip
Merge branch 'develop' into ethash_reloaded
Diffstat (limited to 'libsolidity/SolidityABIJSON.cpp')
-rw-r--r--libsolidity/SolidityABIJSON.cpp43
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()
}