LCOV - code coverage report
Current view: top level - src/test/fuzz - fees.cpp (source / functions) Coverage Total Hit
Test: test_bitcoin_coverage.info Lines: 0.0 % 12 0
Test Date: 2024-08-28 04:44:32 Functions: 0.0 % 2 0
Branches: 0.0 % 16 0

             Branch data     Line data    Source code
       1                 :             : // Copyright (c) 2020-2021 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 <common/messages.h>
       6                 :             : #include <consensus/amount.h>
       7                 :             : #include <policy/fees.h>
       8                 :             : #include <test/fuzz/FuzzedDataProvider.h>
       9                 :             : #include <test/fuzz/fuzz.h>
      10                 :             : #include <test/fuzz/util.h>
      11                 :             : 
      12                 :             : #include <cstdint>
      13                 :             : #include <string>
      14                 :             : #include <vector>
      15                 :             : 
      16                 :             : using common::StringForFeeReason;
      17                 :             : 
      18         [ #  # ]:           0 : FUZZ_TARGET(fees)
      19                 :             : {
      20                 :           0 :     FuzzedDataProvider fuzzed_data_provider(buffer.data(), buffer.size());
      21                 :           0 :     const CFeeRate minimal_incremental_fee{ConsumeMoney(fuzzed_data_provider)};
      22                 :           0 :     FastRandomContext rng{/*fDeterministic=*/true};
      23         [ #  # ]:           0 :     FeeFilterRounder fee_filter_rounder{minimal_incremental_fee, rng};
      24   [ #  #  #  # ]:           0 :     LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 10000) {
      25                 :           0 :         const CAmount current_minimum_fee = ConsumeMoney(fuzzed_data_provider);
      26         [ #  # ]:           0 :         const CAmount rounded_fee = fee_filter_rounder.round(current_minimum_fee);
      27   [ #  #  #  # ]:           0 :         assert(MoneyRange(rounded_fee));
      28                 :             :     }
      29                 :           0 :     const FeeReason fee_reason = fuzzed_data_provider.PickValueInArray({FeeReason::NONE, FeeReason::HALF_ESTIMATE, FeeReason::FULL_ESTIMATE, FeeReason::DOUBLE_ESTIMATE, FeeReason::CONSERVATIVE, FeeReason::MEMPOOL_MIN, FeeReason::PAYTXFEE, FeeReason::FALLBACK, FeeReason::REQUIRED});
      30         [ #  # ]:           0 :     (void)StringForFeeReason(fee_reason);
      31                 :           0 : }
        

Generated by: LCOV version 2.0-1