Move module out of fuzz_target directory

The new module `fuzz_utils` in the `fuzz_targets/` directory causes
`verify-execution` to fail.

Move the module to the `src/` directory. Create a `lib.rs` file.
This commit is contained in:
Jamil Lambert, PhD 2025-03-07 15:44:50 +00:00
parent 845daaee16
commit ddb6dd520e
No known key found for this signature in database
GPG Key ID: 54DC29234AB5D2C0
4 changed files with 11 additions and 4 deletions

View File

@ -1,7 +1,6 @@
use honggfuzz::fuzz;
mod fuzz_utils;
use fuzz_utils::consume_random_bytes;
use bitcoin_fuzz::fuzz_utils::consume_random_bytes;
fn do_test(data: &[u8]) {
let mut new_data = data;

View File

@ -4,8 +4,7 @@ use bitcoin::script::{self, ScriptExt as _};
use bitcoin::{FeeRate, Network};
use honggfuzz::fuzz;
mod fuzz_utils;
use fuzz_utils::{consume_random_bytes, consume_u64};
use bitcoin_fuzz::fuzz_utils::{consume_random_bytes, consume_u64};
fn do_test(data: &[u8]) {
let mut new_data = data;

View File

@ -1,3 +1,7 @@
// SPDX-License-Identifier: CC0-1.0
//! Helper functions for fuzzing.
pub fn consume_random_bytes<'a>(data: &mut &'a [u8]) -> &'a [u8] {
if data.is_empty() {
return &[];

5
fuzz/src/lib.rs Normal file
View File

@ -0,0 +1,5 @@
// SPDX-License-Identifier: CC0-1.0
//! # Fuzzing
pub mod fuzz_utils;