|
|
@ -77,11 +77,11 @@ bool WebThreeStubServer::eth_notePassword(string const& _password) |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
#define ADMIN requires(_session, Privilege::Admin) |
|
|
|
#define ADMIN_GUARD requires(_session, Privilege::Admin) |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_blockQueueStatus(string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
Json::Value ret; |
|
|
|
BlockQueueStatus bqs = m_web3.ethereum()->blockQueue().status(); |
|
|
|
ret["importing"] = (int)bqs.importing; |
|
|
@ -96,14 +96,14 @@ Json::Value WebThreeStubServer::admin_eth_blockQueueStatus(string const& _sessio |
|
|
|
|
|
|
|
bool WebThreeStubServer::admin_eth_setAskPrice(std::string const& _wei, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
m_gp.setAsk(jsToU256(_wei)); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
bool WebThreeStubServer::admin_eth_setBidPrice(std::string const& _wei, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
m_gp.setBid(jsToU256(_wei)); |
|
|
|
return true; |
|
|
|
} |
|
|
@ -120,7 +120,7 @@ dev::eth::BlockQueue const& WebThreeStubServer::bq() const |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_findBlock(std::string const& _blockHash, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
h256 h(_blockHash); |
|
|
|
if (bc().isKnown(h)) |
|
|
|
return toJson(bc().info(h)); |
|
|
@ -141,20 +141,20 @@ Json::Value WebThreeStubServer::admin_eth_findBlock(std::string const& _blockHas |
|
|
|
|
|
|
|
std::string WebThreeStubServer::admin_eth_blockQueueFirstUnknown(std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
return bq().firstUnknown().hex(); |
|
|
|
} |
|
|
|
|
|
|
|
bool WebThreeStubServer::admin_eth_blockQueueRetryUnknown(std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
m_web3.ethereum()->retryUnknown(); |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_allAccounts(std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
Json::Value ret; |
|
|
|
u256 total = 0; |
|
|
|
u256 pendingtotal = 0; |
|
|
@ -184,7 +184,7 @@ Json::Value WebThreeStubServer::admin_eth_allAccounts(std::string const& _sessio |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_newAccount(Json::Value const& _info, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
if (!_info.isMember("name")) |
|
|
|
throw jsonrpc::JsonRpcException("No member found: name"); |
|
|
|
string name = _info["name"].asString(); |
|
|
@ -206,7 +206,7 @@ Json::Value WebThreeStubServer::admin_eth_newAccount(Json::Value const& _info, s |
|
|
|
|
|
|
|
bool WebThreeStubServer::admin_eth_setMiningBenefactor(std::string const& _uuidOrAddress, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
Address a; |
|
|
|
h128 uuid = fromUUID(_uuidOrAddress); |
|
|
|
if (uuid) |
|
|
@ -222,7 +222,7 @@ bool WebThreeStubServer::admin_eth_setMiningBenefactor(std::string const& _uuidO |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_inspect(std::string const& _address, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
if (!isHash<Address>(_address)) |
|
|
|
throw jsonrpc::JsonRpcException("Invalid address given."); |
|
|
|
|
|
|
@ -251,7 +251,7 @@ h256 WebThreeStubServer::blockHash(std::string const& _blockNumberOrHash) const |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_reprocess(std::string const& _blockNumberOrHash, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
Json::Value ret; |
|
|
|
PopulationStatistics ps; |
|
|
|
m_web3.ethereum()->state(blockHash(_blockNumberOrHash), &ps); |
|
|
@ -263,7 +263,7 @@ Json::Value WebThreeStubServer::admin_eth_reprocess(std::string const& _blockNum |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_vmTrace(std::string const& _blockNumberOrHash, int _txIndex, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
|
|
|
|
Json::Value ret; |
|
|
|
|
|
|
@ -299,7 +299,7 @@ Json::Value WebThreeStubServer::admin_eth_vmTrace(std::string const& _blockNumbe |
|
|
|
|
|
|
|
Json::Value WebThreeStubServer::admin_eth_getReceiptByHashAndIndex(std::string const& _blockNumberOrHash, int _txIndex, std::string const& _session) |
|
|
|
{ |
|
|
|
ADMIN; |
|
|
|
ADMIN_GUARD; |
|
|
|
if (_txIndex < 0) |
|
|
|
throw jsonrpc::JsonRpcException("Negative index"); |
|
|
|
auto h = blockHash(_blockNumberOrHash); |
|
|
|