]> Untitled Git - bdk/commitdiff
Merge bitcoindevkit/bdk#1413: Introduce universal sync/full-scan structures for spk...
author志宇 <hello@evanlinjin.me>
Wed, 1 May 2024 06:58:41 +0000 (14:58 +0800)
committer志宇 <hello@evanlinjin.me>
Wed, 1 May 2024 06:59:01 +0000 (14:59 +0800)
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

1  2 
crates/bdk/src/wallet/mod.rs
crates/chain/src/lib.rs

index 1fe37d5508cdc6a63d73a16f2705c51d0563b265,b959a3adac5ff8a494c4cbdd96ea59dae71e70bd..cbe1a82416ec6fac8db15a0b9fe1c1607cbf159e
@@@ -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};
Simple merge