From 00b15d53b945494723df667fc37b32db9ae52673 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Thu, 5 Jan 2017 14:14:17 +0100 Subject: Add a failing test about the gas cost of BALANCE --- test/libsolidity/GasMeter.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test') diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 3f06cb85..aa36e891 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -265,6 +265,19 @@ BOOST_AUTO_TEST_CASE(exponent_size) testRunTimeGas("g(uint256)", vector{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{encodeArgs(2), encodeArgs(100)}); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit