diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-15 03:53:11 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-10-15 03:53:11 +0800 |
commit | f9635e72aa6e16aa8dabf61c619901b65321e2a5 (patch) | |
tree | f8932014b0a5437ba6a6680b1cb584c6b4533bd1 | |
parent | 0a069e51b3cb0430ec7bad57ffe7ad1e95c51428 (diff) | |
download | dexon-solidity-f9635e72aa6e16aa8dabf61c619901b65321e2a5.tar dexon-solidity-f9635e72aa6e16aa8dabf61c619901b65321e2a5.tar.gz dexon-solidity-f9635e72aa6e16aa8dabf61c619901b65321e2a5.tar.bz2 dexon-solidity-f9635e72aa6e16aa8dabf61c619901b65321e2a5.tar.lz dexon-solidity-f9635e72aa6e16aa8dabf61c619901b65321e2a5.tar.xz dexon-solidity-f9635e72aa6e16aa8dabf61c619901b65321e2a5.tar.zst dexon-solidity-f9635e72aa6e16aa8dabf61c619901b65321e2a5.zip |
setCoinbase method
-rw-r--r-- | ethstubclient.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/ethstubclient.h b/ethstubclient.h index 7cf12b61..0ccdce05 100644 --- a/ethstubclient.h +++ b/ethstubclient.h @@ -261,27 +261,40 @@ p["s"] = s; } - Json::Value setListening(const bool& l) throw (jsonrpc::JsonRpcException) + bool setCoinbase(const std::string& address) throw (jsonrpc::JsonRpcException) + { + Json::Value p; + p["address"] = address; + + Json::Value result = this->client->CallMethod("setCoinbase",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); + + } + + bool setListening(const bool& l) throw (jsonrpc::JsonRpcException) { Json::Value p; p["l"] = l; Json::Value result = this->client->CallMethod("setListening",p); - if (result.isArray()) - return result; + if (result.isBool()) + return result.asBool(); else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - Json::Value setMining(const bool& l) throw (jsonrpc::JsonRpcException) + bool setMining(const bool& l) throw (jsonrpc::JsonRpcException) { Json::Value p; p["l"] = l; Json::Value result = this->client->CallMethod("setMining",p); - if (result.isArray()) - return result; + if (result.isBool()) + return result.asBool(); else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); |