From 9ed33c25ea01278b0a47c8ecd5ea6fa33119a977 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Mon, 6 May 2024 15:46:49 +0800 Subject: [PATCH] docs(electrum): fixed `full_scan`, `sync`, and crate documentation --- crates/electrum/src/electrum_ext.rs | 14 ++++---------- crates/electrum/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/electrum/src/electrum_ext.rs b/crates/electrum/src/electrum_ext.rs index af5963052..a746c52cf 100644 --- a/crates/electrum/src/electrum_ext.rs +++ b/crates/electrum/src/electrum_ext.rs @@ -18,9 +18,8 @@ pub trait ElectrumExt { /// Full scan the keychain scripts specified with the blockchain (via an Electrum client) and /// returns updates for [`bdk_chain`] data structures. /// - /// - `prev_tip`: the most recent blockchain tip present locally - /// - `keychain_spks`: keychains that we want to scan transactions for - /// - `full_txs`: [`TxGraph`] that contains all previously known transactions + /// - `request`: struct with data required to perform a spk-based blockchain client full scan, + /// see [`FullScanRequest`] /// /// The full scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated /// transactions. `batch_size` specifies the max number of script pubkeys to request for in a @@ -35,12 +34,8 @@ pub trait ElectrumExt { /// Sync a set of scripts with the blockchain (via an Electrum client) for the data specified /// and returns updates for [`bdk_chain`] data structures. /// - /// - `prev_tip`: the most recent blockchain tip present locally - /// - `misc_spks`: an iterator of scripts we want to sync transactions for - /// - `full_txs`: [`TxGraph`] that contains all previously known transactions - /// - `txids`: transactions for which we want updated [`bdk_chain::Anchor`]s - /// - `outpoints`: transactions associated with these outpoints (residing, spending) that we - /// want to include in the update + /// - `request`: struct with data required to perform a spk-based blockchain client sync, + /// see [`SyncRequest`] /// /// `batch_size` specifies the max number of script pubkeys to request for in a single batch /// request. @@ -450,7 +445,6 @@ fn populate_with_txids( }; if graph_update.get_tx(txid).is_none() { - // TODO: We need to be able to insert an `Arc` of a transaction. let _ = graph_update.insert_tx(tx); } if let Some(anchor) = anchor { diff --git a/crates/electrum/src/lib.rs b/crates/electrum/src/lib.rs index f645653e4..eaa2405bf 100644 --- a/crates/electrum/src/lib.rs +++ b/crates/electrum/src/lib.rs @@ -7,7 +7,7 @@ //! keychain where the range of possibly used scripts is not known. In this case it is necessary to //! scan all keychain scripts until a number (the "stop gap") of unused scripts is discovered. For a //! sync or full scan the user receives relevant blockchain data and output updates for -//! [`bdk_chain`] including [`bdk_chain::TxGraph`], which includes `txid`s and full transactions. +//! [`bdk_chain`]. //! //! Refer to [`example_electrum`] for a complete example. //!