mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add view pure checker tests for `address.staticcall(...)
`.
This commit is contained in:
parent
7ca0aaaf6f
commit
ed5265598b
@ -53,8 +53,11 @@ BOOST_AUTO_TEST_CASE(environment_access)
|
|||||||
"tx.origin",
|
"tx.origin",
|
||||||
"tx.gasprice",
|
"tx.gasprice",
|
||||||
"this",
|
"this",
|
||||||
"address(1).balance"
|
"address(1).balance",
|
||||||
};
|
};
|
||||||
|
if (dev::test::Options::get().evmVersion().hasStaticCall())
|
||||||
|
view.emplace_back("address(0x4242).staticcall(\"\")");
|
||||||
|
|
||||||
// ``block.blockhash`` and ``blockhash`` are tested separately below because their usage will
|
// ``block.blockhash`` and ``blockhash`` are tested separately below because their usage will
|
||||||
// produce warnings that can't be handled in a generic way.
|
// produce warnings that can't be handled in a generic way.
|
||||||
vector<string> pure{
|
vector<string> pure{
|
||||||
@ -95,6 +98,22 @@ BOOST_AUTO_TEST_CASE(environment_access)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(address_staticcall)
|
||||||
|
{
|
||||||
|
string text = R"(
|
||||||
|
contract C {
|
||||||
|
function i() view public returns (bool) {
|
||||||
|
return address(0x4242).staticcall("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
if (!dev::test::Options::get().evmVersion().hasStaticCall())
|
||||||
|
CHECK_ERROR(text, TypeError, "\"staticcall\" is not supported by the VM version.");
|
||||||
|
else
|
||||||
|
CHECK_SUCCESS_NO_WARNINGS(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(assembly_staticcall)
|
BOOST_AUTO_TEST_CASE(assembly_staticcall)
|
||||||
{
|
{
|
||||||
string text = R"(
|
string text = R"(
|
||||||
|
Loading…
Reference in New Issue
Block a user