Gav Wood
10 years ago
21 changed files with 190 additions and 61 deletions
@ -1,39 +0,0 @@ |
|||||
/**
|
|
||||
* This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY! |
|
||||
*/ |
|
||||
|
|
||||
#ifndef JSONRPC_CPP_STUB_FARM_H_ |
|
||||
#define JSONRPC_CPP_STUB_FARM_H_ |
|
||||
|
|
||||
#include <jsonrpccpp/client.h> |
|
||||
|
|
||||
class Farm : public jsonrpc::Client |
|
||||
{ |
|
||||
public: |
|
||||
Farm(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {} |
|
||||
|
|
||||
Json::Value eth_getWork() throw (jsonrpc::JsonRpcException) |
|
||||
{ |
|
||||
Json::Value p; |
|
||||
p = Json::nullValue; |
|
||||
Json::Value result = this->CallMethod("eth_getWork",p); |
|
||||
if (result.isArray()) |
|
||||
return result; |
|
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
} |
|
||||
bool eth_submitWork(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) |
|
||||
{ |
|
||||
Json::Value p; |
|
||||
p.append(param1); |
|
||||
p.append(param2); |
|
||||
p.append(param3); |
|
||||
Json::Value result = this->CallMethod("eth_submitWork",p); |
|
||||
if (result.isBool()) |
|
||||
return result.asBool(); |
|
||||
else |
|
||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
#endif //JSONRPC_CPP_STUB_FARM_H_
|
|
@ -0,0 +1,70 @@ |
|||||
|
/**
|
||||
|
* This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY! |
||||
|
*/ |
||||
|
|
||||
|
#ifndef JSONRPC_CPP_STUB_FARMCLIENT_H_ |
||||
|
#define JSONRPC_CPP_STUB_FARMCLIENT_H_ |
||||
|
|
||||
|
#include <jsonrpccpp/client.h> |
||||
|
|
||||
|
class FarmClient : public jsonrpc::Client |
||||
|
{ |
||||
|
public: |
||||
|
FarmClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {} |
||||
|
|
||||
|
Json::Value eth_getWork() throw (jsonrpc::JsonRpcException) |
||||
|
{ |
||||
|
Json::Value p; |
||||
|
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_getWork",p); |
||||
|
if (result.isArray()) |
||||
|
return result; |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
} |
||||
|
bool eth_submitWork(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) |
||||
|
{ |
||||
|
Json::Value p; |
||||
|
p.append(param1); |
||||
|
p.append(param2); |
||||
|
p.append(param3); |
||||
|
Json::Value result = this->CallMethod("eth_submitWork",p); |
||||
|
if (result.isBool()) |
||||
|
return result.asBool(); |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
} |
||||
|
bool eth_submitHashrate(int param1, const std::string& param2) throw (jsonrpc::JsonRpcException) |
||||
|
{ |
||||
|
Json::Value p; |
||||
|
p.append(param1); |
||||
|
p.append(param2); |
||||
|
Json::Value result = this->CallMethod("eth_submitHashrate",p); |
||||
|
if (result.isBool()) |
||||
|
return result.asBool(); |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
} |
||||
|
Json::Value eth_awaitNewWork() throw (jsonrpc::JsonRpcException) |
||||
|
{ |
||||
|
Json::Value p; |
||||
|
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_awaitNewWork",p); |
||||
|
if (result.isArray()) |
||||
|
return result; |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
} |
||||
|
bool eth_progress() throw (jsonrpc::JsonRpcException) |
||||
|
{ |
||||
|
Json::Value p; |
||||
|
p = Json::nullValue; |
||||
|
Json::Value result = this->CallMethod("eth_progress",p); |
||||
|
if (result.isBool()) |
||||
|
return result.asBool(); |
||||
|
else |
||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
#endif //JSONRPC_CPP_STUB_FARMCLIENT_H_
|
@ -1,6 +1,7 @@ |
|||||
[ |
[ |
||||
{ "name": "eth_getWork", "params": [], "order": [], "returns": []}, |
{ "name": "eth_getWork", "params": [], "order": [], "returns": []}, |
||||
{ "name": "eth_submitWork", "params": ["", "", ""], "order": [], "returns": true} |
{ "name": "eth_submitWork", "params": ["", "", ""], "order": [], "returns": true}, |
||||
|
{ "name": "eth_submitHashrate", "params": [0, ""], "order": [], "returns": true}, |
||||
{ "name": "eth_awaitNewWork", "params": [], "order": [], "returns": []}, |
{ "name": "eth_awaitNewWork", "params": [], "order": [], "returns": []}, |
||||
{ "name": "eth_progress", "params": [], "order": [], "returns": true} |
{ "name": "eth_progress", "params": [], "order": [], "returns": true} |
||||
] |
] |
||||
|
Loading…
Reference in new issue