From 7eb024afbc43ac73aa29d6b892bc4833067c5a3f Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 13 Mar 2024 16:49:40 +0100 Subject: [PATCH] fuzz: alternate between generating wsh() and tr() descs --- fuzz/fuzz_targets/descriptors.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fuzz/fuzz_targets/descriptors.rs b/fuzz/fuzz_targets/descriptors.rs index 4fae8129..b358d2d7 100644 --- a/fuzz/fuzz_targets/descriptors.rs +++ b/fuzz/fuzz_targets/descriptors.rs @@ -101,6 +101,7 @@ struct Config { pub recovery_paths: Vec, pub der_index: u16, pub dummy_psbt: DummyPsbt, + pub use_taproot: bool, } fuzz_target!(|config: Config| { @@ -126,7 +127,12 @@ fuzz_target!(|config: Config| { } else { return; }; - let policy = if let Ok(policy) = LianaPolicy::new(prim_path_info, rec_paths_info) { + let policy = if config.use_taproot { + LianaPolicy::new(prim_path_info, rec_paths_info) + } else { + LianaPolicy::new_legacy(prim_path_info, rec_paths_info) + }; + let policy = if let Ok(policy) = policy { policy } else { return;