aboutsummaryrefslogtreecommitdiffstats
path: root/webthreestubclient.h
diff options
context:
space:
mode:
Diffstat (limited to 'webthreestubclient.h')
-rw-r--r--webthreestubclient.h76
1 files changed, 13 insertions, 63 deletions
diff --git a/webthreestubclient.h b/webthreestubclient.h
index 70aa9db9..14afd706 100644
--- a/webthreestubclient.h
+++ b/webthreestubclient.h
@@ -22,43 +22,33 @@ class WebThreeStubClient : public jsonrpc::Client
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
- std::string eth_coinbase() throw (jsonrpc::JsonRpcException)
+ std::string net_peerCount() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
- Json::Value result = this->CallMethod("eth_coinbase",p);
+ Json::Value result = this->CallMethod("net_peerCount",p);
if (result.isString())
return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
- bool eth_setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p.append(param1);
- Json::Value result = this->CallMethod("eth_setCoinbase",p);
- if (result.isBool())
- return result.asBool();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- bool eth_listening() throw (jsonrpc::JsonRpcException)
+ bool net_listening() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
- Json::Value result = this->CallMethod("eth_listening",p);
+ Json::Value result = this->CallMethod("net_listening",p);
if (result.isBool())
return result.asBool();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
- bool eth_setListening(bool param1) throw (jsonrpc::JsonRpcException)
+ std::string eth_coinbase() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
- p.append(param1);
- Json::Value result = this->CallMethod("eth_setListening",p);
- if (result.isBool())
- return result.asBool();
+ p = Json::nullValue;
+ Json::Value result = this->CallMethod("eth_coinbase",p);
+ if (result.isString())
+ return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
@@ -72,16 +62,6 @@ class WebThreeStubClient : public jsonrpc::Client
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
- bool eth_setMining(bool param1) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p.append(param1);
- Json::Value result = this->CallMethod("eth_setMining",p);
- if (result.isBool())
- return result.asBool();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
std::string eth_gasPrice() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
@@ -102,43 +82,13 @@ class WebThreeStubClient : public jsonrpc::Client
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
- int eth_peerCount() throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p = Json::nullValue;
- Json::Value result = this->CallMethod("eth_peerCount",p);
- if (result.isInt())
- return result.asInt();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- int eth_defaultBlock() throw (jsonrpc::JsonRpcException)
+ std::string eth_blockNumber() throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p = Json::nullValue;
- Json::Value result = this->CallMethod("eth_defaultBlock",p);
- if (result.isInt())
- return result.asInt();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- bool eth_setDefaultBlock(int param1) throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p.append(param1);
- Json::Value result = this->CallMethod("eth_setDefaultBlock",p);
- if (result.isBool())
- return result.asBool();
- else
- throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
- }
- int eth_number() throw (jsonrpc::JsonRpcException)
- {
- Json::Value p;
- p = Json::nullValue;
- Json::Value result = this->CallMethod("eth_number",p);
- if (result.isInt())
- return result.asInt();
+ Json::Value result = this->CallMethod("eth_blockNumber",p);
+ if (result.isString())
+ return result.asString();
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}