Skip to content

Commit 00cac40

Browse files
committed
descriptor: add unit test demonstrating sanity-checking behavior in <= 12.x
See rust-bitcoin#734 for discussion of this. Meanwhile, add a unit test so we can determine when the behavior changes.
1 parent 1a3605d commit 00cac40

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/descriptor/mod.rs

+16
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,22 @@ pk(03f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8))";
20112011
Descriptor::<DescriptorPublicKey>::from_str("wsh(andor(pk(tpubDEN9WSToTyy9ZQfaYqSKfmVqmq1VVLNtYfj3Vkqh67et57eJ5sTKZQBkHqSwPUsoSskJeaYnPttHe2VrkCsKA27kUaN9SDc5zhqeLzKa1rr/0'/<0;1;2;3>/*),older(10000),pk(tpubD8LYfn6njiA2inCoxwM7EuN3cuLVcaHAwLYeups13dpevd3nHLRdK9NdQksWXrhLQVxcUZRpnp5CkJ1FhE61WRAsHxDNAkvGkoQkAeWDYjV/8/<0;1;2>/*)))").unwrap_err();
20122012
}
20132013

2014+
#[test]
2015+
fn regression_734() {
2016+
Descriptor::<DescriptorPublicKey>::from_str(
2017+
"wsh(or_i(pk(0202baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0a66a),1))",
2018+
)
2019+
.unwrap();
2020+
Descriptor::<DescriptorPublicKey>::from_str(
2021+
"sh(or_i(pk(0202baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0a66a),1))",
2022+
)
2023+
.unwrap();
2024+
Descriptor::<DescriptorPublicKey>::from_str(
2025+
"tr(02baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0a66a,1)",
2026+
)
2027+
.unwrap_err();
2028+
}
2029+
20142030
#[test]
20152031
fn test_context_pks() {
20162032
let comp_key = bitcoin::PublicKey::from_str(

0 commit comments

Comments
 (0)