aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/GasMeter.cpp
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-01-05 21:14:17 +0800
committerchriseth <chris@ethereum.org>2017-04-25 22:14:58 +0800
commit00b15d53b945494723df667fc37b32db9ae52673 (patch)
tree1b1284fc769f6f2d14acfc22a20ccea461311ded /test/libsolidity/GasMeter.cpp
parent8387d0df83b7eceff6f6af2845f34cac71f848f4 (diff)
downloaddexon-solidity-00b15d53b945494723df667fc37b32db9ae52673.tar.gz
dexon-solidity-00b15d53b945494723df667fc37b32db9ae52673.tar.zst
dexon-solidity-00b15d53b945494723df667fc37b32db9ae52673.zip
Add a failing test about the gas cost of BALANCE
Diffstat (limited to 'test/libsolidity/GasMeter.cpp')
-rw-r--r--test/libsolidity/GasMeter.cpp13
1 files changed, 13 insertions, 0 deletions
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<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()
}