Fabcoin Core  0.16.2
P2P Digital Currency
Farm.h
Go to the documentation of this file.
1 
5 #ifndef JSONRPC_CPP_STUB_FARM_H_
6 #define JSONRPC_CPP_STUB_FARM_H_
7 
8 #include <jsonrpccpp/client.h>
9 
10 class Farm : public jsonrpc::Client
11 {
12  public:
13  Farm(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 };
38 
39 #endif //JSONRPC_CPP_STUB_FARM_H_
Config::Value_type Value
This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY!
Definition: Farm.h:10
Json::Value eth_getWork()
Definition: Farm.h:15
Farm(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type=jsonrpc::JSONRPC_CLIENT_V2)
Definition: Farm.h:13
PlatformStyle::TableColorType type
Definition: rpcconsole.cpp:61
bool eth_submitWork(const std::string &param1, const std::string &param2, const std::string &param3)
Definition: Farm.h:25