From: Leonardo Lima Date: Wed, 20 Nov 2024 04:33:37 +0000 (-0300) Subject: chore(core)!: rename `FullScanResult` to `FullScanResponse` X-Git-Tag: v1.0.0-beta.6~17^2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.MemoryDatabase.html?a=commitdiff_plain;h=3b03c7bed2d132fbcdb027a8445f47f0b85d99fa;p=bdk chore(core)!: rename `FullScanResult` to `FullScanResponse` --- diff --git a/crates/core/src/spk_client.rs b/crates/core/src/spk_client.rs index e4090fb1..eee4a537 100644 --- a/crates/core/src/spk_client.rs +++ b/crates/core/src/spk_client.rs @@ -459,7 +459,7 @@ impl FullScanRequest { /// See also [`FullScanRequest`]. #[must_use] #[derive(Debug)] -pub struct FullScanResult { +pub struct FullScanResponse { /// Relevant transaction data discovered during the scan. pub tx_update: crate::TxUpdate, /// Last active indices for the corresponding keychains (`K`). An index is active if it had a @@ -469,7 +469,7 @@ pub struct FullScanResult { pub chain_update: Option, } -impl Default for FullScanResult { +impl Default for FullScanResponse { fn default() -> Self { Self { tx_update: Default::default(), diff --git a/crates/electrum/src/bdk_electrum_client.rs b/crates/electrum/src/bdk_electrum_client.rs index e05e0db2..f9e53bff 100644 --- a/crates/electrum/src/bdk_electrum_client.rs +++ b/crates/electrum/src/bdk_electrum_client.rs @@ -1,7 +1,7 @@ use bdk_core::{ bitcoin::{block::Header, BlockHash, OutPoint, ScriptBuf, Transaction, Txid}, collections::{BTreeMap, HashMap}, - spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResponse}, + spk_client::{FullScanRequest, FullScanResponse, SyncRequest, SyncResponse}, BlockId, CheckPoint, ConfirmationBlockTime, TxUpdate, }; use electrum_client::{ElectrumApi, Error, HeaderNotification}; @@ -126,7 +126,7 @@ impl BdkElectrumClient { stop_gap: usize, batch_size: usize, fetch_prev_txouts: bool, - ) -> Result, Error> { + ) -> Result, Error> { let mut request: FullScanRequest = request.into(); let tip_and_latest_blocks = match request.chain_tip() { @@ -159,7 +159,7 @@ impl BdkElectrumClient { _ => None, }; - Ok(FullScanResult { + Ok(FullScanResponse { tx_update, chain_update, last_active_indices, diff --git a/crates/electrum/src/lib.rs b/crates/electrum/src/lib.rs index 797fc2c6..8bc87321 100644 --- a/crates/electrum/src/lib.rs +++ b/crates/electrum/src/lib.rs @@ -1,7 +1,7 @@ //! This crate is used for returning updates from Electrum servers. //! //! Updates are returned as either a [`SyncResponse`] (if [`BdkElectrumClient::sync()`] is called), -//! or a [`FullScanResult`] (if [`BdkElectrumClient::full_scan()`] is called). +//! or a [`FullScanResponse`] (if [`BdkElectrumClient::full_scan()`] is called). //! //! In most cases [`BdkElectrumClient::sync()`] is used to sync the transaction histories of scripts //! that the application cares about, for example the scripts for all the receive addresses of a @@ -15,7 +15,7 @@ //! //! [`example_electrum`]: https://github.com/bitcoindevkit/bdk/tree/master/example-crates/example_electrum //! [`SyncResponse`]: bdk_core::spk_client::SyncResponse -//! [`FullScanResult`]: bdk_core::spk_client::FullScanResult +//! [`FullScanResponse`]: bdk_core::spk_client::FullScanResponse #![warn(missing_docs)] diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index 344f8dea..b9b7fa56 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -1,6 +1,6 @@ use async_trait::async_trait; use bdk_core::collections::{BTreeMap, BTreeSet, HashSet}; -use bdk_core::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResponse}; +use bdk_core::spk_client::{FullScanRequest, FullScanResponse, SyncRequest, SyncResponse}; use bdk_core::{ bitcoin::{BlockHash, OutPoint, ScriptBuf, Txid}, BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate, @@ -32,7 +32,7 @@ pub trait EsploraAsyncExt { request: R, stop_gap: usize, parallel_requests: usize, - ) -> Result, Error>; + ) -> Result, Error>; /// Sync a set of scripts, txids, and/or outpoints against Esplora. /// @@ -56,7 +56,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient { request: R, stop_gap: usize, parallel_requests: usize, - ) -> Result, Error> { + ) -> Result, Error> { let mut request = request.into(); let keychains = request.keychains(); @@ -93,7 +93,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient { _ => None, }; - Ok(FullScanResult { + Ok(FullScanResponse { chain_update, tx_update, last_active_indices, diff --git a/crates/esplora/src/blocking_ext.rs b/crates/esplora/src/blocking_ext.rs index 3e57cf0b..655055b3 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -1,5 +1,5 @@ use bdk_core::collections::{BTreeMap, BTreeSet, HashSet}; -use bdk_core::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResponse}; +use bdk_core::spk_client::{FullScanRequest, FullScanResponse, SyncRequest, SyncResponse}; use bdk_core::{ bitcoin::{BlockHash, OutPoint, ScriptBuf, Txid}, BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate, @@ -30,7 +30,7 @@ pub trait EsploraExt { request: R, stop_gap: usize, parallel_requests: usize, - ) -> Result, Error>; + ) -> Result, Error>; /// Sync a set of scripts, txids, and/or outpoints against Esplora. /// @@ -52,7 +52,7 @@ impl EsploraExt for esplora_client::BlockingClient { request: R, stop_gap: usize, parallel_requests: usize, - ) -> Result, Error> { + ) -> Result, Error> { let mut request = request.into(); let chain_tip = request.chain_tip(); @@ -90,7 +90,7 @@ impl EsploraExt for esplora_client::BlockingClient { _ => None, }; - Ok(FullScanResult { + Ok(FullScanResponse { chain_update, tx_update, last_active_indices, diff --git a/crates/wallet/src/wallet/mod.rs b/crates/wallet/src/wallet/mod.rs index 8f722151..17bccb67 100644 --- a/crates/wallet/src/wallet/mod.rs +++ b/crates/wallet/src/wallet/mod.rs @@ -26,7 +26,7 @@ use bdk_chain::{ indexer::keychain_txout::KeychainTxOutIndex, local_chain::{ApplyHeaderError, CannotConnectError, CheckPoint, CheckPointIter, LocalChain}, spk_client::{ - FullScanRequest, FullScanRequestBuilder, FullScanResult, SyncRequest, SyncRequestBuilder, + FullScanRequest, FullScanRequestBuilder, FullScanResponse, SyncRequest, SyncRequestBuilder, SyncResponse, }, tx_graph::{CalculateFeeError, CanonicalTx, TxGraph, TxUpdate}, @@ -132,8 +132,8 @@ pub struct Update { pub chain: Option, } -impl From> for Update { - fn from(value: FullScanResult) -> Self { +impl From> for Update { + fn from(value: FullScanResponse) -> Self { Self { last_active_indices: value.last_active_indices, tx_update: value.tx_update,