Skip to content

Commit

Permalink
add policy calls in big executable
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta committed Mar 3, 2024
1 parent ec751fb commit 883132e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion examples/big.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//!

use std::str::FromStr;
use miniscript::{DefiniteDescriptorKey, Descriptor, DescriptorPublicKey, MiniscriptKey};
use miniscript::{descriptor::Wsh, policy::{Concrete, Liftable}, psbt::PsbtExt, DefiniteDescriptorKey, Descriptor, DescriptorPublicKey, MiniscriptKey};
use secp256k1::Secp256k1;
fn main() {
let empty = "".to_string();
Expand All @@ -30,6 +30,13 @@ fn main() {
let (d, m) = Descriptor::parse_descriptor(&secp, &i).unwrap();
use_descriptor(d);
println!("{:?}", m);

let p = Concrete::<bitcoin::PublicKey>::from_str(&i).unwrap();
let h = Wsh::new(p.compile().unwrap()).unwrap();
println!("{}", h);
println!("{:?}", h.lift());
println!("{:?}", h.script_pubkey());
println!("{:?}", h.address(bitcoin::Network::Bitcoin));
}

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

0 comments on commit 883132e

Please sign in to comment.