aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityABIJSON.cpp
diff options
context:
space:
mode:
authorLiana Husikyan <liana@ethdev.com>2015-02-09 09:06:30 +0800
committerLiana Husikyan <liana@ethdev.com>2015-02-09 09:06:30 +0800
commit12505a5b768be6e2d0302f8803dbfa79e7987034 (patch)
treeab2660773b6e21445df682585bd538eab9c328aa /SolidityABIJSON.cpp
parent5d7098eba7745ce4944b0b1d77d13a3a10929458 (diff)
downloaddexon-solidity-12505a5b768be6e2d0302f8803dbfa79e7987034.tar.gz
dexon-solidity-12505a5b768be6e2d0302f8803dbfa79e7987034.tar.zst
dexon-solidity-12505a5b768be6e2d0302f8803dbfa79e7987034.zip
- implemented Empty parameter name story. Now the name of input/return parameters of function can be not specified.
- added appropriate tests Conflicts: test/SolidityEndToEndTest.cpp test/SolidityNameAndTypeResolution.cpp
Diffstat (limited to 'SolidityABIJSON.cpp')
-rw-r--r--SolidityABIJSON.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/SolidityABIJSON.cpp b/SolidityABIJSON.cpp
index 13e65761..d600340e 100644
--- a/SolidityABIJSON.cpp
+++ b/SolidityABIJSON.cpp
@@ -409,7 +409,78 @@ BOOST_AUTO_TEST_CASE(inherited)
checkInterface(sourceCode, interface);
}
+BOOST_AUTO_TEST_CASE(empty_name_input_parameter_with_named_one)
+{
+ char const* sourceCode = R"(
+ contract test {
+ function f(uint, uint k) returns(uint ret_k, uint ret_g){
+ uint g = 8;
+ ret_k = k;
+ ret_g = g;
+ }
+ })";
+
+ char const* interface = R"([
+ {
+ "name": "f",
+ "constant": false,
+ "type": "function",
+ "inputs": [
+ {
+ "name": "",
+ "type": "uint256"
+ },
+ {
+ "name": "k",
+ "type": "uint256"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "ret_k",
+ "type": "uint256"
+ },
+ {
+ "name": "ret_g",
+ "type": "uint256"
+ }
+ ]
+ }
+ ])";
+ checkInterface(sourceCode, interface);
+}
+
+BOOST_AUTO_TEST_CASE(empty_name_return_parameter)
+{
+ char const* sourceCode = R"(
+ contract test {
+ function f(uint k) returns(uint){
+ return k;
+ }
+ })";
+
+ char const* interface = R"([
+ {
+ "name": "f",
+ "constant": false,
+ "type": "function",
+ "inputs": [
+ {
+ "name": "k",
+ "type": "uint256"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "",
+ "type": "uint256"
+ }
+ ]
+ }
+ ])";
+ checkInterface(sourceCode, interface);
+}
BOOST_AUTO_TEST_SUITE_END()