mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
Add a string fee_rate_estimator option (default "none") to estimatesmartfee options. "block_policy" consults only the block policy fee rate estimator, "none" uses the fee rate estimator manager selected behaviour, and unknown values are treated as "none". Unknown option keys are rejected. Still only the block policy fee rate estimator, so the result is unchanged; a subsequent commit will change the default behaviour. Also adds GetFeeRateEstimate(FeeRateEstimatorType, target, conservative) to FeeRateEstimatorManager so callers can query a single estimator by type; NONE returns the manager-selected combined estimate.
20 lines
754 B
C++
20 lines
754 B
C++
// Copyright (c) The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#include <util/fees.h>
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
BOOST_AUTO_TEST_SUITE(fees_util_tests)
|
|
|
|
BOOST_AUTO_TEST_CASE(fee_rate_estimator_type_from_string)
|
|
{
|
|
BOOST_CHECK(FeeRateEstimatorTypeFromString("none") == FeeRateEstimatorType::NONE);
|
|
BOOST_CHECK(FeeRateEstimatorTypeFromString("block_policy") == FeeRateEstimatorType::BLOCK_POLICY);
|
|
BOOST_CHECK(FeeRateEstimatorTypeFromString("mempool_policy") == FeeRateEstimatorType::NONE);
|
|
BOOST_CHECK(FeeRateEstimatorTypeFromString("unknown") == FeeRateEstimatorType::NONE);
|
|
}
|
|
|
|
BOOST_AUTO_TEST_SUITE_END()
|