aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2014-10-16 19:06:24 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2014-10-16 19:06:24 +0800
commitfbe6e656ec975956556f6e063790b9d0c02b9ef9 (patch)
tree8b6589f7e03018fa49061b59f81bfc884ff2a732
parent9cbed5627829413ef86346f418991259784d966f (diff)
downloaddexon-solidity-fbe6e656ec975956556f6e063790b9d0c02b9ef9.tar
dexon-solidity-fbe6e656ec975956556f6e063790b9d0c02b9ef9.tar.gz
dexon-solidity-fbe6e656ec975956556f6e063790b9d0c02b9ef9.tar.bz2
dexon-solidity-fbe6e656ec975956556f6e063790b9d0c02b9ef9.tar.lz
dexon-solidity-fbe6e656ec975956556f6e063790b9d0c02b9ef9.tar.xz
dexon-solidity-fbe6e656ec975956556f6e063790b9d0c02b9ef9.tar.zst
dexon-solidity-fbe6e656ec975956556f6e063790b9d0c02b9ef9.zip
jsonrpc http watch
-rw-r--r--ethstubclient.h32
1 files changed, 29 insertions, 3 deletions
diff --git a/ethstubclient.h b/ethstubclient.h
index a9c46a0b..3989c665 100644
--- a/ethstubclient.h
+++ b/ethstubclient.h
@@ -59,6 +59,19 @@ p["block"] = block;
}
+ bool check(const int& id) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p["id"] = id;
+
+ Json::Value result = this->client->CallMethod("check",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
std::string codeAt(const std::string& address, const int& block) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
@@ -174,6 +187,19 @@ p["s"] = s;
}
+ bool killWatch(const int& id) throw (jsonrpc::JsonRpcException)
+ {
+ Json::Value p;
+ p["id"] = id;
+
+ Json::Value result = this->client->CallMethod("killWatch",p);
+ if (result.isBool())
+ return result.asBool();
+ else
+ throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
+
+ }
+
bool listening() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
@@ -408,14 +434,14 @@ p["params"] = params;
}
- std::string watch(const std::string& params) throw (jsonrpc::JsonRpcException)
+ int watch(const std::string& params) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p["params"] = params;
Json::Value result = this->client->CallMethod("watch",p);
- if (result.isString())
- return result.asString();
+ if (result.isInt())
+ return result.asInt();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());