Skip to content

Commit 1669a0f

Browse files
committed
fix(policy): use = instead of ≥ for thresh Display
thresh requires exactly k satisfactions to be valid, not k or more. Providing too many satisfactions makes the witness invalid. Addresses apoelstra's review feedback on PR rust-bitcoin#914.
1 parent aee1d82 commit 1669a0f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/policy/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ mod tests {
289289
assert_eq!(pol.normalized().to_string(), "(pk(A) ∨ pk(B))");
290290

291291
let pol = SemanticPol::from_str("thresh(2,pk(A),pk(B),pk(C))").unwrap();
292-
assert_eq!(pol.normalized().to_string(), "#{pk(A), pk(B), pk(C)} 2");
292+
assert_eq!(pol.normalized().to_string(), "#{pk(A), pk(B), pk(C)} = 2");
293293
}
294294

295295
#[test]

src/policy/semantic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl<Pk: MiniscriptKey> fmt::Display for Policy<Pk> {
280280
for sub in iter {
281281
write!(f, ", {}", sub)?;
282282
}
283-
write!(f, "}} {}", thresh.k())
283+
write!(f, "}} = {}", thresh.k())
284284
}
285285
}
286286
}

0 commit comments

Comments
 (0)