refactor: fees: split fee rate format from fee estimate mode

- Introduce a `FeeRateFormat` enum and change `CFeeRate::ToString()`
   to use it for `BTC/kvB` vs `sat/vB` output formatting.
 - Handle all enum values, hence remove default case in `CFeeRate::ToString()`
   and `assert(False)` when a `FeeRateFormat` value is not handled.
 - Keep `FeeEstimateMode` focused on fee estimation behavior by removing fee rate format
   values from `FeeEstimateMode`.
 - Update all formatting call sites and tests to pass `FeeRateFormat` explicitly, separating fee rate format
   from fee-estimation mode selection.
This commit is contained in:
ismaelsadeeq
2025-11-17 10:21:09 +00:00
parent 922ebf96ed
commit c1355493e2
10 changed files with 24 additions and 19 deletions

View File

@@ -22,6 +22,7 @@
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <util/fees.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/translation.h>
@@ -34,8 +35,6 @@
#include <string>
#include <vector>
enum class FeeEstimateMode;
using common::AmountErrMsg;
using common::AmountHighWarn;
using common::FeeModeFromString;