mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
isMining changes to mining
This commit is contained in:
parent
7a65f94db9
commit
0a069e51b3
@ -150,30 +150,6 @@ p["s"] = s;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isListening() throw (jsonrpc::JsonRpcException)
|
|
||||||
{
|
|
||||||
Json::Value p;
|
|
||||||
p = Json::nullValue;
|
|
||||||
Json::Value result = this->client->CallMethod("isListening",p);
|
|
||||||
if (result.isBool())
|
|
||||||
return result.asBool();
|
|
||||||
else
|
|
||||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isMining() throw (jsonrpc::JsonRpcException)
|
|
||||||
{
|
|
||||||
Json::Value p;
|
|
||||||
p = Json::nullValue;
|
|
||||||
Json::Value result = this->client->CallMethod("isMining",p);
|
|
||||||
if (result.isBool())
|
|
||||||
return result.asBool();
|
|
||||||
else
|
|
||||||
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string key() throw (jsonrpc::JsonRpcException)
|
std::string key() throw (jsonrpc::JsonRpcException)
|
||||||
{
|
{
|
||||||
Json::Value p;
|
Json::Value p;
|
||||||
@ -198,6 +174,18 @@ p["s"] = s;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool listening() throw (jsonrpc::JsonRpcException)
|
||||||
|
{
|
||||||
|
Json::Value p;
|
||||||
|
p = Json::nullValue;
|
||||||
|
Json::Value result = this->client->CallMethod("listening",p);
|
||||||
|
if (result.isBool())
|
||||||
|
return result.asBool();
|
||||||
|
else
|
||||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
std::string lll(const std::string& s) throw (jsonrpc::JsonRpcException)
|
std::string lll(const std::string& s) throw (jsonrpc::JsonRpcException)
|
||||||
{
|
{
|
||||||
Json::Value p;
|
Json::Value p;
|
||||||
@ -224,6 +212,18 @@ p["s"] = s;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool mining() throw (jsonrpc::JsonRpcException)
|
||||||
|
{
|
||||||
|
Json::Value p;
|
||||||
|
p = Json::nullValue;
|
||||||
|
Json::Value result = this->client->CallMethod("mining",p);
|
||||||
|
if (result.isBool())
|
||||||
|
return result.asBool();
|
||||||
|
else
|
||||||
|
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
int number() throw (jsonrpc::JsonRpcException)
|
int number() throw (jsonrpc::JsonRpcException)
|
||||||
{
|
{
|
||||||
Json::Value p;
|
Json::Value p;
|
||||||
|
@ -129,11 +129,11 @@ BOOST_AUTO_TEST_CASE(jsonrpc_isMining)
|
|||||||
cnote << "Testing jsonrpc isMining...";
|
cnote << "Testing jsonrpc isMining...";
|
||||||
|
|
||||||
web3.ethereum()->startMining();
|
web3.ethereum()->startMining();
|
||||||
bool miningOn = jsonrpcClient->isMining();
|
bool miningOn = jsonrpcClient->mining();
|
||||||
BOOST_CHECK_EQUAL(miningOn, web3.ethereum()->isMining());
|
BOOST_CHECK_EQUAL(miningOn, web3.ethereum()->isMining());
|
||||||
|
|
||||||
web3.ethereum()->stopMining();
|
web3.ethereum()->stopMining();
|
||||||
bool miningOff = jsonrpcClient->isMining();
|
bool miningOff = jsonrpcClient->mining();
|
||||||
BOOST_CHECK_EQUAL(miningOff, web3.ethereum()->isMining());
|
BOOST_CHECK_EQUAL(miningOff, web3.ethereum()->isMining());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user