Bitcoin Core
32.99.0
P2P Digital Currency
Loading...
Searching...
No Matches
src
test
fees_util_tests.cpp
Go to the documentation of this file.
1
// Copyright (c) The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#include <
util/fees.h
>
6
7
#include <boost/test/unit_test.hpp>
8
9
BOOST_AUTO_TEST_SUITE
(
fees_util_tests
)
10
11
BOOST_AUTO_TEST_CASE
(
fee_rate_estimator_type_to_string
)
12
{
13
BOOST_CHECK_EQUAL
(
FeeRateEstimatorTypeToString
(
FeeRateEstimatorType::AUTO
),
"auto"
);
14
BOOST_CHECK_EQUAL
(
FeeRateEstimatorTypeToString
(
FeeRateEstimatorType::BLOCK_POLICY
),
"block_policy"
);
15
BOOST_CHECK_EQUAL
(
FeeRateEstimatorTypeToString
(
FeeRateEstimatorType::MEMPOOL_POLICY
),
"mempool_policy"
);
16
}
17
18
BOOST_AUTO_TEST_CASE
(
fee_rate_estimator_type_from_string
)
19
{
20
BOOST_CHECK
(
FeeRateEstimatorTypeFromString
(
"auto"
) ==
FeeRateEstimatorType::AUTO
);
21
BOOST_CHECK
(
FeeRateEstimatorTypeFromString
(
"block_policy"
) ==
FeeRateEstimatorType::BLOCK_POLICY
);
22
BOOST_CHECK
(
FeeRateEstimatorTypeFromString
(
"mempool_policy"
) ==
FeeRateEstimatorType::MEMPOOL_POLICY
);
23
BOOST_CHECK
(
FeeRateEstimatorTypeFromString
(
"Block_Policy"
) ==
FeeRateEstimatorType::BLOCK_POLICY
);
24
BOOST_CHECK
(!
FeeRateEstimatorTypeFromString
(
"unknown"
));
25
BOOST_CHECK
(!
FeeRateEstimatorTypeFromString
(
""
));
26
BOOST_CHECK
(!
FeeRateEstimatorTypeFromString
(
"none"
));
27
}
28
29
BOOST_AUTO_TEST_SUITE_END
()
BOOST_AUTO_TEST_SUITE_END
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(fee_rate_estimator_type_to_string)
Definition
fees_util_tests.cpp:11
BOOST_CHECK_EQUAL
#define BOOST_CHECK_EQUAL(v1, v2)
Definition
object.cpp:17
BOOST_CHECK
#define BOOST_CHECK(expr)
Definition
object.cpp:16
FeeRateEstimatorTypeToString
std::string_view FeeRateEstimatorTypeToString(FeeRateEstimatorType feerate_estimator_type)
Definition
fees.cpp:13
FeeRateEstimatorTypeFromString
std::optional< FeeRateEstimatorType > FeeRateEstimatorTypeFromString(std::string_view feerate_estimator_type)
Definition
fees.cpp:27
fees.h
FeeRateEstimatorType::BLOCK_POLICY
@ BLOCK_POLICY
FeeRateEstimatorType::MEMPOOL_POLICY
@ MEMPOOL_POLICY
FeeRateEstimatorType::AUTO
@ AUTO
Ticks
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.
Definition
time.h:82
Generated on Sat Oct 24 2026 20:00:30 for Bitcoin Core by
1.9.8