Skip to content

Commit

Permalink
Merge #634: fuzz: cover taproot in roundtrip_miniscript_str
Browse files Browse the repository at this point in the history
3b47c3c fuzz: cover taproot in `roundtrip_miniscript_str` (Bruno Garcia)

Pull request description:

ACKs for top commit:
  apoelstra:
    ACK 3b47c3c

Tree-SHA512: 2f99117f937f2658cf620b5ed1348d45c16e62bb0aab40a2e0955c90c5efd8bd674a275095e058717f11f448e1c2ff578324af4d321d08cf17eaf3ef8bc5c2b9
  • Loading branch information
apoelstra committed Jan 5, 2024
2 parents 91b5e60 + 3b47c3c commit 47d2cc7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fuzz/fuzz_targets/roundtrip_miniscript_str.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
use std::str::FromStr;

use honggfuzz::fuzz;
use miniscript::{Miniscript, Segwitv0};
use miniscript::{Miniscript, Segwitv0, Tap};

fn do_test(data: &[u8]) {
let s = String::from_utf8_lossy(data);
if let Ok(desc) = Miniscript::<String, Segwitv0>::from_str(&s) {
let str2 = desc.to_string();
let desc2 = Miniscript::<String, Segwitv0>::from_str(&str2).unwrap();

assert_eq!(desc, desc2);
} else if let Ok(desc) = Miniscript::<String, Tap>::from_str(&s) {
let str2 = desc.to_string();
let desc2: Miniscript<String, Tap> = Miniscript::<String, Tap>::from_str(&str2).unwrap();

assert_eq!(desc, desc2);
}
}
Expand Down

0 comments on commit 47d2cc7

Please sign in to comment.