From 2ba89a6d16ae44deeeb526716e8ca8b6b06dd997 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Tue, 12 Mar 2024 17:43:06 -0600 Subject: [PATCH] zcash_client_backend: Fix `scan_cached_blocks` example doc compilation errors. --- zcash_client_backend/src/data_api/chain.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zcash_client_backend/src/data_api/chain.rs b/zcash_client_backend/src/data_api/chain.rs index cfd4516ca..cb4e14e40 100644 --- a/zcash_client_backend/src/data_api/chain.rs +++ b/zcash_client_backend/src/data_api/chain.rs @@ -58,9 +58,12 @@ //! // the first element of the vector of suggested ranges. //! match scan_ranges.first() { //! Some(scan_range) if scan_range.priority() == ScanPriority::Verify => { +//! // Download the chain state for the block prior to the start of the range you want +//! // to scan. +//! let chain_state = unimplemented!("get_chain_state(scan_range.block_range().start - 1)?;"); //! // Download the blocks in `scan_range` into the block source, overwriting any //! // existing blocks in this range. -//! unimplemented!(); +//! unimplemented!("cache_blocks(scan_range)?;"); //! //! // Scan the downloaded blocks //! let scan_result = scan_cached_blocks( @@ -68,6 +71,7 @@ //! &block_source, //! &mut wallet_db, //! scan_range.block_range().start, +//! chain_state, //! scan_range.len() //! ); //! @@ -118,6 +122,9 @@ //! // encountered, this process should be repeated starting at step (3). //! let scan_ranges = wallet_db.suggest_scan_ranges().map_err(Error::Wallet)?; //! for scan_range in scan_ranges { +//! // Download the chain state for the block prior to the start of the range you want +//! // to scan. +//! let chain_state = unimplemented!("get_chain_state(scan_range.block_range().start - 1)?;"); //! // Download the blocks in `scan_range` into the block source. While in this example this //! // step is performed in-line, it's fine for the download of scan ranges to be asynchronous //! // and for the scanner to process the downloaded ranges as they become available in a @@ -125,7 +132,7 @@ //! // appropriate, and for ranges with priority `Historic` it can be useful to download and //! // scan the range in reverse order (to discover more recent unspent notes sooner), or from //! // the start and end of the range inwards. -//! unimplemented!(); +//! unimplemented!("cache_blocks(scan_range)?;"); //! //! // Scan the downloaded blocks. //! let scan_result = scan_cached_blocks( @@ -133,6 +140,7 @@ //! &block_source, //! &mut wallet_db, //! scan_range.block_range().start, +//! chain_state, //! scan_range.len() //! )?; //!