@@ -3,14 +3,14 @@ extern crate elements_miniscript as miniscript;
33use std:: collections:: HashMap ;
44use std:: str:: FromStr ;
55
6- use bitcoin:: address :: WitnessVersion ;
6+ use bitcoin:: WitnessVersion ;
77use miniscript:: descriptor:: DescriptorType ;
8+ use miniscript:: descriptor:: TapLeafScript ;
89use miniscript:: policy:: Concrete ;
910use miniscript:: {
1011 translate_hash_fail, Descriptor , Miniscript , NoExt , Tap , TranslatePk , Translator ,
1112} ;
12- use miniscript:: descriptor:: TapLeafScript ;
13- use secp256k1:: { rand, KeyPair } ;
13+ use secp256k1:: { rand, Keypair } ;
1414
1515// Refer to https://github.com/sanket1729/adv_btc_workshop/blob/master/workshop.md#creating-a-taproot-descriptor
1616// for a detailed explanation of the policy and it's compilation
@@ -71,14 +71,19 @@ fn main() {
7171 iter. next( ) . unwrap( ) ,
7272 (
7373 1 ,
74- TapLeafScript :: Miniscript ( & Miniscript :: <String , Tap , NoExt >:: from_str( "and_v(vc:pk_k(In),older(9))" ) . unwrap( ) )
74+ TapLeafScript :: Miniscript (
75+ & Miniscript :: <String , Tap , NoExt >:: from_str( "and_v(vc:pk_k(In),older(9))" )
76+ . unwrap( )
77+ )
7578 )
7679 ) ;
7780 assert_eq ! (
7881 iter. next( ) . unwrap( ) ,
7982 (
8083 1 ,
81- TapLeafScript :: Miniscript ( & Miniscript :: <String , Tap , NoExt >:: from_str( "multi_a(2,hA,S)" ) . unwrap( ) )
84+ TapLeafScript :: Miniscript (
85+ & Miniscript :: <String , Tap , NoExt >:: from_str( "multi_a(2,hA,S)" ) . unwrap( )
86+ )
8287 )
8388 ) ;
8489 assert_eq ! ( iter. next( ) , None ) ;
@@ -88,7 +93,7 @@ fn main() {
8893
8994 // We require secp for generating a random XOnlyPublicKey
9095 let secp = secp256k1:: Secp256k1 :: new ( ) ;
91- let key_pair = KeyPair :: new ( & secp, & mut rand:: thread_rng ( ) ) ;
96+ let key_pair = Keypair :: new ( & secp, & mut rand:: thread_rng ( ) ) ;
9297 // Random unspendable XOnlyPublicKey provided for compilation to Taproot Descriptor
9398 let ( unspendable_pubkey, _parity) = bitcoin:: key:: XOnlyPublicKey :: from_keypair ( & key_pair) ;
9499
0 commit comments