Skip to content

Commit fe9d2be

Browse files
authored
Merge pull request #236 from sanket1729/thresh_bug
Thresh bug with equal verify
2 parents d64668d + 865bf4b commit fe9d2be

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/miniscript/decode.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ pub fn parse<Ctx: ScriptContext>(
280280
))?
281281
},
282282
),
283+
Tk::Num(k) => {
284+
non_term.push(NonTerm::Verify);
285+
non_term.push(NonTerm::ThreshW {
286+
k: k as usize,
287+
n: 0
288+
});
289+
},
283290
),
284291
x => {
285292
tokens.un_next(x);

src/miniscript/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,12 @@ mod tests {
869869
OP_PUSHNUM_1\
870870
)"
871871
);
872+
873+
// Thresh bug with equal verify roundtrip
874+
roundtrip(
875+
&ms_str!("tv:thresh(1,pk(02d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e))", ),
876+
"Script(OP_PUSHBYTES_33 02d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e OP_CHECKSIG OP_PUSHNUM_1 OP_EQUALVERIFY OP_PUSHNUM_1)",
877+
);
872878
}
873879

874880
#[test]

0 commit comments

Comments
 (0)