aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliana <liana@ethdev.com>2015-01-27 17:48:10 +0800
committerliana <liana@ethdev.com>2015-01-27 17:48:10 +0800
commitb06de7e8de391c7b9b2070d0bbfa5038271691f2 (patch)
treece42504023f51a12620de1a97de7c49eeb317fc0
parentf5b739da9a7ae3a1dac4532b7616e11a64722cbe (diff)
downloaddexon-solidity-b06de7e8de391c7b9b2070d0bbfa5038271691f2.tar.gz
dexon-solidity-b06de7e8de391c7b9b2070d0bbfa5038271691f2.tar.zst
dexon-solidity-b06de7e8de391c7b9b2070d0bbfa5038271691f2.zip
-added test case for hash8 to string1 conversion
-rw-r--r--SolidityEndToEndTest.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index 1d483963..4f4347bf 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -1015,7 +1015,21 @@ BOOST_AUTO_TEST_CASE(convert_string_to_hash_different_min_size)
})";
compileAndRun(sourceCode);
BOOST_CHECK(callContractFunction("stringToHash(string1)", string("a")) ==
- encodeArgs(u128("0x00000000000000000000000000000061")));
+ encodeArgs(u256("0x61")));
+}
+
+
+BOOST_AUTO_TEST_CASE(convert_hash_to_string_different_min_size)
+{
+ char const* sourceCode = R"(
+ contract Test {
+ function HashToString(hash8 h) returns (string1 s) {
+ return string1(h);
+ }
+ })";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("HashToString(hash8)", u256("0x61")) ==
+ encodeArgs(string("a")));
}
BOOST_AUTO_TEST_CASE(send_ether)