diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2017-01-05 21:20:22 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-04-25 22:14:58 +0800 |
commit | 7da9ba68e9540314c6b51c119a14f3afde02a385 (patch) | |
tree | b3d01876e9d254c5f91972a10620ee91d000654c /test/libsolidity/GasMeter.cpp | |
parent | 259c551c617695928d721ebcfcd132902ff34d3f (diff) | |
download | dexon-solidity-7da9ba68e9540314c6b51c119a14f3afde02a385.tar.gz dexon-solidity-7da9ba68e9540314c6b51c119a14f3afde02a385.tar.zst dexon-solidity-7da9ba68e9540314c6b51c119a14f3afde02a385.zip |
test: add a test case about the gas cost of EXTCODESIZE
Diffstat (limited to 'test/libsolidity/GasMeter.cpp')
-rw-r--r-- | test/libsolidity/GasMeter.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index bc4c25bd..220d27cf 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -291,6 +291,21 @@ BOOST_AUTO_TEST_CASE(selfdestruct_gas) testRunTimeGas("f()", vector<bytes>{encodeArgs()}); } +BOOST_AUTO_TEST_CASE(extcodesize_gas) +{ + char const* sourceCode = R"( + contract A { + function f() returns (uint _s) { + assembly { + _s := extcodesize(0x30) + } + } + } + )"; + testCreationTimeGas(sourceCode); + testRunTimeGas("f()", vector<bytes>{encodeArgs()}); +} + BOOST_AUTO_TEST_SUITE_END() } |