From 8ccc59343cdd5490bf981cb73209c2af77309f6a Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 14 Oct 2014 22:01:07 +0200 Subject: [PATCH] listening and mining param names --- libethrpc/EthStubServer.cpp | 6 +++--- libethrpc/EthStubServer.h | 4 ++-- libethrpc/abstractethstubserver.h | 12 ++++++------ libethrpc/spec.json | 4 ++-- test/ethstubclient.h | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libethrpc/EthStubServer.cpp b/libethrpc/EthStubServer.cpp index f2f83ddb0..14f744e76 100644 --- a/libethrpc/EthStubServer.cpp +++ b/libethrpc/EthStubServer.cpp @@ -319,7 +319,7 @@ bool EthStubServer::setCoinbase(const std::string &address) return true; } -bool EthStubServer::setListening(const bool &l) +bool EthStubServer::setListening(const bool &listening) { if (!client()) return Json::nullValue; @@ -331,12 +331,12 @@ bool EthStubServer::setListening(const bool &l) return false; } -bool EthStubServer::setMining(const bool &l) +bool EthStubServer::setMining(const bool &mining) { if (!client()) return Json::nullValue; - if (l) + if (mining) client()->startMining(); else client()->stopMining(); diff --git a/libethrpc/EthStubServer.h b/libethrpc/EthStubServer.h index d1ba16ada..302fb527c 100644 --- a/libethrpc/EthStubServer.h +++ b/libethrpc/EthStubServer.h @@ -56,8 +56,8 @@ public: virtual int peerCount(); virtual std::string secretToAddress(const std::string& s); virtual bool setCoinbase(const std::string& address); - virtual bool setListening(const bool& l); - virtual bool setMining(const bool& l); + virtual bool setListening(const bool& listening); + virtual bool setMining(const bool& mining); virtual std::string sha3(const std::string& s); virtual std::string stateAt(const std::string& a, const int& block, const std::string& s); virtual std::string toAscii(const std::string& s); diff --git a/libethrpc/abstractethstubserver.h b/libethrpc/abstractethstubserver.h index 02234e393..def5ca55d 100644 --- a/libethrpc/abstractethstubserver.h +++ b/libethrpc/abstractethstubserver.h @@ -33,8 +33,8 @@ class AbstractEthStubServer : public jsonrpc::AbstractServerbindAndAddMethod(new jsonrpc::Procedure("peerCount", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_INTEGER, NULL), &AbstractEthStubServer::peerCountI); this->bindAndAddMethod(new jsonrpc::Procedure("secretToAddress", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::secretToAddressI); this->bindAndAddMethod(new jsonrpc::Procedure("setCoinbase", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "address",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::setCoinbaseI); - this->bindAndAddMethod(new jsonrpc::Procedure("setListening", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "l",jsonrpc::JSON_BOOLEAN, NULL), &AbstractEthStubServer::setListeningI); - this->bindAndAddMethod(new jsonrpc::Procedure("setMining", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "l",jsonrpc::JSON_BOOLEAN, NULL), &AbstractEthStubServer::setMiningI); + this->bindAndAddMethod(new jsonrpc::Procedure("setListening", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "listening",jsonrpc::JSON_BOOLEAN, NULL), &AbstractEthStubServer::setListeningI); + this->bindAndAddMethod(new jsonrpc::Procedure("setMining", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_BOOLEAN, "mining",jsonrpc::JSON_BOOLEAN, NULL), &AbstractEthStubServer::setMiningI); this->bindAndAddMethod(new jsonrpc::Procedure("sha3", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::sha3I); this->bindAndAddMethod(new jsonrpc::Procedure("stateAt", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "a",jsonrpc::JSON_STRING,"block",jsonrpc::JSON_INTEGER,"s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::stateAtI); this->bindAndAddMethod(new jsonrpc::Procedure("toAscii", jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, "s",jsonrpc::JSON_STRING, NULL), &AbstractEthStubServer::toAsciiI); @@ -149,12 +149,12 @@ class AbstractEthStubServer : public jsonrpc::AbstractServersetListening(request["l"].asBool()); + response = this->setListening(request["listening"].asBool()); } inline virtual void setMiningI(const Json::Value& request, Json::Value& response) { - response = this->setMining(request["l"].asBool()); + response = this->setMining(request["mining"].asBool()); } inline virtual void sha3I(const Json::Value& request, Json::Value& response) @@ -223,8 +223,8 @@ class AbstractEthStubServer : public jsonrpc::AbstractServerclient->CallMethod("setListening",p); if (result.isBool()) @@ -287,10 +287,10 @@ p["s"] = s; } - bool setMining(const bool& l) throw (jsonrpc::JsonRpcException) + bool setMining(const bool& mining) throw (jsonrpc::JsonRpcException) { Json::Value p; - p["l"] = l; + p["mining"] = mining; Json::Value result = this->client->CallMethod("setMining",p); if (result.isBool())