Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/htlc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn main() {
// Lift the descriptor into an abstract policy.
assert_eq!(
format!("{}", htlc_descriptor.lift().unwrap()),
"or(and(pk(022222222222222222222222222222222222222222222222222222222222222222),sha256(1111111111111111111111111111111111111111111111111111111111111111)),and(pk(020202020202020202020202020202020202020202020202020202020202020202),older(4444)))"
"((pk(022222222222222222222222222222222222222222222222222222222222222222)sha256(1111111111111111111111111111111111111111111111111111111111111111))(pk(020202020202020202020202020202020202020202020202020202020202020202)older(4444)))"
);

// Get the scriptPubkey for this Wsh descriptor.
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/regression_descriptor_parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn do_test(data: &[u8]) {
(Ok(new), Ok(old)) => {
assert_eq!(
old.to_string(),
new.to_string(),
new.to_policy_syntax_string(),
"lifted input {} (left is old, right is new)",
data_str
)
Expand Down
6 changes: 3 additions & 3 deletions src/descriptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2175,15 +2175,15 @@ pk(03f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8))";
// Taproot structure is erased but key order preserved..
let desc = Descriptor::<String>::from_str("tr(ROOT,{pk(A1),{pk(B1),pk(B2)}})").unwrap();
let lift = desc.lift().unwrap();
assert_eq!(lift.to_string(), "or(pk(ROOT),or(pk(A1),pk(B1),pk(B2)))",);
assert_eq!(lift.to_string(), "(pk(ROOT)(pk(A1)pk(B1)pk(B2)))");
let desc = Descriptor::<String>::from_str("tr(ROOT,{{pk(A1),pk(B1)},pk(B2)})").unwrap();
let lift = desc.lift().unwrap();
assert_eq!(lift.to_string(), "or(pk(ROOT),or(pk(A1),pk(B1),pk(B2)))",);
assert_eq!(lift.to_string(), "(pk(ROOT)(pk(A1)pk(B1)pk(B2)))");

// And normalization happens
let desc = Descriptor::<String>::from_str("tr(ROOT,{0,{0,0}})").unwrap();
let lift = desc.lift().unwrap();
assert_eq!(lift.to_string(), "or(pk(ROOT),UNSATISFIABLE)",);
assert_eq!(lift.to_string(), "(pk(ROOT)UNSATISFIABLE)");
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions src/policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ mod tests {
concrete_policy_rtt("and(pk(X),or(99@pk(Y),1@older(12960)))");

semantic_policy_rtt("pk()");
semantic_policy_rtt("or(pk(X),pk(Y))");
semantic_policy_rtt("and(pk(X),pk(Y))");
semantic_policy_rtt("(pk(X)pk(Y))");
semantic_policy_rtt("(pk(X)pk(Y))");

//fuzzer crashes
assert!(ConcretePol::from_str("thresh()").is_err());
Expand Down
Loading
Loading