diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-08-03 03:22:26 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-09-06 03:28:18 +0800 |
commit | a7794b1a682d6b13bbe58e8164853d481ffd51f5 (patch) | |
tree | a576558391ec253a4a154376720037570af20db6 /test/libsolidity | |
parent | a34f2f1a316d6093c14045ee8423d913ac01421d (diff) | |
download | dexon-solidity-a7794b1a682d6b13bbe58e8164853d481ffd51f5.tar.gz dexon-solidity-a7794b1a682d6b13bbe58e8164853d481ffd51f5.tar.zst dexon-solidity-a7794b1a682d6b13bbe58e8164853d481ffd51f5.zip |
Include ABI JSON test for payable keyword
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityABIJSON.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index ec621104..9ee74d41 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -68,6 +68,7 @@ BOOST_AUTO_TEST_CASE(basic_test) { "name": "f", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -107,6 +108,7 @@ BOOST_AUTO_TEST_CASE(multiple_methods) { "name": "f", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -124,6 +126,7 @@ BOOST_AUTO_TEST_CASE(multiple_methods) { "name": "g", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -153,6 +156,7 @@ BOOST_AUTO_TEST_CASE(multiple_params) { "name": "f", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -188,6 +192,7 @@ BOOST_AUTO_TEST_CASE(multiple_methods_order) { "name": "c", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -205,6 +210,7 @@ BOOST_AUTO_TEST_CASE(multiple_methods_order) { "name": "f", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -235,6 +241,7 @@ BOOST_AUTO_TEST_CASE(const_function) { "name": "foo", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -256,6 +263,7 @@ BOOST_AUTO_TEST_CASE(const_function) { "name": "boo", "constant": true, + "payable" : false, "type": "function", "inputs": [{ "name": "a", @@ -284,6 +292,7 @@ BOOST_AUTO_TEST_CASE(events) { "name": "f", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -361,6 +370,7 @@ BOOST_AUTO_TEST_CASE(inherited) { "name": "baseFunction", "constant": false, + "payable" : false, "type": "function", "inputs": [{ @@ -376,6 +386,7 @@ BOOST_AUTO_TEST_CASE(inherited) { "name": "derivedFunction", "constant": false, + "payable" : false, "type": "function", "inputs": [{ @@ -429,6 +440,7 @@ BOOST_AUTO_TEST_CASE(empty_name_input_parameter_with_named_one) { "name": "f", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -469,6 +481,7 @@ BOOST_AUTO_TEST_CASE(empty_name_return_parameter) { "name": "f", "constant": false, + "payable" : false, "type": "function", "inputs": [ { @@ -536,6 +549,7 @@ BOOST_AUTO_TEST_CASE(return_param_in_abi) [ { "constant" : false, + "payable" : false, "inputs" : [], "name" : "ret", "outputs" : [ @@ -573,6 +587,7 @@ BOOST_AUTO_TEST_CASE(strings_and_arrays) [ { "constant" : false, + "payable" : false, "name": "f", "inputs": [ { "name": "a", "type": "string" }, @@ -600,6 +615,7 @@ BOOST_AUTO_TEST_CASE(library_function) [ { "constant" : false, + "payable" : false, "name": "f", "inputs": [ { "name": "b", "type": "test.StructType storage" }, @@ -636,6 +652,39 @@ BOOST_AUTO_TEST_CASE(include_fallback_function) checkInterface(sourceCode, interface); } +BOOST_AUTO_TEST_CASE(payable_function) +{ + char const* sourceCode = R"( + contract test { + function f() {} + function g() payable {} + } + )"; + + char const* interface = R"( + [ + { + "constant" : false, + "payable": false, + "inputs": [], + "name": "f", + "outputs": [], + "type" : "function" + }, + { + "constant" : false, + "payable": true, + "inputs": [], + "name": "g", + "outputs": [], + "type" : "function" + } + ] + )"; + checkInterface(sourceCode, interface); +} + + BOOST_AUTO_TEST_SUITE_END() } |