Browse Source

Modify code to prepare for rebase

cl-refactor
Lefteris Karapetsas 10 years ago
parent
commit
6033cebc59
  1. 4
      libjsqrc/admin.js
  2. 8
      libweb3jsonrpc/WebThreeStubServer.cpp
  3. 1
      libweb3jsonrpc/WebThreeStubServer.h
  4. 1
      libweb3jsonrpc/WebThreeStubServerBase.h
  5. 8
      libweb3jsonrpc/abstractwebthreestubserver.h
  6. 2
      libweb3jsonrpc/spec.json
  7. 6
      test/libweb3jsonrpc/webthreestubclient.h

4
libjsqrc/admin.js

@ -36,8 +36,8 @@ web3._extend({
inputFormatter: [getSessionKey], inputFormatter: [getSessionKey],
params: 1 params: 1
}), new web3._extend.Method({ }), new web3._extend.Method({
name: 'eth.nodeInfo', name: 'net.nodeInfo',
call: 'admin_eth_nodeInfo', call: 'admin_net_nodeInfo',
inputFormatter: [getSessionKey], inputFormatter: [getSessionKey],
params: 1 params: 1
}), new web3._extend.Method({ }), new web3._extend.Method({

8
libweb3jsonrpc/WebThreeStubServer.cpp

@ -94,14 +94,6 @@ Json::Value WebThreeStubServer::admin_eth_blockQueueStatus(string const& _sessio
return ret; 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) bool WebThreeStubServer::admin_eth_setAskPrice(std::string const& _wei, std::string const& _session)
{ {
ADMIN_GUARD; ADMIN_GUARD;

1
libweb3jsonrpc/WebThreeStubServer.h

@ -71,7 +71,6 @@ private:
virtual bool eth_notePassword(std::string const& _password) override; 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_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_setAskPrice(std::string const& _wei, std::string const& _session) override;
virtual bool admin_eth_setBidPrice(std::string const& _wei, std::string const& _session) override; virtual bool admin_eth_setBidPrice(std::string const& _wei, std::string const& _session) override;

1
libweb3jsonrpc/WebThreeStubServerBase.h

@ -169,7 +169,6 @@ public:
virtual bool admin_eth_setMining(bool _on, std::string const& _session); 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_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_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 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(); } virtual Json::Value admin_eth_findBlock(std::string const& _blockHash, std::string const& _session) { (void)_blockHash; (void)_session; return Json::Value(); }

8
libweb3jsonrpc/abstractwebthreestubserver.h

@ -84,7 +84,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
this->bindAndAddMethod(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_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_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_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_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_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); 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::AbstractServer<AbstractWebThr
{ {
response = this->admin_eth_blockQueueStatus(request[0u].asString()); response = this->admin_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) inline virtual void admin_eth_setAskPriceI(const Json::Value &request, Json::Value &response)
{ {
@ -548,7 +548,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
virtual bool admin_net_connect(const std::string& param1, const std::string& param2) = 0; virtual bool admin_net_connect(const std::string& param1, const std::string& param2) = 0;
virtual Json::Value admin_net_peers(const std::string& param1) = 0; virtual Json::Value admin_net_peers(const std::string& param1) = 0;
virtual Json::Value admin_eth_blockQueueStatus(const std::string& param1) = 0; virtual Json::Value admin_eth_blockQueueStatus(const std::string& param1) = 0;
virtual Json::Value admin_eth_nodeInfo(const std::string& param1) = 0; virtual Json::Value admin_net_nodeInfo(const std::string& param1) = 0;
virtual bool admin_eth_setAskPrice(const std::string& param1, const std::string& param2) = 0; virtual bool admin_eth_setAskPrice(const std::string& param1, const std::string& param2) = 0;
virtual bool admin_eth_setBidPrice(const std::string& param1, const std::string& param2) = 0; virtual bool admin_eth_setBidPrice(const std::string& param1, const std::string& param2) = 0;
virtual bool admin_eth_setReferencePrice(const std::string& param1, const std::string& param2) = 0; virtual bool admin_eth_setReferencePrice(const std::string& param1, const std::string& param2) = 0;

2
libweb3jsonrpc/spec.json

@ -76,7 +76,7 @@
{ "name": "admin_net_connect", "params": ["", ""], "returns": true }, { "name": "admin_net_connect", "params": ["", ""], "returns": true },
{ "name": "admin_net_peers", "params": [""], "returns": [] }, { "name": "admin_net_peers", "params": [""], "returns": [] },
{ "name": "admin_eth_blockQueueStatus", "params": [""], "returns": {}}, { "name": "admin_eth_blockQueueStatus", "params": [""], "returns": {}},
{ "name": "admin_eth_nodeInfo", "params": [""], "returns": {}}, { "name": "admin_net_nodeInfo", "params": [""], "returns": {}},
{ "name": "admin_eth_setAskPrice", "params": ["", ""], "returns": true }, { "name": "admin_eth_setAskPrice", "params": ["", ""], "returns": true },
{ "name": "admin_eth_setBidPrice", "params": ["", ""], "returns": true }, { "name": "admin_eth_setBidPrice", "params": ["", ""], "returns": true },
{ "name": "admin_eth_setReferencePrice", "params": ["", ""], "returns": true }, { "name": "admin_eth_setReferencePrice", "params": ["", ""], "returns": true },

6
test/libweb3jsonrpc/webthreestubclient.h

@ -747,17 +747,17 @@ class WebThreeStubClient : public jsonrpc::Client
{ {
Json::Value p; Json::Value p;
p.append(param1); p.append(param1);
Json::Value result = this->CallMethod("admin_eth_blockQueueStatus",p); Json::Value result = this->CallMethod("admin_eth_blockQueueStatus", p);
if (result.isObject()) if (result.isObject())
return result; return result;
else else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); 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; Json::Value p;
p.append(param1); p.append(param1);
Json::Value result = this->CallMethod("admin_eth_nodeInfo",p); Json::Value result = this->CallMethod("admin_net_nodeInfo",p);
if (result.isObject()) if (result.isObject())
return result; return result;
else else

Loading…
Cancel
Save