diff --git a/CHANGELOG.md b/CHANGELOG.md index d143487af8d..1765c4ae06d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ - Changed: [#5676](https://github.com/ethereum/aleth/pull/5676) When receiving large batches of new block hashes, process up to 1024 hashes instead of disabling the peer. - Changed: [#5719](https://github.com/ethereum/aleth/pull/5719) Enable support for Visual Studio 2017 on Windows. - Changed: [#5713](https://github.com/ethereum/aleth/pull/5713) Propagate new blocks after PoW check rather than after import into the blockchain. +- Changed: [#5734](https://github.com/ethereum/aleth/pull/5734) debug_accountRangeAt RPC method is renamed to debug_accountRange to conform with geth and retesteth requirements. - Removed: [#5631](https://github.com/ethereum/aleth/pull/5631) Removed PARANOID build option. - Fixed: [#5562](https://github.com/ethereum/aleth/pull/5562) Don't send header request messages to peers that haven't sent us Status yet. - Fixed: [#5581](https://github.com/ethereum/aleth/pull/5581) Fixed finding neighbour nodes in Discovery. diff --git a/libweb3jsonrpc/Debug.cpp b/libweb3jsonrpc/Debug.cpp index 38519bb265c..45e0ea259fd 100644 --- a/libweb3jsonrpc/Debug.cpp +++ b/libweb3jsonrpc/Debug.cpp @@ -145,7 +145,7 @@ Json::Value Debug::debug_traceBlockByNumber(int _blockNumber, Json::Value const& return ret; } -Json::Value Debug::debug_accountRangeAt( +Json::Value Debug::debug_accountRange( string const& _blockHashOrNumber, int _txIndex, string const& _addressHash, int _maxResults) { Json::Value ret(Json::objectValue); diff --git a/libweb3jsonrpc/Debug.h b/libweb3jsonrpc/Debug.h index a121911d91b..bbb953d3828 100644 --- a/libweb3jsonrpc/Debug.h +++ b/libweb3jsonrpc/Debug.h @@ -27,7 +27,7 @@ class Debug: public DebugFace return RPCModules{RPCModule{"debug", "1.0"}}; } - virtual Json::Value debug_accountRangeAt(std::string const& _blockHashOrNumber, int _txIndex, + virtual Json::Value debug_accountRange(std::string const& _blockHashOrNumber, int _txIndex, std::string const& _addressHash, int _maxResults) override; virtual Json::Value debug_traceTransaction(std::string const& _txHash, Json::Value const& _json) override; virtual Json::Value debug_traceCall(Json::Value const& _call, std::string const& _blockNumber, Json::Value const& _options) override; diff --git a/libweb3jsonrpc/DebugFace.h b/libweb3jsonrpc/DebugFace.h index dd39c3cb788..8276aba3a87 100644 --- a/libweb3jsonrpc/DebugFace.h +++ b/libweb3jsonrpc/DebugFace.h @@ -14,7 +14,7 @@ namespace dev { public: DebugFace() { - this->bindAndAddMethod(jsonrpc::Procedure("debug_accountRangeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER,"param3",jsonrpc::JSON_STRING,"param4",jsonrpc::JSON_INTEGER, NULL), &dev::rpc::DebugFace::debug_accountRangeAtI); + this->bindAndAddMethod(jsonrpc::Procedure("debug_accountRange", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER,"param3",jsonrpc::JSON_STRING,"param4",jsonrpc::JSON_INTEGER, NULL), &dev::rpc::DebugFace::debug_accountRangeI); this->bindAndAddMethod(jsonrpc::Procedure("debug_traceTransaction", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_OBJECT, NULL), &dev::rpc::DebugFace::debug_traceTransactionI); this->bindAndAddMethod(jsonrpc::Procedure("debug_storageRangeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER,"param3",jsonrpc::JSON_STRING,"param4",jsonrpc::JSON_STRING,"param5",jsonrpc::JSON_INTEGER, NULL), &dev::rpc::DebugFace::debug_storageRangeAtI); this->bindAndAddMethod(jsonrpc::Procedure("debug_preimage", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &dev::rpc::DebugFace::debug_preimageI); @@ -22,9 +22,9 @@ namespace dev { this->bindAndAddMethod(jsonrpc::Procedure("debug_traceBlockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_OBJECT, NULL), &dev::rpc::DebugFace::debug_traceBlockByHashI); this->bindAndAddMethod(jsonrpc::Procedure("debug_traceCall", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_OBJECT,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_OBJECT, NULL), &dev::rpc::DebugFace::debug_traceCallI); } - inline virtual void debug_accountRangeAtI(const Json::Value &request, Json::Value &response) + inline virtual void debug_accountRangeI(const Json::Value &request, Json::Value &response) { - response = this->debug_accountRangeAt(request[0u].asString(), request[1u].asInt(), request[2u].asString(), request[3u].asInt()); + response = this->debug_accountRange(request[0u].asString(), request[1u].asInt(), request[2u].asString(), request[3u].asInt()); } inline virtual void debug_traceTransactionI(const Json::Value &request, Json::Value &response) { @@ -50,7 +50,7 @@ namespace dev { { response = this->debug_traceCall(request[0u], request[1u].asString(), request[2u]); } - virtual Json::Value debug_accountRangeAt(const std::string& param1, int param2, const std::string& param3, int param4) = 0; + virtual Json::Value debug_accountRange(const std::string& param1, int param2, const std::string& param3, int param4) = 0; virtual Json::Value debug_traceTransaction(const std::string& param1, const Json::Value& param2) = 0; virtual Json::Value debug_storageRangeAt(const std::string& param1, int param2, const std::string& param3, const std::string& param4, int param5) = 0; virtual std::string debug_preimage(const std::string& param1) = 0; diff --git a/libweb3jsonrpc/debug.json b/libweb3jsonrpc/debug.json index 09d5ebe987e..5cc79ced93f 100644 --- a/libweb3jsonrpc/debug.json +++ b/libweb3jsonrpc/debug.json @@ -1,5 +1,5 @@ [ -{ "name": "debug_accountRangeAt", "params": ["", 0, "", 0], "returns": {}}, +{ "name": "debug_accountRange", "params": ["", 0, "", 0], "returns": {}}, { "name": "debug_traceTransaction", "params": ["", {}], "returns": {}}, { "name": "debug_storageRangeAt", "params": ["", 0, "", "", 0], "returns": {}}, { "name": "debug_preimage", "params": [""], "returns": ""}, diff --git a/test/unittests/libweb3jsonrpc/WebThreeStubClient.h b/test/unittests/libweb3jsonrpc/WebThreeStubClient.h index 37299837bfd..3324c84b365 100644 --- a/test/unittests/libweb3jsonrpc/WebThreeStubClient.h +++ b/test/unittests/libweb3jsonrpc/WebThreeStubClient.h @@ -959,14 +959,14 @@ class WebThreeStubClient : public jsonrpc::Client else throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - Json::Value debug_accountRangeAt(const std::string& param1, int param2, const std::string& param3, int param4) throw (jsonrpc::JsonRpcException) + Json::Value debug_accountRange(const std::string& param1, int param2, const std::string& param3, int param4) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); p.append(param2); p.append(param3); p.append(param4); - Json::Value result = this->CallMethod("debug_accountRangeAt", p); + Json::Value result = this->CallMethod("debug_accountRange", p); if (result.isObject()) return result; else diff --git a/test/unittests/libweb3jsonrpc/jsonrpc.cpp b/test/unittests/libweb3jsonrpc/jsonrpc.cpp index 6aefb355537..5d501f03555 100644 --- a/test/unittests/libweb3jsonrpc/jsonrpc.cpp +++ b/test/unittests/libweb3jsonrpc/jsonrpc.cpp @@ -596,7 +596,7 @@ BOOST_AUTO_TEST_CASE(web3_sha3) BOOST_CHECK_EQUAL("0xc6888fa159d67f77c2f3d7a402e199802766bd7e8d4d1ecd2274fc920265d56a", result); } -BOOST_AUTO_TEST_CASE(debugAccountRangeAtFinalBlockState) +BOOST_AUTO_TEST_CASE(debugAccountRangeFinalBlockState) { // mine to get some balance at coinbase dev::eth::mine(*(web3->ethereum()), 1); @@ -617,11 +617,11 @@ BOOST_AUTO_TEST_CASE(debugAccountRangeAtFinalBlockState) string receiverHash = toString(sha3(receiver)); // receiver doesn't exist in the beginning of the 2nd block - Json::Value result = rpcClient->debug_accountRangeAt("2", 0, "0", 100); + Json::Value result = rpcClient->debug_accountRange("2", 0, "0", 100); BOOST_CHECK(!result["addressMap"].isMember(receiverHash)); // receiver exists in the end of the 2nd block - result = rpcClient->debug_accountRangeAt("2", 1, "0", 100); + result = rpcClient->debug_accountRange("2", 1, "0", 100); BOOST_CHECK(result["addressMap"].isMember(receiverHash)); BOOST_CHECK_EQUAL(result["addressMap"][receiverHash], toString(receiver)); }