]> Untitled Git - bdk/commitdiff
chore(core)!: rename `FullScanResult` to `FullScanResponse`
authorLeonardo Lima <oleonardolima@users.noreply.github.com>
Wed, 20 Nov 2024 04:33:37 +0000 (01:33 -0300)
committerLeonardo Lima <oleonardolima@users.noreply.github.com>
Wed, 20 Nov 2024 04:33:37 +0000 (01:33 -0300)
crates/core/src/spk_client.rs
crates/electrum/src/bdk_electrum_client.rs
crates/electrum/src/lib.rs
crates/esplora/src/async_ext.rs
crates/esplora/src/blocking_ext.rs
crates/wallet/src/wallet/mod.rs

index e4090fb1d14d27d3aa95c3a03899e16b01d54580..eee4a5371ee8e0c2f0365f6d3bf69f84da5db342 100644 (file)
@@ -459,7 +459,7 @@ impl<K: Ord + Clone> FullScanRequest<K> {
 /// See also [`FullScanRequest`].
 #[must_use]
 #[derive(Debug)]
-pub struct FullScanResult<K, A = ConfirmationBlockTime> {
+pub struct FullScanResponse<K, A = ConfirmationBlockTime> {
     /// Relevant transaction data discovered during the scan.
     pub tx_update: crate::TxUpdate<A>,
     /// Last active indices for the corresponding keychains (`K`). An index is active if it had a
@@ -469,7 +469,7 @@ pub struct FullScanResult<K, A = ConfirmationBlockTime> {
     pub chain_update: Option<CheckPoint>,
 }
 
-impl<K, A> Default for FullScanResult<K, A> {
+impl<K, A> Default for FullScanResponse<K, A> {
     fn default() -> Self {
         Self {
             tx_update: Default::default(),
index e05e0db2dd5c18f32f0a446078d52b3e59170edc..f9e53bff8b19a1bc1817ed1b02469cba6dc326af 100644 (file)
@@ -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<E: ElectrumApi> BdkElectrumClient<E> {
         stop_gap: usize,
         batch_size: usize,
         fetch_prev_txouts: bool,
-    ) -> Result<FullScanResult<K>, Error> {
+    ) -> Result<FullScanResponse<K>, Error> {
         let mut request: FullScanRequest<K> = request.into();
 
         let tip_and_latest_blocks = match request.chain_tip() {
@@ -159,7 +159,7 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
             _ => None,
         };
 
-        Ok(FullScanResult {
+        Ok(FullScanResponse {
             tx_update,
             chain_update,
             last_active_indices,
index 797fc2c64ac6a05e0a0318be8707b4dbd309eb15..8bc87321f8a1b31822e6e26a8182a65dd48e1c4c 100644 (file)
@@ -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)]
 
index 344f8dea0903a6a92ea130fdc8f00be0262f2531..b9b7fa5670716add1e8324d02b17b0a5862a4f9c 100644 (file)
@@ -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<FullScanResult<K>, Error>;
+    ) -> Result<FullScanResponse<K>, 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<FullScanResult<K>, Error> {
+    ) -> Result<FullScanResponse<K>, 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,
index 3e57cf0b65bd9ef980211e8cd1f4a3a84edbf768..655055b330657752eaa0b429e97f9dd486c43575 100644 (file)
@@ -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<FullScanResult<K>, Error>;
+    ) -> Result<FullScanResponse<K>, 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<FullScanResult<K>, Error> {
+    ) -> Result<FullScanResponse<K>, 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,
index 8f722151268d1c31a1dba8dda4936c93251fa56c..17bccb67088bd311082caf0989b43a639e706631 100644 (file)
@@ -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<CheckPoint>,
 }
 
-impl From<FullScanResult<KeychainKind>> for Update {
-    fn from(value: FullScanResult<KeychainKind>) -> Self {
+impl From<FullScanResponse<KeychainKind>> for Update {
+    fn from(value: FullScanResponse<KeychainKind>) -> Self {
         Self {
             last_active_indices: value.last_active_indices,
             tx_update: value.tx_update,