Skip to content

Commit f51f5b5

Browse files
committed
docs(chain): Improve API docs
Fixed parameter names to match the function or struct definition, and correct some spelling mistakes.
1 parent fcf3834 commit f51f5b5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

crates/chain/src/indexed_tx_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ where
112112
///
113113
/// let (graph, reindex_cs) =
114114
/// IndexedTxGraph::from_changeset(persisted_changeset, move |idx_cs| -> anyhow::Result<_> {
115-
/// // e.g. KeychainTxOutIndex needs descriptors that weren’t in its CS
115+
/// // e.g. KeychainTxOutIndex needs descriptors that weren’t in its change set.
116116
/// let mut idx = KeychainTxOutIndex::from_changeset(DEFAULT_LOOKAHEAD, true, idx_cs);
117117
/// if let Some(desc) = persisted_desc {
118118
/// idx.insert_descriptor("external", desc)?;

crates/chain/src/indexer/keychain_txout.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<K: Clone + Ord + Debug> Indexer for KeychainTxOutIndex<K> {
200200
}
201201

202202
impl<K> KeychainTxOutIndex<K> {
203-
/// Construct a [`KeychainTxOutIndex`] with the given `lookahead` and `use_spk_cache` boolean.
203+
/// Construct a [`KeychainTxOutIndex`] with the given `lookahead` and `persist_spks` boolean.
204204
///
205205
/// # Lookahead
206206
///
@@ -221,10 +221,10 @@ impl<K> KeychainTxOutIndex<K> {
221221
///
222222
/// ```rust
223223
/// # use bdk_chain::keychain_txout::KeychainTxOutIndex;
224-
/// // Derive 20 future addresses per chain and persist + reload script pubkeys via ChangeSets:
224+
/// // Derive 20 future addresses per keychain and persist + reload script pubkeys via ChangeSets:
225225
/// let idx = KeychainTxOutIndex::<&'static str>::new(20, true);
226226
///
227-
/// // Derive 10 future addresses per chain without persistence:
227+
/// // Derive 10 future addresses per keychain without persistence:
228228
/// let idx = KeychainTxOutIndex::<&'static str>::new(10, false);
229229
/// ```
230230
pub fn new(lookahead: u32, persist_spks: bool) -> Self {
@@ -251,7 +251,7 @@ impl<K> KeychainTxOutIndex<K> {
251251
impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K> {
252252
/// Construct `KeychainTxOutIndex<K>` from the given `changeset`.
253253
///
254-
/// Shorthand for called [`new`] and then [`apply_changeset`].
254+
/// Shorthand for calling [`new`] and then [`apply_changeset`].
255255
///
256256
/// [`new`]: Self::new
257257
/// [`apply_changeset`]: Self::apply_changeset
@@ -1002,7 +1002,7 @@ impl<K: core::fmt::Debug> std::error::Error for InsertDescriptorError<K> {}
10021002
///
10031003
/// It tracks:
10041004
/// 1. `last_revealed`: the highest derivation index revealed per descriptor.
1005-
/// 2. `spks`: the cache of derived script pubkeys to persist across runs.
1005+
/// 2. `spk_cache`: the cache of derived script pubkeys to persist across runs.
10061006
///
10071007
/// You can apply a `ChangeSet` to a `KeychainTxOutIndex` via
10081008
/// [`KeychainTxOutIndex::apply_changeset`], or merge two change sets with [`ChangeSet::merge`].
@@ -1011,7 +1011,7 @@ impl<K: core::fmt::Debug> std::error::Error for InsertDescriptorError<K> {}
10111011
///
10121012
/// - `last_revealed` is monotonic: merging retains the maximum index for each descriptor and never
10131013
/// decreases.
1014-
/// - `spks` accumulates entries: once a script pubkey is persisted, it remains available for
1014+
/// - `spk_cache` accumulates entries: once a script pubkey is persisted, it remains available for
10151015
/// reload. If the same descriptor and index appear again with a new script pubkey, the latter
10161016
/// value overrides the former.
10171017
///

0 commit comments

Comments
 (0)