mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test and fixes for payable fallback in ABI.
This commit is contained in:
parent
384f189a6a
commit
dff9633084
@ -82,6 +82,7 @@ string InterfaceHandler::abiInterface(ContractDefinition const& _contractDef)
|
|||||||
Json::Value method;
|
Json::Value method;
|
||||||
method["type"] = "fallback";
|
method["type"] = "fallback";
|
||||||
method["constant"] = externalFunctionType->isConstant();
|
method["constant"] = externalFunctionType->isConstant();
|
||||||
|
method["payable"] = externalFunctionType->isPayable();
|
||||||
abi.append(method);
|
abi.append(method);
|
||||||
}
|
}
|
||||||
for (auto const& it: _contractDef.interfaceEvents())
|
for (auto const& it: _contractDef.interfaceEvents())
|
||||||
|
@ -645,6 +645,7 @@ BOOST_AUTO_TEST_CASE(include_fallback_function)
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"constant" : false,
|
"constant" : false,
|
||||||
|
"payable": false,
|
||||||
"type" : "fallback"
|
"type" : "fallback"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -684,6 +685,25 @@ BOOST_AUTO_TEST_CASE(payable_function)
|
|||||||
checkInterface(sourceCode, interface);
|
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()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user