From 2c8e577f4c4066f4348975971afeeb8aeff03807 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 16 Oct 2014 19:03:41 +0200 Subject: [PATCH] EthStubServer renamed to WebThreeStubServer --- jsonrpc.cpp | 20 ++++++++++---------- ethstubclient.h => webthreestubclient.h | 12 ++++++------ 2 files changed, 16 insertions(+), 16 deletions(-) rename ethstubclient.h => webthreestubclient.h (98%) diff --git a/jsonrpc.cpp b/jsonrpc.cpp index be03dbea2..e163014ac 100644 --- a/jsonrpc.cpp +++ b/jsonrpc.cpp @@ -27,29 +27,30 @@ #include #include #include -#include +#include #include #include #include +#include #include "JsonSpiritHeaders.h" #include "TestHelper.h" -#include "ethstubclient.h" +#include "webthreestubclient.h" using namespace std; using namespace dev; using namespace dev::eth; namespace js = json_spirit; - namespace jsonrpc_tests { string name = "Ethereum(++) tests"; string dbPath; -dev::WebThreeDirect web3(name, dbPath, true); - -auto_ptr jsonrpcServer; -auto_ptr jsonrpcClient; +auto s = set{"eth", "shh"}; +dev::p2p::NetworkPreferences np(30303, std::string(), false); +dev::WebThreeDirect web3(name, dbPath, true, s, np); +auto_ptr jsonrpcServer; +auto_ptr jsonrpcClient; struct JsonrpcFixture { JsonrpcFixture() @@ -58,10 +59,10 @@ struct JsonrpcFixture { web3.setIdealPeerCount(5); web3.ethereum()->setForceMining(true); - jsonrpcServer = auto_ptr(new EthStubServer(new jsonrpc::CorsHttpServer(8080), web3)); + jsonrpcServer = auto_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3)); jsonrpcServer->StartListening(); - jsonrpcClient = auto_ptr(new EthStubClient(new jsonrpc::HttpClient("http://localhost:8080"))); + jsonrpcClient = auto_ptr(new WebThreeStubClient(new jsonrpc::HttpClient("http://localhost:8080"))); } ~JsonrpcFixture() { @@ -322,7 +323,6 @@ BOOST_AUTO_TEST_CASE(jsonrpc_transact) BOOST_CHECK_EQUAL(txAmount, jsToU256(messages[0u]["value"].asString())); } - } #endif diff --git a/ethstubclient.h b/webthreestubclient.h similarity index 98% rename from ethstubclient.h rename to webthreestubclient.h index b824444f6..80342b43d 100644 --- a/ethstubclient.h +++ b/webthreestubclient.h @@ -2,19 +2,19 @@ * THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!! */ -#ifndef _ETHSTUBCLIENT_H_ -#define _ETHSTUBCLIENT_H_ +#ifndef _WEBTHREESTUBCLIENT_H_ +#define _WEBTHREESTUBCLIENT_H_ #include -class EthStubClient +class WebThreeStubClient { public: - EthStubClient(jsonrpc::AbstractClientConnector* conn) + WebThreeStubClient(jsonrpc::AbstractClientConnector* conn) { this->client = new jsonrpc::Client(conn); } - ~EthStubClient() + ~WebThreeStubClient() { delete this->client; } @@ -464,4 +464,4 @@ p["params"] = params; private: jsonrpc::Client* client; }; -#endif //_ETHSTUBCLIENT_H_ +#endif //_WEBTHREESTUBCLIENT_H_