mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
key, keys -> accounts populated to WebThreeStubServer
This commit is contained in:
parent
6adaa743f2
commit
959493c7f7
@ -60,7 +60,7 @@ struct JsonrpcFixture {
|
||||
|
||||
web3.setIdealPeerCount(5);
|
||||
web3.ethereum()->setForceMining(true);
|
||||
jsonrpcServer = auto_ptr<WebThreeStubServer>(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3));
|
||||
jsonrpcServer = auto_ptr<WebThreeStubServer>(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), web3, {}));
|
||||
jsonrpcServer->StartListening();
|
||||
|
||||
jsonrpcClient = auto_ptr<WebThreeStubClient>(new WebThreeStubClient(new jsonrpc::HttpClient("http://localhost:8080")));
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user