Fabcoin Core  0.16.2
P2P Digital Currency
FarmClient.h
Go to the documentation of this file.
1 
5 #ifndef JSONRPC_CPP_STUB_FARMCLIENT_H_
6 #define JSONRPC_CPP_STUB_FARMCLIENT_H_
7 
8 #include <jsonrpccpp/client.h>
9 
10 class FarmClient : public jsonrpc::Client
11 {
12  public:
13  FarmClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {}
14 
15  Json::Value eth_getWork() throw (jsonrpc::JsonRpcException)
16  {
17  Json::Value p;
18  p = Json::nullValue;
19  Json::Value result = this->CallMethod("eth_getWork",p);
20  if (result.isArray())
21  return result;
22  else
23  throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
24  }
25  bool eth_submitWork(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
26  {
27  Json::Value p;
28  p.append(param1);
29  p.append(param2);
30  p.append(param3);
31  Json::Value result = this->CallMethod("eth_submitWork",p);
32  if (result.isBool())
33  return result.asBool();
34  else
35  throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
36  }
37  bool eth_submitHashrate(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
38  {
39  Json::Value p;
40  p.append(param1);
41  p.append(param2);
42  Json::Value result = this->CallMethod("eth_submitHashrate",p);
43  if (result.isBool())
44  return result.asBool();
45  else
46  throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
47  }
48  Json::Value eth_awaitNewWork() throw (jsonrpc::JsonRpcException)
49  {
50  Json::Value p;
51  p = Json::nullValue;
52  Json::Value result = this->CallMethod("eth_awaitNewWork",p);
53  if (result.isArray())
54  return result;
55  else
56  throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
57  }
58  bool eth_progress() throw (jsonrpc::JsonRpcException)
59  {
60  Json::Value p;
61  p = Json::nullValue;
62  Json::Value result = this->CallMethod("eth_progress",p);
63  if (result.isBool())
64  return result.asBool();
65  else
66  throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
67  }
68 };
69 
70 #endif //JSONRPC_CPP_STUB_FARMCLIENT_H_
bool eth_progress()
Definition: FarmClient.h:58
bool eth_submitWork(const std::string &param1, const std::string &param2, const std::string &param3)
Definition: FarmClient.h:25
Json::Value eth_awaitNewWork()
Definition: FarmClient.h:48
FarmClient(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type=jsonrpc::JSONRPC_CLIENT_V2)
Definition: FarmClient.h:13
Json::Value eth_getWork()
Definition: FarmClient.h:15
Config::Value_type Value
bool eth_submitHashrate(const std::string &param1, const std::string &param2)
Definition: FarmClient.h:37
PlatformStyle::TableColorType type
Definition: rpcconsole.cpp:61
This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY!
Definition: FarmClient.h:10