From 959493c7f7c055e248ecdc762c8ff062be2e59c1 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 20 Oct 2014 10:01:14 +0200 Subject: [PATCH] key, keys -> accounts populated to WebThreeStubServer --- jsonrpc.cpp | 2 +- webthreestubclient.h | 36 ++++++++++++------------------------ 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/jsonrpc.cpp b/jsonrpc.cpp index 72cbc9f02..3656abfb9 100644 --- a/jsonrpc.cpp +++ b/jsonrpc.cpp @@ -60,7 +60,7 @@ struct JsonrpcFixture { web3.setIdealPeerCount(5); web3.ethereum()->setForceMining(true); - jsonrpcServer = auto_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3)); + jsonrpcServer = auto_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3, {})); jsonrpcServer->StartListening(); jsonrpcClient = auto_ptr(new WebThreeStubClient(new jsonrpc::HttpClient("http://localhost:8080"))); diff --git a/webthreestubclient.h b/webthreestubclient.h index 80342b43d..86600a7f6 100644 --- a/webthreestubclient.h +++ b/webthreestubclient.h @@ -19,6 +19,18 @@ class WebThreeStubClient delete this->client; } + Json::Value accounts() throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p = Json::nullValue; + Json::Value result = this->client->CallMethod("accounts",p); + if (result.isArray()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + std::string balanceAt(const std::string& address, const int& block) throw (jsonrpc::JsonRpcException) { Json::Value p; @@ -163,30 +175,6 @@ p["s"] = s; } - std::string key() throw (jsonrpc::JsonRpcException) - { - Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("key",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - - } - - Json::Value keys() throw (jsonrpc::JsonRpcException) - { - Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("keys",p); - if (result.isArray()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - - } - bool killWatch(const int& id) throw (jsonrpc::JsonRpcException) { Json::Value p;