Skip to content

Commit a0c7b0c

Browse files
committed
Remove the pretaproot module
Now that the `PreTaprootDescriptorTrait` trait is empty and all error handling of the `DescriptorTrait` methods is handled more cleanly we can remove the `pretaproot` module all together. The `pretaproot` module has no test code, integration tests, or examples so I do not know if this breaks anything?
1 parent fe66a21 commit a0c7b0c

File tree

3 files changed

+0
-247
lines changed

3 files changed

+0
-247
lines changed

src/descriptor/mod.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ use crate::{
4343
TranslatePk2,
4444
};
4545

46-
// Directly export from lib.rs, exporting the trait here causes conflicts in this file
47-
pub(crate) mod pretaproot;
48-
4946
mod bare;
5047
mod segwitv0;
5148
mod sh;
@@ -448,36 +445,6 @@ impl<Pk: MiniscriptKey> Descriptor<Pk> {
448445
Descriptor::Tr(ref _tr) => DescriptorType::Tr,
449446
}
450447
}
451-
452-
/// .
453-
/// Convert a Descriptor into [`pretaproot::PreTaprootDescriptor`]
454-
/// # Examples
455-
///
456-
/// ```
457-
/// use std::str::FromStr;
458-
/// use miniscript::descriptor::Descriptor;
459-
/// use miniscript::{PreTaprootDescriptor, PreTaprootDescriptorTrait, ScriptCode};
460-
/// use miniscript::bitcoin;
461-
///
462-
/// // A descriptor with a string generic
463-
/// let desc = Descriptor::<bitcoin::PublicKey>::from_str("wpkh(02e18f242c8b0b589bfffeac30e1baa80a60933a649c7fb0f1103e78fbf58aa0ed)")
464-
/// .expect("Valid segwitv0 descriptor");
465-
/// let pre_tap_desc = desc.into_pre_taproot_desc().expect("Wsh is pre taproot");
466-
/// ```
467-
///
468-
/// # Errors
469-
///
470-
/// This function will return an error if descriptor is not a pre taproot descriptor.
471-
pub fn into_pre_taproot_desc(self) -> Result<pretaproot::PreTaprootDescriptor<Pk>, Self> {
472-
match self {
473-
Descriptor::Bare(bare) => Ok(pretaproot::PreTaprootDescriptor::Bare(bare)),
474-
Descriptor::Pkh(pkh) => Ok(pretaproot::PreTaprootDescriptor::Pkh(pkh)),
475-
Descriptor::Wpkh(wpkh) => Ok(pretaproot::PreTaprootDescriptor::Wpkh(wpkh)),
476-
Descriptor::Sh(sh) => Ok(pretaproot::PreTaprootDescriptor::Sh(sh)),
477-
Descriptor::Wsh(wsh) => Ok(pretaproot::PreTaprootDescriptor::Wsh(wsh)),
478-
Descriptor::Tr(tr) => Err(Descriptor::Tr(tr)),
479-
}
480-
}
481448
}
482449

483450
impl<P: MiniscriptKey, Q: MiniscriptKey> TranslatePk<P, Q> for Descriptor<P> {

src/descriptor/pretaproot.rs

Lines changed: 0 additions & 212 deletions
This file was deleted.

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ pub use crate::miniscript::decode::Terminal;
131131
pub use crate::miniscript::satisfy::{Preimage32, Satisfier};
132132
pub use crate::miniscript::Miniscript;
133133

134-
pub use crate::descriptor::pretaproot::{traits::PreTaprootDescriptorTrait, PreTaprootDescriptor};
135-
136134
///Public key trait which can be converted to Hash type
137135
pub trait MiniscriptKey: Clone + Eq + Ord + fmt::Debug + fmt::Display + hash::Hash {
138136
/// Returns true if the pubkey is uncompressed. Defaults to `false`.

0 commit comments

Comments
 (0)