aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-05 07:33:44 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-05 07:33:44 +0800
commit5d20782dea534f7a9502a3fa8ebf2d6071522dcd (patch)
tree44288993c759a600e7297522fc1441917d29a129
parent0c2a7fbe7d2283a2226cf693d94a087ddca56b04 (diff)
downloaddexon-solidity-5d20782dea534f7a9502a3fa8ebf2d6071522dcd.tar
dexon-solidity-5d20782dea534f7a9502a3fa8ebf2d6071522dcd.tar.gz
dexon-solidity-5d20782dea534f7a9502a3fa8ebf2d6071522dcd.tar.bz2
dexon-solidity-5d20782dea534f7a9502a3fa8ebf2d6071522dcd.tar.lz
dexon-solidity-5d20782dea534f7a9502a3fa8ebf2d6071522dcd.tar.xz
dexon-solidity-5d20782dea534f7a9502a3fa8ebf2d6071522dcd.tar.zst
dexon-solidity-5d20782dea534f7a9502a3fa8ebf2d6071522dcd.zip
jsonrpc api changes in progress
-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());
}