]> Untitled Git - bdk/commitdiff
[docs] Add docs to the 'descriptor' module
authorSteve Myers <steve@notmandatory.org>
Mon, 14 Dec 2020 04:36:38 +0000 (20:36 -0800)
committerSteve Myers <steve@notmandatory.org>
Mon, 14 Dec 2020 04:57:28 +0000 (20:57 -0800)
src/descriptor/error.rs
src/descriptor/mod.rs
src/descriptor/policy.rs

index 151487da3eb9e699130817a7ffe8b5d01293ac74..e470fea9c205738764e4212c09ab16423481592f 100644 (file)
@@ -35,9 +35,9 @@ pub enum Error {
     InvalidHDKeyPath,
 
     //KeyParsingError(String),
-    #[allow(missing_docs)]
+    /// Error thrown while working with [`keys`](crate::keys)
     Key(crate::keys::KeyError),
-    #[allow(missing_docs)]
+    /// Error while extracting and manipulating policies
     Policy(crate::descriptor::policy::PolicyError),
 
     //InputIndexDoesntExist,
@@ -47,15 +47,15 @@ pub enum Error {
     InvalidDescriptorCharacter(char),
 
     //CantDeriveWithMiniscript,
-    #[allow(missing_docs)]
+    /// BIP32 error
     BIP32(bitcoin::util::bip32::Error),
-    #[allow(missing_docs)]
+    /// Error during base58 decoding
     Base58(bitcoin::util::base58::Error),
-    #[allow(missing_docs)]
+    /// Key-related error
     PK(bitcoin::util::key::Error),
-    #[allow(missing_docs)]
+    /// Miniscript error
     Miniscript(miniscript::Error),
-    #[allow(missing_docs)]
+    /// Hex decoding error
     Hex(bitcoin::hashes::hex::Error),
 }
 
index 4a82df34e3510c92e00174675ea9a0dc2ff3df4a..ec00133fb308e5a706ab6c3fd67483559795f162 100644 (file)
@@ -45,7 +45,6 @@ pub mod checksum;
 mod dsl;
 pub mod error;
 pub mod policy;
-#[allow(missing_docs)] // TODO add missing docs and remove this allow
 pub mod template;
 
 pub use self::checksum::get_checksum;
@@ -65,9 +64,9 @@ pub type ExtendedDescriptor = Descriptor<DescriptorPublicKey>;
 /// [`psbt::Output`]: bitcoin::util::psbt::Output
 pub type HDKeyPaths = BTreeMap<PublicKey, (Fingerprint, DerivationPath)>;
 
-#[allow(missing_docs)] // TODO add missing docs and remove this allow
 /// Trait for types which can be converted into an [`ExtendedDescriptor`] and a [`KeyMap`] usable by a wallet in a specific [`Network`]
 pub trait ToWalletDescriptor {
+    /// Convert to wallet descriptor
     fn to_wallet_descriptor(
         self,
         network: Network,
@@ -187,9 +186,9 @@ impl ToWalletDescriptor for (ExtendedDescriptor, KeyMap, ValidNetworks) {
     }
 }
 
-#[allow(missing_docs)] // TODO add missing docs and remove this allow
 /// Trait implemented on [`Descriptor`]s to add a method to extract the spending [`policy`]
 pub trait ExtractPolicy {
+    /// Extract the spending [`policy`]
     fn extract_policy(
         &self,
         signers: &SignersContainer,
index 37b18dd227ef47a1a6a498b7c6c07a74cf8aa363..d14d2da40bcab65d21385c9f34f89cbcae9fcb77 100644 (file)
@@ -139,7 +139,7 @@ pub enum SatisfiableItem {
     },
     /// Relative timelock locktime
     RelativeTimelock {
-        /// The timelock value
+        /// The locktime value
         value: u32,
     },
     /// Multi-signature public keys with threshold count