aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-03-13 20:14:51 +0800
committerchriseth <c@ethdev.com>2015-03-14 00:31:56 +0800
commita6f328a613718601c3507923996813a9e50988d5 (patch)
tree935c8787e9a58d6626d4670cd9d2844afef50e48 /SolidityEndToEndTest.cpp
parent1cd179f0d2cec70afdde843927b68c16027f2b0c (diff)
downloaddexon-solidity-a6f328a613718601c3507923996813a9e50988d5.tar.gz
dexon-solidity-a6f328a613718601c3507923996813a9e50988d5.tar.zst
dexon-solidity-a6f328a613718601c3507923996813a9e50988d5.zip
Fix gas for builtin.
Fixes #1300
Diffstat (limited to 'SolidityEndToEndTest.cpp')
-rw-r--r--SolidityEndToEndTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index 2f965849..07ad3edb 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -1647,6 +1647,21 @@ BOOST_AUTO_TEST_CASE(gas_and_value_basic)
BOOST_REQUIRE(callContractFunction("checkState()", 5) == encodeArgs(false, 20 - 5));
}
+BOOST_AUTO_TEST_CASE(gas_for_builtin)
+{
+ char const* sourceCode = R"(
+ contract Contract {
+ function test(uint g) returns (bytes32 data, bool flag) {
+ data = ripemd160.gas(g)("abc");
+ flag = true;
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("test(uint256)", 500) == bytes());
+ BOOST_CHECK(callContractFunction("test(uint256)", 800) == encodeArgs(u256("0x8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"), true));
+}
+
BOOST_AUTO_TEST_CASE(value_complex)
{
char const* sourceCode = R"(