LCOV - code coverage report
Current view: top level - src/test/fuzz - signet.cpp (source / functions) Hit Total Coverage
Test: fuzz_coverage.info Lines: 2 12 16.7 %
Date: 2023-09-26 12:08:55 Functions: 3 5 60.0 %

          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             : #include <optional>
      18             : #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