From: 志宇 Date: Wed, 1 May 2024 06:58:41 +0000 (+0800) Subject: Merge bitcoindevkit/bdk#1413: Introduce universal sync/full-scan structures for spk... X-Git-Tag: v1.0.0-alpha.10~2 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CommandStringError.html?a=commitdiff_plain;h=08fac47c2921ffd8d8e1b8d223bc89ae7e94abb1;p=bdk Merge bitcoindevkit/bdk#1413: Introduce universal sync/full-scan structures for spk-based syncing c0374a0eeb155f1cb4f9d99223f6bc65d24f7df8 feat(chain): `SyncRequest` now uses `ExactSizeIterator`s (志宇) 0f94f24aaf6374fe2d7c2abf32a870d3849fb8cc feat(esplora)!: update to use new sync/full-scan structures (志宇) 4c52f3e08e85e73db379ee3411cceb8dbcec92e1 feat(wallet): make wallet compatible with sync/full-scan structures (志宇) cdfec5f90726f2313963c3a71e5d18bb10624736 feat(chain): add sync/full-scan structures for spk-based syncing (志宇) Pull request description: Fixes #1153 Replaces #1194 ### Description Introduce universal structures that represent sync/full-scan requests/results. ### Notes to the reviewers This is based on #1194 but is different in the following ways: * The functionality to print scan/sync progress is not reduced. * `SyncRequest` and `FullScanRequest` is simplified and fields are exposed for more flexibility. ### Changelog notice * Add universal structures for initiating/receiving sync/full-scan requests/results for spk-based syncing. * Updated `bdk_esplora` chain-source to make use of new universal sync/full-scan structures. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### New Features: * [x] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: notmandatory: tACK c0374a0eeb155f1cb4f9d99223f6bc65d24f7df8 Tree-SHA512: c2ad66d972a6785079bca615dfd128edcedf6b7a02670651a0ab1ce5b5174dd96f54644680eedbf55e3f1955fe5c34f632eadbd3f71d7ffde658753c6c6d42be --- 08fac47c2921ffd8d8e1b8d223bc89ae7e94abb1 diff --cc crates/bdk/src/wallet/mod.rs index 1fe37d55,b959a3ad..cbe1a824 --- a/crates/bdk/src/wallet/mod.rs +++ b/crates/bdk/src/wallet/mod.rs @@@ -26,11 -26,11 +26,12 @@@ use bdk_chain:: local_chain::{ self, ApplyHeaderError, CannotConnectError, CheckPoint, CheckPointIter, LocalChain, }, + spk_client::{FullScanRequest, FullScanResult, SyncRequest, SyncResult}, tx_graph::{CanonicalTx, TxGraph}, Append, BlockId, ChainPosition, ConfirmationTime, ConfirmationTimeHeightAnchor, FullTxOut, - IndexedTxGraph, Persist, PersistBackend, + IndexedTxGraph, }; +use bdk_persist::{Persist, PersistBackend}; use bitcoin::constants::genesis_block; use bitcoin::secp256k1::{All, Secp256k1}; use bitcoin::sighash::{EcdsaSighashType, TapSighashType};