From 856f4235b1ae56540e1d2279c27405d44a5c7b34 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sat, 28 Jun 2025 09:21:48 +0300 Subject: [PATCH] scripted-diff: rest: rename `strURIPart` -> `uri_part` Following https://github.com/bitcoin/bitcoin/pull/32540#discussion_r2172902737. -BEGIN VERIFY SCRIPT- sed -i 's/\/uri_part/g' src/rest.cpp -END VERIFY SCRIPT- --- src/rest.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/rest.cpp b/src/rest.cpp index 33c5bc0d70f..ab3cd83d3d4 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -187,12 +187,12 @@ static bool CheckWarmup(HTTPRequest* req) static bool rest_headers(const std::any& context, HTTPRequest* req, - const std::string& strURIPart) + const std::string& uri_part) { if (!CheckWarmup(req)) return false; std::string param; - const RESTResponseFormat rf = ParseDataFormat(param, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(param, uri_part); std::vector path = SplitString(param, '/'); std::string raw_count; @@ -319,13 +319,13 @@ static void BlockUndoToJSON(const CBlockUndo& block_undo, UniValue& result) } } -static bool rest_spent_txouts(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_spent_txouts(const std::any& context, HTTPRequest* req, const std::string& uri_part) { if (!CheckWarmup(req)) { return false; } std::string param; - const RESTResponseFormat rf = ParseDataFormat(param, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(param, uri_part); std::vector path = SplitString(param, '/'); std::string hashStr; @@ -391,13 +391,13 @@ static bool rest_spent_txouts(const std::any& context, HTTPRequest* req, const s static bool rest_block(const std::any& context, HTTPRequest* req, - const std::string& strURIPart, + const std::string& uri_part, TxVerbosity tx_verbosity) { if (!CheckWarmup(req)) return false; std::string hashStr; - const RESTResponseFormat rf = ParseDataFormat(hashStr, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(hashStr, uri_part); auto hash{uint256::FromHex(hashStr)}; if (!hash) { @@ -462,22 +462,22 @@ static bool rest_block(const std::any& context, } } -static bool rest_block_extended(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_block_extended(const std::any& context, HTTPRequest* req, const std::string& uri_part) { - return rest_block(context, req, strURIPart, TxVerbosity::SHOW_DETAILS_AND_PREVOUT); + return rest_block(context, req, uri_part, TxVerbosity::SHOW_DETAILS_AND_PREVOUT); } -static bool rest_block_notxdetails(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_block_notxdetails(const std::any& context, HTTPRequest* req, const std::string& uri_part) { - return rest_block(context, req, strURIPart, TxVerbosity::SHOW_TXID); + return rest_block(context, req, uri_part, TxVerbosity::SHOW_TXID); } -static bool rest_filter_header(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_filter_header(const std::any& context, HTTPRequest* req, const std::string& uri_part) { if (!CheckWarmup(req)) return false; std::string param; - const RESTResponseFormat rf = ParseDataFormat(param, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(param, uri_part); std::vector uri_parts = SplitString(param, '/'); std::string raw_count; @@ -594,12 +594,12 @@ static bool rest_filter_header(const std::any& context, HTTPRequest* req, const } } -static bool rest_block_filter(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_block_filter(const std::any& context, HTTPRequest* req, const std::string& uri_part) { if (!CheckWarmup(req)) return false; std::string param; - const RESTResponseFormat rf = ParseDataFormat(param, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(param, uri_part); // request is sent over URI scheme /rest/blockfilter/filtertype/blockhash std::vector uri_parts = SplitString(param, '/'); @@ -688,12 +688,12 @@ static bool rest_block_filter(const std::any& context, HTTPRequest* req, const s // A bit of a hack - dependency on a function defined in rpc/blockchain.cpp RPCHelpMan getblockchaininfo(); -static bool rest_chaininfo(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_chaininfo(const std::any& context, HTTPRequest* req, const std::string& uri_part) { if (!CheckWarmup(req)) return false; std::string param; - const RESTResponseFormat rf = ParseDataFormat(param, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(param, uri_part); switch (rf) { case RESTResponseFormat::JSON: { @@ -810,12 +810,12 @@ static bool rest_mempool(const std::any& context, HTTPRequest* req, const std::s } } -static bool rest_tx(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_tx(const std::any& context, HTTPRequest* req, const std::string& uri_part) { if (!CheckWarmup(req)) return false; std::string hashStr; - const RESTResponseFormat rf = ParseDataFormat(hashStr, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(hashStr, uri_part); auto hash{uint256::FromHex(hashStr)}; if (!hash) { @@ -869,12 +869,12 @@ static bool rest_tx(const std::any& context, HTTPRequest* req, const std::string } } -static bool rest_getutxos(const std::any& context, HTTPRequest* req, const std::string& strURIPart) +static bool rest_getutxos(const std::any& context, HTTPRequest* req, const std::string& uri_part) { if (!CheckWarmup(req)) return false; std::string param; - const RESTResponseFormat rf = ParseDataFormat(param, strURIPart); + const RESTResponseFormat rf = ParseDataFormat(param, uri_part); std::vector uriParts; if (param.length() > 1)