Farm.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY!
  3. */
  4. #ifndef JSONRPC_CPP_STUB_FARM_H_
  5. #define JSONRPC_CPP_STUB_FARM_H_
  6. #include <jsonrpccpp/client.h>
  7. class Farm : public jsonrpc::Client
  8. {
  9. public:
  10. Farm(jsonrpc::IClientConnector &conn, jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2) : jsonrpc::Client(conn, type) {}
  11. Json::Value eth_getWork()
  12. {
  13. Json::Value p;
  14. p = Json::nullValue;
  15. Json::Value result = this->CallMethod("eth_getWork",p);
  16. if (result.isArray())
  17. return result;
  18. else
  19. throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
  20. }
  21. bool eth_submitWork(const std::string& param1, const std::string& param2, const std::string& param3)
  22. {
  23. Json::Value p;
  24. p.append(param1);
  25. p.append(param2);
  26. p.append(param3);
  27. Json::Value result = this->CallMethod("eth_submitWork",p);
  28. if (result.isBool())
  29. return result.asBool();
  30. else
  31. throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
  32. }
  33. };
  34. #endif //JSONRPC_CPP_STUB_FARM_H_