diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-15 08:40:53 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-15 18:35:50 +0800 |
commit | 1f5ab603a74ded4058d3c7103e436112852b45ba (patch) | |
tree | 4de5ccdacb865006899daf3d424af06824c14c03 | |
parent | 12f3257e7d0e23502eb01a28c857ed56d9d2dbdc (diff) | |
download | dexon-solidity-1f5ab603a74ded4058d3c7103e436112852b45ba.tar.gz dexon-solidity-1f5ab603a74ded4058d3c7103e436112852b45ba.tar.zst dexon-solidity-1f5ab603a74ded4058d3c7103e436112852b45ba.zip |
Add test for payable constructor in ABI
-rw-r--r-- | test/libsolidity/SolidityABIJSON.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index b06dcfe5..80b4b6ad 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -568,6 +568,37 @@ BOOST_AUTO_TEST_CASE(constructor_abi) checkInterface(sourceCode, interface); } +BOOST_AUTO_TEST_CASE(payable_constructor_abi) +{ + char const* sourceCode = R"( + contract test { + function test(uint param1, test param2, bool param3) payable {} + } + )"; + + char const* interface = R"([ + { + "inputs": [ + { + "name": "param1", + "type": "uint256" + }, + { + "name": "param2", + "type": "address" + }, + { + "name": "param3", + "type": "bool" + } + ], + "payable": true, + "statemutability": "payable", + "type": "constructor" + } + ])"; + checkInterface(sourceCode, interface); +} BOOST_AUTO_TEST_CASE(return_param_in_abi) { |