|
|
@ -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" |
|
|
|