LCOV - code coverage report
Current view: top level - src/test/fuzz - signet.cpp (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 3 15 20.0 %
Date: 2023-11-06 23:13:05 Functions: 1 7 14.3 %
Branches: 3 24 12.5 %

           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 <chainparams.h>
       6                 :            : #include <consensus/validation.h>
       7                 :            : #include <primitives/block.h>
       8                 :            : #include <signet.h>
       9                 :            : #include <streams.h>
      10                 :            : #include <test/fuzz/FuzzedDataProvider.h>
      11                 :            : #include <test/fuzz/fuzz.h>
      12                 :            : #include <test/fuzz/util.h>
      13                 :            : #include <test/util/setup_common.h>
      14                 :            : #include <util/chaintype.h>
      15                 :            : 
      16                 :            : #include <cstdint>
      17         [ +  - ]:          2 : #include <optional>
      18         [ +  - ]:          2 : #include <vector>
      19                 :            : 
      20                 :          0 : void initialize_signet()
      21                 :            : {
      22 [ #  # ][ #  # ]:          0 :     static const auto testing_setup = MakeNoLogFileContext<>(ChainType::SIGNET);
                 [ #  # ]
      23                 :          0 : }
      24                 :            : 
      25         [ +  - ]:          4 : FUZZ_TARGET(signet, .init = initialize_signet)
      26                 :            : {
      27                 :          0 :     FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
      28                 :          0 :     const std::optional<CBlock> block = ConsumeDeserializable<CBlock>(fuzzed_data_provider);
      29         [ #  # ]:          0 :     if (!block) {
      30                 :          0 :         return;
      31                 :            :     }
      32 [ #  # ][ #  # ]:          0 :     (void)CheckSignetBlockSolution(*block, Params().GetConsensus());
                 [ #  # ]
      33         [ #  # ]:          0 :     (void)SignetTxs::Create(*block, ConsumeScript(fuzzed_data_provider));
      34         [ #  # ]:          0 : }

Generated by: LCOV version 1.14