From 0a069e51b3cb0430ec7bad57ffe7ad1e95c51428 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 14 Oct 2014 17:24:51 +0200 Subject: isMining changes to mining --- ethstubclient.h | 48 ++++++++++++++++++++++++------------------------ jsonrpc.cpp | 4 ++-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ethstubclient.h b/ethstubclient.h index ce9e0a9a..7cf12b61 100644 --- a/ethstubclient.h +++ b/ethstubclient.h @@ -150,30 +150,6 @@ p["s"] = s; } - bool isListening() throw (jsonrpc::JsonRpcException) - { - Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("isListening",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - - } - - bool isMining() throw (jsonrpc::JsonRpcException) - { - Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("isMining",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - - } - std::string key() throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -198,6 +174,18 @@ p["s"] = s; } + bool listening() throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p = Json::nullValue; + Json::Value result = this->client->CallMethod("listening",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + std::string lll(const std::string& s) throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -224,6 +212,18 @@ p["s"] = s; } + bool mining() throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p = Json::nullValue; + Json::Value result = this->client->CallMethod("mining",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + int number() throw (jsonrpc::JsonRpcException) { Json::Value p; diff --git a/jsonrpc.cpp b/jsonrpc.cpp index 1e262d5c..930b5686 100644 --- a/jsonrpc.cpp +++ b/jsonrpc.cpp @@ -129,11 +129,11 @@ BOOST_AUTO_TEST_CASE(jsonrpc_isMining) cnote << "Testing jsonrpc isMining..."; web3.ethereum()->startMining(); - bool miningOn = jsonrpcClient->isMining(); + bool miningOn = jsonrpcClient->mining(); BOOST_CHECK_EQUAL(miningOn, web3.ethereum()->isMining()); web3.ethereum()->stopMining(); - bool miningOff = jsonrpcClient->isMining(); + bool miningOff = jsonrpcClient->mining(); BOOST_CHECK_EQUAL(miningOff, web3.ethereum()->isMining()); } -- cgit