Test and fixes for payable fallback in ABI.

This commit is contained in:
chriseth 2016-09-06 10:59:13 +02:00
parent 384f189a6a
commit dff9633084
2 changed files with 21 additions and 0 deletions

View File

@ -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())

View File

@ -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()