Skip to content

Commit 998fc61

Browse files
committed
chore(core)!: rename SyncResult to SyncResponse
1 parent 3bc45b5 commit 998fc61

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

crates/core/src/spk_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,14 @@ impl<I> SyncRequest<I> {
322322
/// See also [`SyncRequest`].
323323
#[must_use]
324324
#[derive(Debug)]
325-
pub struct SyncResult<A = ConfirmationBlockTime> {
325+
pub struct SyncResponse<A = ConfirmationBlockTime> {
326326
/// Relevant transaction data discovered during the scan.
327327
pub tx_update: crate::TxUpdate<A>,
328328
/// Changes to the chain discovered during the scan.
329329
pub chain_update: Option<CheckPoint>,
330330
}
331331

332-
impl<A> Default for SyncResult<A> {
332+
impl<A> Default for SyncResponse<A> {
333333
fn default() -> Self {
334334
Self {
335335
tx_update: Default::default(),

crates/electrum/src/bdk_electrum_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bdk_core::{
22
bitcoin::{block::Header, BlockHash, OutPoint, ScriptBuf, Transaction, Txid},
33
collections::{BTreeMap, HashMap},
4-
spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult},
4+
spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResponse},
55
BlockId, CheckPoint, ConfirmationBlockTime, TxUpdate,
66
};
77
use electrum_client::{ElectrumApi, Error, HeaderNotification};
@@ -194,7 +194,7 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
194194
request: impl Into<SyncRequest<I>>,
195195
batch_size: usize,
196196
fetch_prev_txouts: bool,
197-
) -> Result<SyncResult, Error> {
197+
) -> Result<SyncResponse, Error> {
198198
let mut request: SyncRequest<I> = request.into();
199199

200200
let tip_and_latest_blocks = match request.chain_tip() {
@@ -229,7 +229,7 @@ impl<E: ElectrumApi> BdkElectrumClient<E> {
229229
None => None,
230230
};
231231

232-
Ok(SyncResult {
232+
Ok(SyncResponse {
233233
tx_update,
234234
chain_update,
235235
})

crates/electrum/tests/test_electrum.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use bdk_chain::{
22
bitcoin::{hashes::Hash, Address, Amount, ScriptBuf, WScriptHash},
33
local_chain::LocalChain,
4-
spk_client::{FullScanRequest, SyncRequest, SyncResult},
4+
spk_client::{FullScanRequest, SyncRequest, SyncResponse},
55
spk_txout::SpkTxOutIndex,
66
Balance, ConfirmationBlockTime, IndexedTxGraph, Indexer, Merge, TxGraph,
77
};
@@ -31,7 +31,7 @@ fn sync_with_electrum<I, Spks>(
3131
spks: Spks,
3232
chain: &mut LocalChain,
3333
graph: &mut IndexedTxGraph<ConfirmationBlockTime, I>,
34-
) -> anyhow::Result<SyncResult>
34+
) -> anyhow::Result<SyncResponse>
3535
where
3636
I: Indexer,
3737
I::ChangeSet: Default + Merge,

crates/esplora/src/async_ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use async_trait::async_trait;
22
use bdk_core::collections::{BTreeMap, BTreeSet, HashSet};
3-
use bdk_core::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult};
3+
use bdk_core::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResponse};
44
use bdk_core::{
55
bitcoin::{BlockHash, OutPoint, ScriptBuf, Txid},
66
BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate,
@@ -45,7 +45,7 @@ pub trait EsploraAsyncExt {
4545
&self,
4646
request: R,
4747
parallel_requests: usize,
48-
) -> Result<SyncResult, Error>;
48+
) -> Result<SyncResponse, Error>;
4949
}
5050

5151
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
@@ -104,7 +104,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient {
104104
&self,
105105
request: R,
106106
parallel_requests: usize,
107-
) -> Result<SyncResult, Error> {
107+
) -> Result<SyncResponse, Error> {
108108
let mut request = request.into();
109109

110110
let chain_tip = request.chain_tip();
@@ -151,7 +151,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient {
151151
_ => None,
152152
};
153153

154-
Ok(SyncResult {
154+
Ok(SyncResponse {
155155
chain_update,
156156
tx_update,
157157
})

crates/esplora/src/blocking_ext.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bdk_core::collections::{BTreeMap, BTreeSet, HashSet};
2-
use bdk_core::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult};
2+
use bdk_core::spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResponse};
33
use bdk_core::{
44
bitcoin::{BlockHash, OutPoint, ScriptBuf, Txid},
55
BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate,
@@ -43,7 +43,7 @@ pub trait EsploraExt {
4343
&self,
4444
request: R,
4545
parallel_requests: usize,
46-
) -> Result<SyncResult, Error>;
46+
) -> Result<SyncResponse, Error>;
4747
}
4848

4949
impl EsploraExt for esplora_client::BlockingClient {
@@ -101,7 +101,7 @@ impl EsploraExt for esplora_client::BlockingClient {
101101
&self,
102102
request: R,
103103
parallel_requests: usize,
104-
) -> Result<SyncResult, Error> {
104+
) -> Result<SyncResponse, Error> {
105105
let mut request: SyncRequest<I> = request.into();
106106

107107
let chain_tip = request.chain_tip();
@@ -142,7 +142,7 @@ impl EsploraExt for esplora_client::BlockingClient {
142142
_ => None,
143143
};
144144

145-
Ok(SyncResult {
145+
Ok(SyncResponse {
146146
chain_update,
147147
tx_update,
148148
})

crates/wallet/src/wallet/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use bdk_chain::{
2727
local_chain::{ApplyHeaderError, CannotConnectError, CheckPoint, CheckPointIter, LocalChain},
2828
spk_client::{
2929
FullScanRequest, FullScanRequestBuilder, FullScanResult, SyncRequest, SyncRequestBuilder,
30-
SyncResult,
30+
SyncResponse,
3131
},
3232
tx_graph::{CalculateFeeError, CanonicalTx, TxGraph, TxUpdate},
3333
BlockId, ChainPosition, ConfirmationBlockTime, DescriptorExt, FullTxOut, Indexed,
@@ -142,8 +142,8 @@ impl From<FullScanResult<KeychainKind>> for Update {
142142
}
143143
}
144144

145-
impl From<SyncResult> for Update {
146-
fn from(value: SyncResult) -> Self {
145+
impl From<SyncResponse> for Update {
146+
fn from(value: SyncResponse) -> Self {
147147
Self {
148148
last_active_indices: BTreeMap::new(),
149149
tx_update: value.tx_update,

0 commit comments

Comments
 (0)