From 8cdf0ac671920f877705f0f949704f29250180a7 Mon Sep 17 00:00:00 2001 From: ismaelsadeeq Date: Thu, 2 May 2024 16:36:52 +0100 Subject: [PATCH] [refactor]: rename `estimatefeewithforecasters` to `estimatefee` --- src/rpc/client.cpp | 2 +- src/rpc/fees.cpp | 10 +++++----- src/test/fuzz/rpc.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/rpc/client.cpp b/src/rpc/client.cpp index a31c77d1174ad8..9295ebb2d82aab 100644 --- a/src/rpc/client.cpp +++ b/src/rpc/client.cpp @@ -252,7 +252,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "estimatesmartfee", 0, "conf_target" }, { "estimaterawfee", 0, "conf_target" }, { "estimaterawfee", 1, "threshold" }, - { "estimatefeewithforecasters", 0, "conf_target" }, + { "estimatefee", 0, "conf_target" }, { "prioritisetransaction", 1, "dummy" }, { "prioritisetransaction", 2, "fee_delta" }, { "setban", 2, "bantime" }, diff --git a/src/rpc/fees.cpp b/src/rpc/fees.cpp index 741d690eda4ff7..14b0bdd42c4e6d 100644 --- a/src/rpc/fees.cpp +++ b/src/rpc/fees.cpp @@ -99,10 +99,10 @@ static RPCHelpMan estimatesmartfee() }; } -static RPCHelpMan estimatefeewithforecasters() +static RPCHelpMan estimatefee() { return RPCHelpMan{ - "estimatefeewithforecasters", + "estimatefee", "\nEstimates the approximate fee per kilobyte needed for a transaction to begin\n" "confirmation within conf_target blocks if possible Uses virtual transaction size as defined\n" "in BIP 141 (witness data is discounted).\n", @@ -118,7 +118,7 @@ static RPCHelpMan estimatefeewithforecasters() {RPCResult::Type::STR, "", "error"}, }}, }}, - RPCExamples{HelpExampleCli("estimatefeewithforecasters", "2") + HelpExampleRpc("estimatefeewithforecasters", "2")}, + RPCExamples{HelpExampleCli("estimatefee", "2") + HelpExampleRpc("estimatefee", "2")}, [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { FeeEstimator& fee_estimator = EnsureAnyFeeForecasters(request.context); const unsigned int targetBlocks = request.params[0].getInt(); @@ -129,7 +129,7 @@ static RPCHelpMan estimatefeewithforecasters() // If the confirmation target is more than 2 fail early. // This should change whenever we have a forecaster that can support higher target. if (targetBlocks > 2) { - errors.push_back("estimatefeewithforecasters currently provide estimates for confirmation target 1 and 2 only"); + errors.push_back("estimatefee currently provide estimates for confirmation target 1 and 2 only"); result.pushKV("errors", errors); return result; } @@ -273,7 +273,7 @@ void RegisterFeeRPCCommands(CRPCTable& t) { static const CRPCCommand commands[]{ {"util", &estimatesmartfee}, - {"util", &estimatefeewithforecasters}, + {"util", &estimatefee}, {"hidden", &estimaterawfee}, }; for (const auto& c : commands) { diff --git a/src/test/fuzz/rpc.cpp b/src/test/fuzz/rpc.cpp index 18a8f7e49f8ff4..917d2cb4a39f95 100644 --- a/src/test/fuzz/rpc.cpp +++ b/src/test/fuzz/rpc.cpp @@ -105,7 +105,7 @@ const std::vector RPC_COMMANDS_SAFE_FOR_FUZZING{ "disconnectnode", "echo", "echojson", - "estimatefeewithforecasters", + "estimatefee", "estimaterawfee", "estimatesmartfee", "finalizepsbt",