From 6033cebc59319db27ffad9806e46089c8e1e4597 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 29 Jul 2015 18:33:04 +0200 Subject: [PATCH] Modify code to prepare for rebase --- libjsqrc/admin.js | 4 ++-- libweb3jsonrpc/WebThreeStubServer.cpp | 8 -------- libweb3jsonrpc/WebThreeStubServer.h | 1 - libweb3jsonrpc/WebThreeStubServerBase.h | 1 - libweb3jsonrpc/abstractwebthreestubserver.h | 8 ++++---- libweb3jsonrpc/spec.json | 2 +- test/libweb3jsonrpc/webthreestubclient.h | 6 +++--- 7 files changed, 10 insertions(+), 20 deletions(-) diff --git a/libjsqrc/admin.js b/libjsqrc/admin.js index 403f61dd3..61a13af14 100644 --- a/libjsqrc/admin.js +++ b/libjsqrc/admin.js @@ -36,8 +36,8 @@ web3._extend({ inputFormatter: [getSessionKey], params: 1 }), new web3._extend.Method({ - name: 'eth.nodeInfo', - call: 'admin_eth_nodeInfo', + name: 'net.nodeInfo', + call: 'admin_net_nodeInfo', inputFormatter: [getSessionKey], params: 1 }), new web3._extend.Method({ diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp index 7ade7eb95..b90c43cf3 100644 --- a/libweb3jsonrpc/WebThreeStubServer.cpp +++ b/libweb3jsonrpc/WebThreeStubServer.cpp @@ -94,14 +94,6 @@ Json::Value WebThreeStubServer::admin_eth_blockQueueStatus(string const& _sessio return ret; } -Json::Value WebThreeStubServer::admin_eth_nodeInfo(string const& _session) -{ - ADMIN_GUARD; - Json::Value ret; - ret["fillmein"] = "please"; - return ret; -} - bool WebThreeStubServer::admin_eth_setAskPrice(std::string const& _wei, std::string const& _session) { ADMIN_GUARD; diff --git a/libweb3jsonrpc/WebThreeStubServer.h b/libweb3jsonrpc/WebThreeStubServer.h index 1d5168ec7..35ea03737 100644 --- a/libweb3jsonrpc/WebThreeStubServer.h +++ b/libweb3jsonrpc/WebThreeStubServer.h @@ -71,7 +71,6 @@ private: virtual bool eth_notePassword(std::string const& _password) override; virtual Json::Value admin_eth_blockQueueStatus(std::string const& _session) override; - virtual Json::Value admin_eth_nodeInfo(std::string const& _session) override; virtual bool admin_eth_setAskPrice(std::string const& _wei, std::string const& _session) override; virtual bool admin_eth_setBidPrice(std::string const& _wei, std::string const& _session) override; diff --git a/libweb3jsonrpc/WebThreeStubServerBase.h b/libweb3jsonrpc/WebThreeStubServerBase.h index 2cddbc545..98eff9b6e 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.h +++ b/libweb3jsonrpc/WebThreeStubServerBase.h @@ -169,7 +169,6 @@ public: virtual bool admin_eth_setMining(bool _on, std::string const& _session); virtual Json::Value admin_eth_blockQueueStatus(std::string const& _session) { (void)_session; return Json::Value(); } - virtual Json::Value admin_eth_nodeInfo(std::string const& _session) { (void)_session; return Json::Value(); } virtual bool admin_eth_setAskPrice(std::string const& _wei, std::string const& _session) { (void)_wei; (void)_session; return false; } virtual bool admin_eth_setBidPrice(std::string const& _wei, std::string const& _session) { (void)_wei; (void)_session; return false; } virtual Json::Value admin_eth_findBlock(std::string const& _blockHash, std::string const& _session) { (void)_blockHash; (void)_session; return Json::Value(); } diff --git a/libweb3jsonrpc/abstractwebthreestubserver.h b/libweb3jsonrpc/abstractwebthreestubserver.h index 23eebe205..be047c08a 100644 --- a/libweb3jsonrpc/abstractwebthreestubserver.h +++ b/libweb3jsonrpc/abstractwebthreestubserver.h @@ -84,7 +84,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerbindAndAddMethod(jsonrpc::Procedure("admin_net_connect", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_net_connectI); this->bindAndAddMethod(jsonrpc::Procedure("admin_net_peers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_net_peersI); this->bindAndAddMethod(jsonrpc::Procedure("admin_eth_blockQueueStatus", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_eth_blockQueueStatusI); - this->bindAndAddMethod(jsonrpc::Procedure("admin_eth_nodeInfo", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_eth_nodeInfoI); + this->bindAndAddMethod(jsonrpc::Procedure("admin_net_nodeInfo", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_net_nodeInfoI); this->bindAndAddMethod(jsonrpc::Procedure("admin_eth_setAskPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_eth_setAskPriceI); this->bindAndAddMethod(jsonrpc::Procedure("admin_eth_setBidPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_eth_setBidPriceI); this->bindAndAddMethod(jsonrpc::Procedure("admin_eth_setReferencePrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::admin_eth_setReferencePriceI); @@ -408,9 +408,9 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServeradmin_eth_blockQueueStatus(request[0u].asString()); } - inline virtual void admin_eth_nodeInfoI(const Json::Value &request, Json::Value &response) + inline virtual void admin_net_nodeInfoI(const Json::Value &request, Json::Value &response) { - response = this->admin_eth_nodeInfo(request[0u].asString()); + response = this->admin_net_nodeInfo(request[0u].asString()); } inline virtual void admin_eth_setAskPriceI(const Json::Value &request, Json::Value &response) { @@ -548,7 +548,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerCallMethod("admin_eth_blockQueueStatus",p); + Json::Value result = this->CallMethod("admin_eth_blockQueueStatus", p); if (result.isObject()) return result; else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - Json::Value admin_eth_nodeInfo(const std::string& param1) throw (jsonrpc::JsonRpcException) + Json::Value admin_net_nodeInfo(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - Json::Value result = this->CallMethod("admin_eth_nodeInfo",p); + Json::Value result = this->CallMethod("admin_net_nodeInfo",p); if (result.isObject()) return result; else