Browse Source

shh_changed -> shh_getFilterChanges

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
2f70a38502
  1. 2
      libweb3jsonrpc/WebThreeStubServerBase.cpp
  2. 3
      libweb3jsonrpc/WebThreeStubServerBase.h
  3. 8
      libweb3jsonrpc/abstractwebthreestubserver.h
  4. 2
      libweb3jsonrpc/spec.json
  5. 4
      test/webthreestubclient.h

2
libweb3jsonrpc/WebThreeStubServerBase.cpp

@ -1037,7 +1037,7 @@ bool WebThreeStubServerBase::shh_uninstallFilter(string const& _filterId)
return true;
}
Json::Value WebThreeStubServerBase::shh_changed(string const& _filterId)
Json::Value WebThreeStubServerBase::shh_getFilterChanges(string const& _filterId)
{
int id;

3
libweb3jsonrpc/WebThreeStubServerBase.h

@ -122,8 +122,7 @@ public:
virtual std::string shh_addToGroup(std::string const& _group, std::string const& _who);
virtual std::string shh_newFilter(Json::Value const& _json);
virtual bool shh_uninstallFilter(std::string const& _filterId);
virtual Json::Value shh_changed(std::string const& _filterId);
virtual Json::Value shh_getFilterChanges(std::string const& _filterId);
virtual Json::Value shh_getMessages(std::string const& _filterId);
void setAccounts(std::vector<dev::KeyPair> const& _accounts);

8
libweb3jsonrpc/abstractwebthreestubserver.h

@ -63,7 +63,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
this->bindAndAddMethod(jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_addToGroupI);
this->bindAndAddMethod(jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_newFilterI);
this->bindAndAddMethod(jsonrpc::Procedure("shh_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_uninstallFilterI);
this->bindAndAddMethod(jsonrpc::Procedure("shh_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_changedI);
this->bindAndAddMethod(jsonrpc::Procedure("shh_getFilterChanges", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_getFilterChangesI);
this->bindAndAddMethod(jsonrpc::Procedure("shh_getMessages", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_getMessagesI);
}
@ -282,9 +282,9 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
{
response = this->shh_uninstallFilter(request[0u].asString());
}
inline virtual void shh_changedI(const Json::Value &request, Json::Value &response)
inline virtual void shh_getFilterChangesI(const Json::Value &request, Json::Value &response)
{
response = this->shh_changed(request[0u].asString());
response = this->shh_getFilterChanges(request[0u].asString());
}
inline virtual void shh_getMessagesI(const Json::Value &request, Json::Value &response)
{
@ -341,7 +341,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0;
virtual std::string shh_newFilter(const Json::Value& param1) = 0;
virtual bool shh_uninstallFilter(const std::string& param1) = 0;
virtual Json::Value shh_changed(const std::string& param1) = 0;
virtual Json::Value shh_getFilterChanges(const std::string& param1) = 0;
virtual Json::Value shh_getMessages(const std::string& param1) = 0;
};

2
libweb3jsonrpc/spec.json

@ -54,7 +54,7 @@
{ "name": "shh_addToGroup", "params": ["", ""], "order": [], "returns": ""},
{ "name": "shh_newFilter", "params": [{}], "order": [], "returns": ""},
{ "name": "shh_uninstallFilter", "params": [""], "order": [], "returns": true},
{ "name": "shh_changed", "params": [""], "order": [], "returns": []},
{ "name": "shh_getFilterChanges", "params": [""], "order": [], "returns": []},
{ "name": "shh_getMessages", "params": [""], "order": [], "returns": []}
]

4
test/webthreestubclient.h

@ -539,11 +539,11 @@ class WebThreeStubClient : public jsonrpc::Client
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
Json::Value shh_changed(const std::string& param1) throw (jsonrpc::JsonRpcException)
Json::Value shh_getFilterChanges(const std::string& param1) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
Json::Value result = this->CallMethod("shh_changed",p);
Json::Value result = this->CallMethod("shh_getFilterChanges",p);
if (result.isArray())
return result;
else

Loading…
Cancel
Save