Skip to content

Commit 545bbbe

Browse files
committed
add satisfy call in big executable
1 parent 959546b commit 545bbbe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/big.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
//! * Use results so that calls are not stripped out.
1010
//!
1111
12-
use std::str::FromStr;
12+
use std::{collections::HashMap, str::FromStr};
13+
use bitcoin::ecdsa;
1314
use miniscript::{descriptor::Wsh, policy::{Concrete, Liftable}, psbt::PsbtExt, DefiniteDescriptorKey, Descriptor, DescriptorPublicKey, MiniscriptKey};
1415
use secp256k1::Secp256k1;
1516
fn main() {
@@ -40,8 +41,12 @@ fn main() {
4041

4142
let psbt: bitcoin::Psbt = i.parse().unwrap();
4243
let psbt = psbt.finalize(&secp).unwrap();
43-
let tx = psbt.extract_tx().unwrap();
44+
let mut tx = psbt.extract_tx().unwrap();
4445
println!("{:?}", tx);
46+
47+
let d = miniscript::Descriptor::<bitcoin::PublicKey>::from_str(&i).unwrap();
48+
let sigs = HashMap::<bitcoin::PublicKey, ecdsa::Signature>::new();
49+
d.satisfy(&mut tx.input[0], &sigs).unwrap();
4550
}
4651

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

0 commit comments

Comments
 (0)