From a8d84b0d86261b01ef5fc5f6282b68dd6be6d07a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 14 Mar 2015 19:00:41 +0100 Subject: [PATCH] getData -> getCode. --- libjsqrc/CMakeLists.txt | 6 ++++++ libjsqrc/ethereumjs/lib/web3/eth.js | 2 +- libweb3jsonrpc/WebThreeStubServerBase.cpp | 2 +- libweb3jsonrpc/WebThreeStubServerBase.h | 2 +- libweb3jsonrpc/abstractwebthreestubserver.h | 6 +++--- test/webthreestubclient.h | 4 ++-- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/libjsqrc/CMakeLists.txt b/libjsqrc/CMakeLists.txt index 6554e523d..e5da5c4ee 100644 --- a/libjsqrc/CMakeLists.txt +++ b/libjsqrc/CMakeLists.txt @@ -23,3 +23,9 @@ if (USENPM) endif() install( TARGETS jsqrc RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) + +file(GLOB_RECURSE SOLFILES "ethereumjs/lib/solidity/*.js") +file(GLOB_RECURSE UTILSFILES "ethereumjs/lib/utils/*.js") +file(GLOB_RECURSE WEB3FILES "ethereumjs/lib/web3/*.js") +add_custom_target(aux_js SOURCES ${SOLFILES} ${UTILSFILES} ${WEB3FILES}) + diff --git a/libjsqrc/ethereumjs/lib/web3/eth.js b/libjsqrc/ethereumjs/lib/web3/eth.js index cdf245198..9b13eccdb 100644 --- a/libjsqrc/ethereumjs/lib/web3/eth.js +++ b/libjsqrc/ethereumjs/lib/web3/eth.js @@ -77,7 +77,7 @@ var methods = [ { name: 'getStorage', call: 'eth_getStorage', addDefaultblock: 2}, { name: 'getStorageAt', call: 'eth_getStorageAt', addDefaultblock: 3, inputFormatter: utils.toHex}, - { name: 'getData', call: 'eth_getData', addDefaultblock: 2}, + { name: 'getCode', call: 'eth_getCode', addDefaultblock: 2}, { name: 'getBlock', call: blockCall, outputFormatter: formatters.outputBlockFormatter, inputFormatter: [utils.toHex, function(param){ return (!param) ? false : true; }]}, diff --git a/libweb3jsonrpc/WebThreeStubServerBase.cpp b/libweb3jsonrpc/WebThreeStubServerBase.cpp index 11f4da3ec..d0cb9c72f 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.cpp +++ b/libweb3jsonrpc/WebThreeStubServerBase.cpp @@ -435,7 +435,7 @@ string WebThreeStubServerBase::eth_getUncleCountByBlockNumber(string const& _blo return toJS(client()->uncleCount(client()->hashFromNumber(number))); } -string WebThreeStubServerBase::eth_getData(string const& _address, string const& _blockNumber) +string WebThreeStubServerBase::eth_getCode(string const& _address, string const& _blockNumber) { Address address; int number; diff --git a/libweb3jsonrpc/WebThreeStubServerBase.h b/libweb3jsonrpc/WebThreeStubServerBase.h index c71d7ee30..9914d071e 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.h +++ b/libweb3jsonrpc/WebThreeStubServerBase.h @@ -87,7 +87,7 @@ public: virtual std::string eth_getBlockTransactionCountByNumber(std::string const& _blockNumber); virtual std::string eth_getUncleCountByBlockHash(std::string const& _blockHash); virtual std::string eth_getUncleCountByBlockNumber(std::string const& _blockNumber); - virtual std::string eth_getData(std::string const& _address, std::string const& _blockNumber); + virtual std::string eth_getCode(std::string const& _address, std::string const& _blockNumber); virtual std::string eth_sendTransaction(Json::Value const& _json); virtual std::string eth_call(Json::Value const& _json, std::string const& _blockNumber); virtual bool eth_flush(); diff --git a/libweb3jsonrpc/abstractwebthreestubserver.h b/libweb3jsonrpc/abstractwebthreestubserver.h index cc326183d..6d84571a1 100644 --- a/libweb3jsonrpc/abstractwebthreestubserver.h +++ b/libweb3jsonrpc/abstractwebthreestubserver.h @@ -30,7 +30,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerbindAndAddMethod(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_getUncleCountByBlockNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_getUncleCountByBlockNumberI); - this->bindAndAddMethod(jsonrpc::Procedure("eth_getData", 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_getDataI); 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_flush", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_flushI); @@ -152,7 +152,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServereth_getData(request[0u].asString(), request[1u].asString()); + response = this->eth_getCode(request[0u].asString(), request[1u].asString()); } inline virtual void eth_sendTransactionI(const Json::Value &request, Json::Value &response) { @@ -320,7 +320,7 @@ class AbstractWebThreeStubServer : public jsonrpc::AbstractServerCallMethod("eth_getData",p); + Json::Value result = this->CallMethod("eth_getCode",p); if (result.isString()) return result.asString(); else