Skip to content

Commit 220f1a0

Browse files
committed
examples: Adapt to Simplicity
These also silently broke. Export TapLeafScript to make it available outside the library.
1 parent 9c9a19a commit 220f1a0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

examples/taproot.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use miniscript::policy::Concrete;
99
use miniscript::{
1010
translate_hash_fail, Descriptor, Miniscript, NoExt, Tap, TranslatePk, Translator,
1111
};
12+
use miniscript::descriptor::TapLeafScript;
1213
use secp256k1::{rand, KeyPair};
1314

1415
// Refer to https://github.com/sanket1729/adv_btc_workshop/blob/master/workshop.md#creating-a-taproot-descriptor
@@ -70,14 +71,14 @@ fn main() {
7071
iter.next().unwrap(),
7172
(
7273
1,
73-
&Miniscript::<String, Tap, NoExt>::from_str("and_v(vc:pk_k(In),older(9))").unwrap()
74+
TapLeafScript::Miniscript(&Miniscript::<String, Tap, NoExt>::from_str("and_v(vc:pk_k(In),older(9))").unwrap())
7475
)
7576
);
7677
assert_eq!(
7778
iter.next().unwrap(),
7879
(
7980
1,
80-
&Miniscript::<String, Tap, NoExt>::from_str("multi_a(2,hA,S)").unwrap()
81+
TapLeafScript::Miniscript(&Miniscript::<String, Tap, NoExt>::from_str("multi_a(2,hA,S)").unwrap())
8182
)
8283
);
8384
assert_eq!(iter.next(), None);

src/descriptor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub use self::key::{
5757
DescriptorMultiXKey, DescriptorPublicKey, DescriptorSecretKey, DescriptorXKey, InnerXKey,
5858
SinglePriv, SinglePub, SinglePubKey, Wildcard,
5959
};
60-
pub use self::tr::{TapTree, Tr};
60+
pub use self::tr::{TapTree, Tr, TapLeafScript};
6161
/// Alias type for a map of public key to secret key
6262
///
6363
/// This map is returned whenever a descriptor that contains secrets is parsed using

0 commit comments

Comments
 (0)