mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
EthStubServer renamed to WebThreeStubServer
This commit is contained in:
parent
9fa0453e47
commit
2c8e577f4c
20
jsonrpc.cpp
20
jsonrpc.cpp
@ -27,29 +27,30 @@
|
||||
#include <libdevcore/CommonIO.h>
|
||||
#include <libdevcore/CommonJS.h>
|
||||
#include <libwebthree/WebThree.h>
|
||||
#include <libethrpc/EthStubServer.h>
|
||||
#include <libethrpc/WebThreeStubServer.h>
|
||||
#include <libethrpc/CorsHttpServer.h>
|
||||
#include <jsonrpc/connectors/httpserver.h>
|
||||
#include <jsonrpc/connectors/httpclient.h>
|
||||
#include <set>
|
||||
#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<EthStubServer> jsonrpcServer;
|
||||
auto_ptr<EthStubClient> jsonrpcClient;
|
||||
auto s = set<string>{"eth", "shh"};
|
||||
dev::p2p::NetworkPreferences np(30303, std::string(), false);
|
||||
dev::WebThreeDirect web3(name, dbPath, true, s, np);
|
||||
|
||||
auto_ptr<WebThreeStubServer> jsonrpcServer;
|
||||
auto_ptr<WebThreeStubClient> jsonrpcClient;
|
||||
|
||||
struct JsonrpcFixture {
|
||||
JsonrpcFixture()
|
||||
@ -58,10 +59,10 @@ struct JsonrpcFixture {
|
||||
|
||||
web3.setIdealPeerCount(5);
|
||||
web3.ethereum()->setForceMining(true);
|
||||
jsonrpcServer = auto_ptr<EthStubServer>(new EthStubServer(new jsonrpc::CorsHttpServer(8080), web3));
|
||||
jsonrpcServer = auto_ptr<WebThreeStubServer>(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3));
|
||||
jsonrpcServer->StartListening();
|
||||
|
||||
jsonrpcClient = auto_ptr<EthStubClient>(new EthStubClient(new jsonrpc::HttpClient("http://localhost:8080")));
|
||||
jsonrpcClient = auto_ptr<WebThreeStubClient>(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
|
||||
|
@ -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 <jsonrpc/rpc.h>
|
||||
|
||||
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_
|
Loading…
Reference in New Issue
Block a user