Browse Source

Renaming getData -> getCode, remove getStorage, fix a bunch of JSONRPC

methods with more expansive error handling.
cl-refactor
Gav Wood 10 years ago
parent
commit
4495de3331
  1. 6
      libjsqrc/CMakeLists.txt
  2. 3
      libjsqrc/ethereumjs/dist/ethereum.js
  3. 1
      libjsqrc/ethereumjs/lib/web3/eth.js
  4. 1
      libweb3jsonrpc/CMakeLists.txt
  5. 79
      libweb3jsonrpc/WebThreeStubServerBase.cpp
  6. 1
      libweb3jsonrpc/WebThreeStubServerBase.h
  7. 10
      libweb3jsonrpc/abstractwebthreestubserver.h
  8. 3
      libweb3jsonrpc/spec.json
  9. 11
      test/webthreestubclient.h

6
libjsqrc/CMakeLists.txt

@ -24,8 +24,6 @@ endif()
install( TARGETS jsqrc RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( TARGETS jsqrc RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
file(GLOB_RECURSE SOLFILES "ethereumjs/lib/solidity/*.js") file(GLOB_RECURSE JSFILES "ethereumjs/lib/*.js")
file(GLOB_RECURSE UTILSFILES "ethereumjs/lib/utils/*.js") add_custom_target(aux_js SOURCES ${JSFILES})
file(GLOB_RECURSE WEB3FILES "ethereumjs/lib/web3/*.js")
add_custom_target(aux_js SOURCES ${SOLFILES} ${UTILSFILES} ${WEB3FILES})

3
libjsqrc/ethereumjs/dist/ethereum.js

@ -1706,7 +1706,6 @@ var uncleCountCall = function (args) {
var methods = [ var methods = [
{ name: 'getBalance', call: 'eth_getBalance', addDefaultblock: 2, { name: 'getBalance', call: 'eth_getBalance', addDefaultblock: 2,
outputFormatter: formatters.convertToBigNumber}, outputFormatter: formatters.convertToBigNumber},
{ name: 'getStorage', call: 'eth_getStorage', addDefaultblock: 2},
{ name: 'getStorageAt', call: 'eth_getStorageAt', addDefaultblock: 3, { name: 'getStorageAt', call: 'eth_getStorageAt', addDefaultblock: 3,
inputFormatter: utils.toHex}, inputFormatter: utils.toHex},
{ name: 'getData', call: 'eth_getData', addDefaultblock: 2}, { name: 'getData', call: 'eth_getData', addDefaultblock: 2},
@ -2831,4 +2830,4 @@ module.exports = web3;
},{"./lib/solidity/abi":1,"./lib/web3":6,"./lib/web3/contract":7,"./lib/web3/httpprovider":13,"./lib/web3/qtsync":16}]},{},["web3"]) },{"./lib/solidity/abi":1,"./lib/web3":6,"./lib/web3/contract":7,"./lib/web3/httpprovider":13,"./lib/web3/qtsync":16}]},{},["web3"])
//# sourceMappingURL=ethereum.js.map //# sourceMappingURL=ethereum.js.map

1
libjsqrc/ethereumjs/lib/web3/eth.js

@ -74,7 +74,6 @@ var uncleCountCall = function (args) {
var methods = [ var methods = [
{ name: 'getBalance', call: 'eth_getBalance', addDefaultblock: 2, { name: 'getBalance', call: 'eth_getBalance', addDefaultblock: 2,
outputFormatter: formatters.convertToBigNumber}, outputFormatter: formatters.convertToBigNumber},
{ name: 'getStorage', call: 'eth_getStorage', addDefaultblock: 2},
{ name: 'getStorageAt', call: 'eth_getStorageAt', addDefaultblock: 3, { name: 'getStorageAt', call: 'eth_getStorageAt', addDefaultblock: 3,
inputFormatter: utils.toHex}, inputFormatter: utils.toHex},
{ name: 'getCode', call: 'eth_getCode', addDefaultblock: 2}, { name: 'getCode', call: 'eth_getCode', addDefaultblock: 2},

1
libweb3jsonrpc/CMakeLists.txt

@ -56,4 +56,5 @@ endif()
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib )
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} )
add_custom_target(aux_json SOURCES "spec.json")

79
libweb3jsonrpc/WebThreeStubServerBase.cpp

@ -295,162 +295,99 @@ string WebThreeStubServerBase::eth_blockNumber()
string WebThreeStubServerBase::eth_getBalance(string const& _address, string const& _blockNumber) string WebThreeStubServerBase::eth_getBalance(string const& _address, string const& _blockNumber)
{ {
Address address;
int number;
try
{
address = jsToAddress(_address);
number = toBlockNumber(_blockNumber);
}
catch (...)
{
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
}
return toJS(client()->balanceAt(address, number));
}
Json::Value WebThreeStubServerBase::eth_getStorage(string const& _address, string const& _blockNumber)
{
Address address;
int number;
try try
{ {
address = jsToAddress(_address); return toJS(client()->balanceAt(jsToAddress(_address), toBlockNumber(_blockNumber)));
number = toBlockNumber(_blockNumber);
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
//TODO: fix this naming !
return toJson(client()->storageAt(address, number));
} }
string WebThreeStubServerBase::eth_getStorageAt(string const& _address, string const& _position, string const& _blockNumber) string WebThreeStubServerBase::eth_getStorageAt(string const& _address, string const& _position, string const& _blockNumber)
{ {
Address address;
u256 position;
int number;
try try
{ {
address = jsToAddress(_address); return toJS(client()->stateAt(jsToAddress(_address), jsToU256(_position), toBlockNumber(_blockNumber)));
position = jsToU256(_position);
number = toBlockNumber(_blockNumber);
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
//TODO: fix this naming !
return toJS(client()->stateAt(address, position, number));
} }
string WebThreeStubServerBase::eth_getTransactionCount(string const& _address, string const& _blockNumber) string WebThreeStubServerBase::eth_getTransactionCount(string const& _address, string const& _blockNumber)
{ {
Address address;
int number;
try try
{ {
address = jsToAddress(_address); return toJS(client()->countAt(jsToAddress(_address), toBlockNumber(_blockNumber)));
number = toBlockNumber(_blockNumber);
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
return toJS(client()->countAt(address, number));
} }
string WebThreeStubServerBase::eth_getBlockTransactionCountByHash(string const& _blockHash) string WebThreeStubServerBase::eth_getBlockTransactionCountByHash(string const& _blockHash)
{ {
h256 hash;
try try
{ {
hash = jsToFixed<32>(_blockHash); return toJS(client()->transactionCount(jsToFixed<32>(_blockHash)));
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
return toJS(client()->transactionCount(hash));
} }
string WebThreeStubServerBase::eth_getBlockTransactionCountByNumber(string const& _blockNumber) string WebThreeStubServerBase::eth_getBlockTransactionCountByNumber(string const& _blockNumber)
{ {
int number;
try try
{ {
number = toBlockNumber(_blockNumber); return toJS(client()->transactionCount(client()->hashFromNumber(toBlockNumber(_blockNumber))));
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
return toJS(client()->transactionCount(client()->hashFromNumber(number)));
} }
string WebThreeStubServerBase::eth_getUncleCountByBlockHash(string const& _blockHash) string WebThreeStubServerBase::eth_getUncleCountByBlockHash(string const& _blockHash)
{ {
h256 hash;
try try
{ {
hash = jsToFixed<32>(_blockHash); return toJS(client()->uncleCount(jsToFixed<32>(_blockHash)));
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
return toJS(client()->uncleCount(hash));
} }
string WebThreeStubServerBase::eth_getUncleCountByBlockNumber(string const& _blockNumber) string WebThreeStubServerBase::eth_getUncleCountByBlockNumber(string const& _blockNumber)
{ {
int number;
try try
{ {
number = toBlockNumber(_blockNumber); return toJS(client()->uncleCount(client()->hashFromNumber(toBlockNumber(_blockNumber))));
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
return toJS(client()->uncleCount(client()->hashFromNumber(number)));
} }
string WebThreeStubServerBase::eth_getCode(string const& _address, string const& _blockNumber) string WebThreeStubServerBase::eth_getCode(string const& _address, string const& _blockNumber)
{ {
Address address;
int number;
try try
{ {
address = jsToAddress(_address); return toJS(client()->codeAt(jsToAddress(_address), toBlockNumber(_blockNumber)));
number = toBlockNumber(_blockNumber);
} }
catch (...) catch (...)
{ {
BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS));
} }
return toJS(client()->codeAt(address, number));
} }
static TransactionSkeleton toTransaction(Json::Value const& _json) static TransactionSkeleton toTransaction(Json::Value const& _json)

1
libweb3jsonrpc/WebThreeStubServerBase.h

@ -80,7 +80,6 @@ public:
virtual Json::Value eth_accounts(); virtual Json::Value eth_accounts();
virtual std::string eth_blockNumber(); virtual std::string eth_blockNumber();
virtual std::string eth_getBalance(std::string const& _address, std::string const& _blockNumber); virtual std::string eth_getBalance(std::string const& _address, std::string const& _blockNumber);
virtual Json::Value eth_getStorage(std::string const& _address, std::string const& _blockNumber);
virtual std::string eth_getStorageAt(std::string const& _address, std::string const& _position, std::string const& _blockNumber); virtual std::string eth_getStorageAt(std::string const& _address, std::string const& _position, std::string const& _blockNumber);
virtual std::string eth_getTransactionCount(std::string const& _address, std::string const& _blockNumber); virtual std::string eth_getTransactionCount(std::string const& _address, std::string const& _blockNumber);
virtual std::string eth_getBlockTransactionCountByHash(std::string const& _blockHash); virtual std::string eth_getBlockTransactionCountByHash(std::string const& _blockHash);

10
libweb3jsonrpc/abstractwebthreestubserver.h

@ -23,14 +23,13 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
this->bindAndAddMethod(jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI); this->bindAndAddMethod(jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_blockNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockNumberI); this->bindAndAddMethod(jsonrpc::Procedure("eth_blockNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockNumberI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBalance", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getBalanceI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getBalance", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getBalanceI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getStorage", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getStorageI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getStorageAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getStorageAtI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getStorageAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getStorageAtI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getTransactionCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getTransactionCountI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getTransactionCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getTransactionCountI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockTransactionCountByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getBlockTransactionCountByHashI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockTransactionCountByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getBlockTransactionCountByHashI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockTransactionCountByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getBlockTransactionCountByNumberI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getBlockTransactionCountByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getBlockTransactionCountByNumberI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getUncleCountByBlockHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getUncleCountByBlockHashI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getUncleCountByBlockHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getUncleCountByBlockHashI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getUncleCountByBlockNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getUncleCountByBlockNumberI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getUncleCountByBlockNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getUncleCountByBlockNumberI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_getCode", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getDataI); this->bindAndAddMethod(jsonrpc::Procedure("eth_getCode", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getCodeI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_sendTransaction", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_sendTransactionI); this->bindAndAddMethod(jsonrpc::Procedure("eth_sendTransaction", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_sendTransactionI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_callI); this->bindAndAddMethod(jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_callI);
this->bindAndAddMethod(jsonrpc::Procedure("eth_flush", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_flushI); this->bindAndAddMethod(jsonrpc::Procedure("eth_flush", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_flushI);
@ -122,10 +121,6 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
{ {
response = this->eth_getBalance(request[0u].asString(), request[1u].asString()); response = this->eth_getBalance(request[0u].asString(), request[1u].asString());
} }
inline virtual void eth_getStorageI(const Json::Value &request, Json::Value &response)
{
response = this->eth_getStorage(request[0u].asString(), request[1u].asString());
}
inline virtual void eth_getStorageAtI(const Json::Value &request, Json::Value &response) inline virtual void eth_getStorageAtI(const Json::Value &request, Json::Value &response)
{ {
response = this->eth_getStorageAt(request[0u].asString(), request[1u].asString(), request[2u].asString()); response = this->eth_getStorageAt(request[0u].asString(), request[1u].asString(), request[2u].asString());
@ -150,7 +145,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
{ {
response = this->eth_getUncleCountByBlockNumber(request[0u].asString()); response = this->eth_getUncleCountByBlockNumber(request[0u].asString());
} }
inline virtual void eth_getDataI(const Json::Value &request, Json::Value &response) inline virtual void eth_getCodeI(const Json::Value &request, Json::Value &response)
{ {
response = this->eth_getCode(request[0u].asString(), request[1u].asString()); response = this->eth_getCode(request[0u].asString(), request[1u].asString());
} }
@ -313,7 +308,6 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThr
virtual Json::Value eth_accounts() = 0; virtual Json::Value eth_accounts() = 0;
virtual std::string eth_blockNumber() = 0; virtual std::string eth_blockNumber() = 0;
virtual std::string eth_getBalance(const std::string& param1, const std::string& param2) = 0; virtual std::string eth_getBalance(const std::string& param1, const std::string& param2) = 0;
virtual Json::Value eth_getStorage(const std::string& param1, const std::string& param2) = 0;
virtual std::string eth_getStorageAt(const std::string& param1, const std::string& param2, const std::string& param3) = 0; virtual std::string eth_getStorageAt(const std::string& param1, const std::string& param2, const std::string& param3) = 0;
virtual std::string eth_getTransactionCount(const std::string& param1, const std::string& param2) = 0; virtual std::string eth_getTransactionCount(const std::string& param1, const std::string& param2) = 0;
virtual std::string eth_getBlockTransactionCountByHash(const std::string& param1) = 0; virtual std::string eth_getBlockTransactionCountByHash(const std::string& param1) = 0;

3
libweb3jsonrpc/spec.json

@ -12,14 +12,13 @@
{ "name": "eth_accounts", "params": [], "order": [], "returns" : [] }, { "name": "eth_accounts", "params": [], "order": [], "returns" : [] },
{ "name": "eth_blockNumber", "params": [], "order": [], "returns" : ""}, { "name": "eth_blockNumber", "params": [], "order": [], "returns" : ""},
{ "name": "eth_getBalance", "params": ["", ""], "order": [], "returns" : ""}, { "name": "eth_getBalance", "params": ["", ""], "order": [], "returns" : ""},
{ "name": "eth_getStorage", "params": ["", ""], "order": [], "returns": {}},
{ "name": "eth_getStorageAt", "params": ["", "", ""], "order": [], "returns": ""}, { "name": "eth_getStorageAt", "params": ["", "", ""], "order": [], "returns": ""},
{ "name": "eth_getTransactionCount", "params": ["", ""], "order": [], "returns" : ""}, { "name": "eth_getTransactionCount", "params": ["", ""], "order": [], "returns" : ""},
{ "name": "eth_getBlockTransactionCountByHash", "params": [""], "order": [], "returns" : ""}, { "name": "eth_getBlockTransactionCountByHash", "params": [""], "order": [], "returns" : ""},
{ "name": "eth_getBlockTransactionCountByNumber", "params": [""], "order": [], "returns" : ""}, { "name": "eth_getBlockTransactionCountByNumber", "params": [""], "order": [], "returns" : ""},
{ "name": "eth_getUncleCountByBlockHash", "params": [""], "order": [], "returns" : ""}, { "name": "eth_getUncleCountByBlockHash", "params": [""], "order": [], "returns" : ""},
{ "name": "eth_getUncleCountByBlockNumber", "params": [""], "order": [], "returns" : ""}, { "name": "eth_getUncleCountByBlockNumber", "params": [""], "order": [], "returns" : ""},
{ "name": "eth_getData", "params": ["", ""], "order": [], "returns": ""}, { "name": "eth_getCode", "params": ["", ""], "order": [], "returns": ""},
{ "name": "eth_sendTransaction", "params": [{}], "order": [], "returns": ""}, { "name": "eth_sendTransaction", "params": [{}], "order": [], "returns": ""},
{ "name": "eth_call", "params": [{}, ""], "order": [], "returns": ""}, { "name": "eth_call", "params": [{}, ""], "order": [], "returns": ""},
{ "name": "eth_flush", "params": [], "order": [], "returns" : true}, { "name": "eth_flush", "params": [], "order": [], "returns" : true},

11
test/webthreestubclient.h

@ -123,17 +123,6 @@ class WebThreeStubClient : public jsonrpc::Client
else else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
} }
Json::Value eth_getStorage(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException)
{
Json::Value p;
p.append(param1);
p.append(param2);
Json::Value result = this->CallMethod("eth_getStorage",p);
if (result.isObject())
return result;
else
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
}
std::string eth_getStorageAt(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) std::string eth_getStorageAt(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException)
{ {
Json::Value p; Json::Value p;

Loading…
Cancel
Save