diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-01-05 21:14:17 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-04-25 22:14:58 +0800 |
commit | 00b15d53b945494723df667fc37b32db9ae52673 (patch) | |
tree | 1b1284fc769f6f2d14acfc22a20ccea461311ded /test/libsolidity/GasMeter.cpp | |
parent | 8387d0df83b7eceff6f6af2845f34cac71f848f4 (diff) | |
download | dexon-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.cpp | 13 |
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() } |