From 7da9ba68e9540314c6b51c119a14f3afde02a385 Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Thu, 5 Jan 2017 14:20:22 +0100 Subject: test: add a test case about the gas cost of EXTCODESIZE --- test/libsolidity/GasMeter.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/libsolidity') 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{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{encodeArgs()}); +} + BOOST_AUTO_TEST_SUITE_END() } -- cgit