aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/SolidityABIJSON.cpp
diff options
context:
space:
mode:
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()
}