@@ -40,9 +40,6 @@ use crate::{
40
40
ToPublicKey , TranslatePk , TranslatePk2 ,
41
41
} ;
42
42
43
- // Directly export from lib.rs, exporting the trait here causes conflicts in this file
44
- pub ( crate ) mod pretaproot;
45
-
46
43
mod bare;
47
44
mod segwitv0;
48
45
mod sh;
@@ -398,43 +395,6 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
398
395
Descriptor :: Tr ( ref _tr) => DescriptorType :: Tr ,
399
396
}
400
397
}
401
-
402
- /// .
403
- /// Convert a Descriptor into [`pretaproot::PreTaprootDescriptor`]
404
- /// # Examples
405
- ///
406
- /// ```
407
- /// use std::str::FromStr;
408
- /// use miniscript::descriptor::Descriptor;
409
- /// use miniscript::{PreTaprootDescriptor, PreTaprootDescriptorTrait};
410
- /// use miniscript::bitcoin;
411
- ///
412
- /// // A descriptor with a string generic
413
- /// let desc = Descriptor::<bitcoin::PublicKey>::from_str("wpkh(02e18f242c8b0b589bfffeac30e1baa80a60933a649c7fb0f1103e78fbf58aa0ed)")
414
- /// .expect("Valid segwitv0 descriptor");
415
- /// let pre_tap_desc = desc.into_pre_taproot_desc().expect("Wsh is pre taproot");
416
- ///
417
- /// // Now the script code and explicit script no longer fail on longer fail
418
- /// // on PreTaprootDescriptor using PreTaprootDescriptorTrait
419
- /// let script_code = pre_tap_desc.script_code();
420
- /// assert_eq!(script_code.to_string(),
421
- /// "Script(OP_DUP OP_HASH160 OP_PUSHBYTES_20 62107d047e8818b594303fe0657388cc4fc8771f OP_EQUALVERIFY OP_CHECKSIG)"
422
- /// );
423
- /// ```
424
- ///
425
- /// # Errors
426
- ///
427
- /// This function will return an error if descriptor is not a pre taproot descriptor.
428
- pub fn into_pre_taproot_desc ( self ) -> Result < pretaproot:: PreTaprootDescriptor < Pk > , Self > {
429
- match self {
430
- Descriptor :: Bare ( bare) => Ok ( pretaproot:: PreTaprootDescriptor :: Bare ( bare) ) ,
431
- Descriptor :: Pkh ( pkh) => Ok ( pretaproot:: PreTaprootDescriptor :: Pkh ( pkh) ) ,
432
- Descriptor :: Wpkh ( wpkh) => Ok ( pretaproot:: PreTaprootDescriptor :: Wpkh ( wpkh) ) ,
433
- Descriptor :: Sh ( sh) => Ok ( pretaproot:: PreTaprootDescriptor :: Sh ( sh) ) ,
434
- Descriptor :: Wsh ( wsh) => Ok ( pretaproot:: PreTaprootDescriptor :: Wsh ( wsh) ) ,
435
- Descriptor :: Tr ( tr) => Err ( Descriptor :: Tr ( tr) ) ,
436
- }
437
- }
438
398
}
439
399
440
400
impl < P , Q > TranslatePk < P , Q > for Descriptor < P >
0 commit comments