aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/interface/InterfaceHandler.cpp1
-rw-r--r--test/libsolidity/SolidityABIJSON.cpp20
2 files changed, 21 insertions, 0 deletions
diff --git a/libsolidity/interface/InterfaceHandler.cpp b/libsolidity/interface/InterfaceHandler.cpp
index a536b0bc..6e3ae78f 100644
--- a/libsolidity/interface/InterfaceHandler.cpp
+++ b/libsolidity/interface/InterfaceHandler.cpp
@@ -82,6 +82,7 @@ string InterfaceHandler::abiInterface(ContractDefinition const& _contractDef)
Json::Value method;
method["type"] = "fallback";
method["constant"] = externalFunctionType->isConstant();
+ method["payable"] = externalFunctionType->isPayable();
abi.append(method);
}
for (auto const& it: _contractDef.interfaceEvents())
diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp
index 9ee74d41..185ba3bf 100644
--- a/test/libsolidity/SolidityABIJSON.cpp
+++ b/test/libsolidity/SolidityABIJSON.cpp
@@ -645,6 +645,7 @@ BOOST_AUTO_TEST_CASE(include_fallback_function)
[
{
"constant" : false,
+ "payable": false,
"type" : "fallback"
}
]
@@ -684,6 +685,25 @@ BOOST_AUTO_TEST_CASE(payable_function)
checkInterface(sourceCode, interface);
}
+BOOST_AUTO_TEST_CASE(payable_fallback_unction)
+{
+ char const* sourceCode = R"(
+ contract test {
+ function () payable {}
+ }
+ )";
+
+ char const* interface = R"(
+ [
+ {
+ "constant" : false,
+ "payable": true,
+ "type" : "fallback"
+ }
+ ]
+ )";
+ checkInterface(sourceCode, interface);
+}
BOOST_AUTO_TEST_SUITE_END()