|
|
@ -22,7 +22,7 @@ |
|
|
|
// @debris disabled as tests fail with:
|
|
|
|
// unknown location(0): fatal error in "jsonrpc_setMining": std::exception: Exception -32003 : Client connector error: : libcurl error: 28
|
|
|
|
// /home/gav/Eth/cpp-ethereum/test/jsonrpc.cpp(169): last checkpoint
|
|
|
|
#if ETH_JSONRPC && 0 |
|
|
|
#if ETH_JSONRPC && 1 |
|
|
|
|
|
|
|
#include <boost/test/unit_test.hpp> |
|
|
|
#include <boost/lexical_cast.hpp> |
|
|
@ -74,6 +74,13 @@ struct Setup |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
string fromAscii(string _s) |
|
|
|
{ |
|
|
|
bytes b = asBytes(_s); |
|
|
|
b.resize(max<unsigned>(b.size(), 32)); |
|
|
|
return "0x" + toHex(b); |
|
|
|
} |
|
|
|
|
|
|
|
BOOST_FIXTURE_TEST_SUITE(environment, Setup) |
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(jsonrpc_defaultBlock) |
|
|
@ -312,6 +319,18 @@ BOOST_AUTO_TEST_CASE(contract_storage) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(sha3) |
|
|
|
{ |
|
|
|
cnote << "Testing jsonrpc sha3..."; |
|
|
|
string testString = "multiply(uint256)"; |
|
|
|
h256 expected = dev::sha3(testString); |
|
|
|
|
|
|
|
auto hexValue = fromAscii(testString); |
|
|
|
string result = jsonrpcClient->web3_sha3(hexValue); |
|
|
|
BOOST_CHECK_EQUAL(toJS(expected), result); |
|
|
|
BOOST_CHECK_EQUAL("0xc6888fa159d67f77c2f3d7a402e199802766bd7e8d4d1ecd2274fc920265d56a", result); |
|
|
|
} |
|
|
|
|
|
|
|
BOOST_AUTO_TEST_SUITE_END() |
|
|
|
BOOST_AUTO_TEST_SUITE_END() |
|
|
|
|
|
|
|