Skip to content

Commit 7118c84

Browse files
committed
Add breaking tests
1 parent 0203377 commit 7118c84

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/miniscript/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,4 +1136,14 @@ mod tests {
11361136
SegwitMs::parse_insane(&script).unwrap_err();
11371137
SegwitMs::parse_with_ext(&script, &ExtParams::allow_all()).unwrap();
11381138
}
1139+
1140+
#[test]
1141+
fn tr_multi_a_j_wrapper() {
1142+
// Reported by darosior
1143+
// `multi_a` fragment may require the top stack element to be the empty vector.
1144+
// Previous version had incorrectly copied this code from multi.
1145+
type TapMs = Miniscript<String, Tap>;
1146+
let ms_str = TapMs::from_str_insane("j:multi_a(1,A,B,C)");
1147+
assert!(ms_str.is_err());
1148+
}
11391149
}

tests/test_desc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ fn test_descs(cl: &Client, testdata: &TestData) {
395395
let result = test_desc_satisfy(cl, testdata, "tr(X!,{pk(X1!),pk(X2!)})");
396396
assert_eq!(result, Err(DescError::PsbtFinalizeError));
397397

398+
// Test 10: Test taproot desc with ZERO known keys
399+
let result = test_desc_satisfy(cl, testdata, "tr(X!,j:multi_a(3,X1!,X2,X3,X4))");
400+
assert_eq!(result, Err(DescError::DescParseError));
401+
398402
// Test 11: Test taproot with insufficient known keys
399403
let result = test_desc_satisfy(cl, testdata, "tr(X!,{pk(X1!),multi_a(3,X2!,X3,X4)})");
400404
assert_eq!(result, Err(DescError::PsbtFinalizeError));

0 commit comments

Comments
 (0)