diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-05-04 10:14:12 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-05-18 07:13:25 +0200 |
commit | fafd121026c4f1e25d498983e4f88c119516552b (patch) | |
tree | 306dd432b7e300b526bc546ff5b81b2941b899ca /src/test | |
parent | c8571486364d6e9ca8c86bd1c81e230ca64f8904 (diff) |
refactor: Make CFeeRate constructor architecture-independent
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/amount_tests.cpp | 2 | ||||
-rw-r--r-- | src/test/fuzz/fee_rate.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/test/amount_tests.cpp b/src/test/amount_tests.cpp index 1a39498899..65ba2bab15 100644 --- a/src/test/amount_tests.cpp +++ b/src/test/amount_tests.cpp @@ -83,7 +83,7 @@ BOOST_AUTO_TEST_CASE(GetFeeTest) BOOST_CHECK(CFeeRate(CAmount(26), 789) == CFeeRate(32)); BOOST_CHECK(CFeeRate(CAmount(27), 789) == CFeeRate(34)); // Maximum size in bytes, should not crash - CFeeRate(MAX_MONEY, std::numeric_limits<size_t>::max() >> 1).GetFeePerK(); + CFeeRate(MAX_MONEY, std::numeric_limits<uint32_t>::max()).GetFeePerK(); } BOOST_AUTO_TEST_CASE(BinaryOperatorTest) diff --git a/src/test/fuzz/fee_rate.cpp b/src/test/fuzz/fee_rate.cpp index 2955213635..dff0e58000 100644 --- a/src/test/fuzz/fee_rate.cpp +++ b/src/test/fuzz/fee_rate.cpp @@ -20,8 +20,8 @@ FUZZ_TARGET(fee_rate) const CFeeRate fee_rate{satoshis_per_k}; (void)fee_rate.GetFeePerK(); - const size_t bytes = fuzzed_data_provider.ConsumeIntegral<size_t>(); - if (!MultiplicationOverflow(static_cast<int64_t>(bytes), satoshis_per_k) && bytes <= static_cast<uint64_t>(std::numeric_limits<int64_t>::max())) { + const auto bytes = fuzzed_data_provider.ConsumeIntegral<uint32_t>(); + if (!MultiplicationOverflow(int64_t{bytes}, satoshis_per_k)) { (void)fee_rate.GetFee(bytes); } (void)fee_rate.ToString(); |