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 : }