diff options
author | subtly <subtly@users.noreply.github.com> | 2015-02-10 06:20:59 +0800 |
---|---|---|
committer | subtly <subtly@users.noreply.github.com> | 2015-02-10 06:20:59 +0800 |
commit | 412ce7e5e948dc6602fc13037e9910e0f8a92234 (patch) | |
tree | 750c2e0c103f2249fc896eb768eb6a012566a6c7 | |
parent | 2aee02cb4b68cdb39266f1130ea20f0ba4e3ef42 (diff) | |
parent | fe515b467a27ad695c0ce26ef785b86776259998 (diff) | |
download | dexon-solidity-412ce7e5e948dc6602fc13037e9910e0f8a92234.tar.gz dexon-solidity-412ce7e5e948dc6602fc13037e9910e0f8a92234.tar.zst dexon-solidity-412ce7e5e948dc6602fc13037e9910e0f8a92234.zip |
Merge branch 'develop' into p2p
-rw-r--r-- | CMakeLists.txt | 7 | ||||
-rw-r--r-- | natspec.cpp | 4 | ||||
-rw-r--r-- | webthreestubclient.h | 36 |
3 files changed, 41 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 36876eea..ab8afcd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,10 @@ target_link_libraries(testeth ethereum) target_link_libraries(testeth ethcore) target_link_libraries(testeth secp256k1) target_link_libraries(testeth solidity) -target_link_libraries(testeth webthree) -target_link_libraries(testeth natspec) - +if (NOT HEADLESS) + target_link_libraries(testeth webthree) + target_link_libraries(testeth natspec) +endif() if (JSONRPC) target_link_libraries(testeth web3jsonrpc) target_link_libraries(testeth ${JSON_RPC_CPP_CLIENT_LIBRARIES}) diff --git a/natspec.cpp b/natspec.cpp index 827f9662..8ba66041 100644 --- a/natspec.cpp +++ b/natspec.cpp @@ -19,6 +19,8 @@ * @date 2015 */ +#if !ETH_HEADLESS + #include <boost/test/unit_test.hpp> #include <libdevcore/Log.h> #include <libnatspec/NatspecExpressionEvaluator.h> @@ -110,3 +112,5 @@ BOOST_AUTO_TEST_CASE(natspec_js_eval_error) } BOOST_AUTO_TEST_SUITE_END() + +#endif diff --git a/webthreestubclient.h b/webthreestubclient.h index 6a82263d..1836f650 100644 --- a/webthreestubclient.h +++ b/webthreestubclient.h @@ -213,6 +213,16 @@ class WebThreeStubClient : public jsonrpc::Client else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } + bool eth_flush() throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_flush",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + } Json::Value eth_blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -347,13 +357,13 @@ class WebThreeStubClient : public jsonrpc::Client else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - bool eth_changed(const int& param1) throw (jsonrpc::JsonRpcException) + Json::Value eth_changed(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); Json::Value result = this->CallMethod("eth_changed",p); - if (result.isBool()) - return result.asBool(); + if (result.isArray()) + return result; else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } @@ -377,6 +387,26 @@ class WebThreeStubClient : public jsonrpc::Client else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } + Json::Value eth_getWork() throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_getWork",p); + if (result.isArray()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + } + bool eth_submitWork(const std::string& param1) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p.append(param1); + Json::Value result = this->CallMethod("eth_submitWork",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + } bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) { Json::Value p; |