From: valued mammal Date: Fri, 30 May 2025 17:22:07 +0000 (-0400) Subject: docs(chain): Improve API docs X-Git-Tag: bitcoind_rpc-0.21.0~15^2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/static/enum.IncompleteBuilderError.html?a=commitdiff_plain;h=f51f5b5659941a68b74e5b142296a8aaf9665afa;p=bdk docs(chain): Improve API docs Fixed parameter names to match the function or struct definition, and correct some spelling mistakes. --- diff --git a/crates/chain/src/indexed_tx_graph.rs b/crates/chain/src/indexed_tx_graph.rs index 9ba3395e..431ff29e 100644 --- a/crates/chain/src/indexed_tx_graph.rs +++ b/crates/chain/src/indexed_tx_graph.rs @@ -112,7 +112,7 @@ where /// /// let (graph, reindex_cs) = /// IndexedTxGraph::from_changeset(persisted_changeset, move |idx_cs| -> anyhow::Result<_> { - /// // e.g. KeychainTxOutIndex needs descriptors that weren’t in its CS + /// // e.g. KeychainTxOutIndex needs descriptors that weren’t in its change set. /// let mut idx = KeychainTxOutIndex::from_changeset(DEFAULT_LOOKAHEAD, true, idx_cs); /// if let Some(desc) = persisted_desc { /// idx.insert_descriptor("external", desc)?; diff --git a/crates/chain/src/indexer/keychain_txout.rs b/crates/chain/src/indexer/keychain_txout.rs index 0aa2fbc8..44ebc796 100644 --- a/crates/chain/src/indexer/keychain_txout.rs +++ b/crates/chain/src/indexer/keychain_txout.rs @@ -200,7 +200,7 @@ impl Indexer for KeychainTxOutIndex { } impl KeychainTxOutIndex { - /// Construct a [`KeychainTxOutIndex`] with the given `lookahead` and `use_spk_cache` boolean. + /// Construct a [`KeychainTxOutIndex`] with the given `lookahead` and `persist_spks` boolean. /// /// # Lookahead /// @@ -221,10 +221,10 @@ impl KeychainTxOutIndex { /// /// ```rust /// # use bdk_chain::keychain_txout::KeychainTxOutIndex; - /// // Derive 20 future addresses per chain and persist + reload script pubkeys via ChangeSets: + /// // Derive 20 future addresses per keychain and persist + reload script pubkeys via ChangeSets: /// let idx = KeychainTxOutIndex::<&'static str>::new(20, true); /// - /// // Derive 10 future addresses per chain without persistence: + /// // Derive 10 future addresses per keychain without persistence: /// let idx = KeychainTxOutIndex::<&'static str>::new(10, false); /// ``` pub fn new(lookahead: u32, persist_spks: bool) -> Self { @@ -251,7 +251,7 @@ impl KeychainTxOutIndex { impl KeychainTxOutIndex { /// Construct `KeychainTxOutIndex` from the given `changeset`. /// - /// Shorthand for called [`new`] and then [`apply_changeset`]. + /// Shorthand for calling [`new`] and then [`apply_changeset`]. /// /// [`new`]: Self::new /// [`apply_changeset`]: Self::apply_changeset @@ -1002,7 +1002,7 @@ impl std::error::Error for InsertDescriptorError {} /// /// It tracks: /// 1. `last_revealed`: the highest derivation index revealed per descriptor. -/// 2. `spks`: the cache of derived script pubkeys to persist across runs. +/// 2. `spk_cache`: the cache of derived script pubkeys to persist across runs. /// /// You can apply a `ChangeSet` to a `KeychainTxOutIndex` via /// [`KeychainTxOutIndex::apply_changeset`], or merge two change sets with [`ChangeSet::merge`]. @@ -1011,7 +1011,7 @@ impl std::error::Error for InsertDescriptorError {} /// /// - `last_revealed` is monotonic: merging retains the maximum index for each descriptor and never /// decreases. -/// - `spks` accumulates entries: once a script pubkey is persisted, it remains available for +/// - `spk_cache` accumulates entries: once a script pubkey is persisted, it remains available for /// reload. If the same descriptor and index appear again with a new script pubkey, the latter /// value overrides the former. ///