Skip to content

Commit 883132e

Browse files
committed
add policy calls in big executable
1 parent ec751fb commit 883132e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

examples/big.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//!
1111
1212
use std::str::FromStr;
13-
use miniscript::{DefiniteDescriptorKey, Descriptor, DescriptorPublicKey, MiniscriptKey};
13+
use miniscript::{descriptor::Wsh, policy::{Concrete, Liftable}, psbt::PsbtExt, DefiniteDescriptorKey, Descriptor, DescriptorPublicKey, MiniscriptKey};
1414
use secp256k1::Secp256k1;
1515
fn main() {
1616
let empty = "".to_string();
@@ -30,6 +30,13 @@ fn main() {
3030
let (d, m) = Descriptor::parse_descriptor(&secp, &i).unwrap();
3131
use_descriptor(d);
3232
println!("{:?}", m);
33+
34+
let p = Concrete::<bitcoin::PublicKey>::from_str(&i).unwrap();
35+
let h = Wsh::new(p.compile().unwrap()).unwrap();
36+
println!("{}", h);
37+
println!("{:?}", h.lift());
38+
println!("{:?}", h.script_pubkey());
39+
println!("{:?}", h.address(bitcoin::Network::Bitcoin));
3340
}
3441

3542
fn use_descriptor<K: MiniscriptKey>(d: Descriptor<K>) {

0 commit comments

Comments
 (0)