diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-05-11 19:47:21 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-05-11 22:46:17 +0800 |
commit | ccc3d56542d76ce19ce994716e8d7afc339e7472 (patch) | |
tree | 22c4ed1b49a91c5f51655b6b90eaba198910fda2 /libsolidity/SolidityABIJSON.cpp | |
parent | 2cc62fbbfba89afaa2d83728ebb5b5c4488dd110 (diff) | |
download | dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar.gz dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar.bz2 dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar.lz dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar.xz dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.tar.zst dexon-solidity-ccc3d56542d76ce19ce994716e8d7afc339e7472.zip |
bug in abi. fixed external type for return parameters
Diffstat (limited to 'libsolidity/SolidityABIJSON.cpp')
-rw-r--r-- | libsolidity/SolidityABIJSON.cpp | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/libsolidity/SolidityABIJSON.cpp b/libsolidity/SolidityABIJSON.cpp index 26d0110b..6c1025d6 100644 --- a/libsolidity/SolidityABIJSON.cpp +++ b/libsolidity/SolidityABIJSON.cpp @@ -499,7 +499,8 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { char const* sourceCode = R"( contract test { - function test(uint param1, test param2, bool param3) {} + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } + function test(uint param1, test param2, bool param3, ActionChoices param4) {} } )"; @@ -517,6 +518,51 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { "name": "param3", "type": "bool" + }, + { + "name": "param4", + "type": "uint8" + } + ], + "type": "constructor" + } + ])"; + 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" |