diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-20 16:01:14 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-20 16:01:14 +0800 |
commit | 959493c7f7c055e248ecdc762c8ff062be2e59c1 (patch) | |
tree | bde79f9a0c1a073dbd344bfe39e703ba3c5bce0d | |
parent | 6adaa743f20cecd556b147c3fa0a6708ea6f0547 (diff) | |
download | dexon-solidity-959493c7f7c055e248ecdc762c8ff062be2e59c1.tar dexon-solidity-959493c7f7c055e248ecdc762c8ff062be2e59c1.tar.gz dexon-solidity-959493c7f7c055e248ecdc762c8ff062be2e59c1.tar.bz2 dexon-solidity-959493c7f7c055e248ecdc762c8ff062be2e59c1.tar.lz dexon-solidity-959493c7f7c055e248ecdc762c8ff062be2e59c1.tar.xz dexon-solidity-959493c7f7c055e248ecdc762c8ff062be2e59c1.tar.zst dexon-solidity-959493c7f7c055e248ecdc762c8ff062be2e59c1.zip |
key, keys -> accounts populated to WebThreeStubServer
-rw-r--r-- | jsonrpc.cpp | 2 | ||||
-rw-r--r-- | webthreestubclient.h | 36 |
2 files changed, 13 insertions, 25 deletions
diff --git a/jsonrpc.cpp b/jsonrpc.cpp index 72cbc9f0..3656abfb 100644 --- a/jsonrpc.cpp +++ b/jsonrpc.cpp @@ -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"))); diff --git a/webthreestubclient.h b/webthreestubclient.h index 80342b43..86600a7f 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; |