Add a failing test about the gas cost of BALANCE

This commit is contained in:
Yoichi Hirai 2017-01-05 14:14:17 +01:00 committed by chriseth
parent 8387d0df83
commit 00b15d53b9

View File

@ -265,6 +265,19 @@ BOOST_AUTO_TEST_CASE(exponent_size)
testRunTimeGas("g(uint256)", vector<bytes>{encodeArgs(2)});
}
BOOST_AUTO_TEST_CASE(balance_gas)
{
char const* sourceCode = R"(
contract A {
function lookup_balance(address a) returns (uint) {
return a.balance;
}
}
)";
testCreationTimeGas(sourceCode);
testRunTimeGas("f(uint256)", vector<bytes>{encodeArgs(2), encodeArgs(100)});
}
BOOST_AUTO_TEST_SUITE_END()
}