aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/SolidityABIJSON.cpp
diff options
context:
space:
mode:
authorCJentzsch <jentzsch.software@gmail.com>2015-05-13 16:35:51 +0800
committerCJentzsch <jentzsch.software@gmail.com>2015-05-13 16:35:51 +0800
commit1230062ff09c5d209a2c581b6cfcda664b576e12 (patch)
tree667b90fcd523848af62620d505e020313057dd9e /libsolidity/SolidityABIJSON.cpp
parent1532574367d20f050cddad4b68c3c7f9645e44b4 (diff)
parente3aca3dca9e1e0b940d74295d2e8ac0556b362b6 (diff)
downloaddexon-solidity-1230062ff09c5d209a2c581b6cfcda664b576e12.tar
dexon-solidity-1230062ff09c5d209a2c581b6cfcda664b576e12.tar.gz
dexon-solidity-1230062ff09c5d209a2c581b6cfcda664b576e12.tar.bz2
dexon-solidity-1230062ff09c5d209a2c581b6cfcda664b576e12.tar.lz
dexon-solidity-1230062ff09c5d209a2c581b6cfcda664b576e12.tar.xz
dexon-solidity-1230062ff09c5d209a2c581b6cfcda664b576e12.tar.zst
dexon-solidity-1230062ff09c5d209a2c581b6cfcda664b576e12.zip
Merge remote-tracking branch 'upstream/develop' into addTests
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()
}