]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#2417: fix(core): generalize is_empty for SyncResponse and... master github/master
authormerge-script <hello@evanlinjin.me>
Thu, 22 Oct 2026 03:20:52 +0000 (14:20 +1100)
committermerge-script <hello@evanlinjin.me>
Thu, 22 Oct 2026 03:20:52 +0000 (14:20 +1100)
commit7b68d280995da724ff8588f48a6b34666db4a9dd
tree8ea576febc42b7190731620c60dd8a10fd440bdc
parentd02f8909171af695fcb078c6fca082833f835b86
parentcb1deabcac7a1ad19742f117656ebc08bb14d2ab
Merge bitcoindevkit/bdk#2417: fix(core): generalize is_empty for SyncResponse and FullScanResponse and derive Clone, PartialEq

cb1deabcac7a1ad19742f117656ebc08bb14d2ab fix(core): generalize is_empty for SyncResponse and FullScanResponse and derive Clone, PartialEq (bhuvan-somisetty)

Pull request description:

  ### Description

  Fixes #2416.

  `SyncResponse` and `FullScanResponse` support custom checkpoint data types via their second generic parameter `D`:
  ```rust
  pub struct SyncResponse<A = ConfirmationBlockTime, D = BlockHash>
  pub struct FullScanResponse<K, A = ConfirmationBlockTime, D = BlockHash>
  ```
  While their `Default` implementations are generic over `D`, their `is_empty()` methods were previously declared as:
  ```rust
  impl<A> SyncResponse<A>
  impl<K, A> FullScanResponse<K, A>
  ```
  which constrained `is_empty()` to `D = BlockHash`, causing compilation failures when called on responses with custom checkpoint data types.

  This PR:
  - Changes `impl<A> SyncResponse<A>` to `impl<A, D> SyncResponse<A, D>`, making `is_empty()` available for any checkpoint type `D`.
  - Changes `impl<K, A> FullScanResponse<K, A>` to `impl<K, A, D> FullScanResponse<K, A, D>`.
  - Adds `Clone` and `PartialEq` derives to `SyncResponse`, `FullScanResponse`, and `TxUpdate`.
  - Adds `test_empty` assertions calling `is_empty()` on responses with a custom checkpoint type (these fail to compile without the fix).

  ### Notes to the reviewers

  Non-breaking change. Existing code using the default `D = BlockHash` continues to work unchanged.

  ### Changelog notice

  ### Fixed
  - `bdk_core`: `SyncResponse::is_empty` and `FullScanResponse::is_empty` are now generic over all checkpoint data types `D`. #2417

  ### Added
  - `bdk_core`: Derived `Clone` and `PartialEq` on `SyncResponse`, `FullScanResponse`, and `TxUpdate`. #2417

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

  #### New Features:

  * [x] I've added tests for the new feature
  * [ ] I've added docs for the new feature

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [x] I've added tests to reproduce the issue which are now passing
  * [x] I'm linking the issue being fixed by this PR

Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
ACKs for top commit:
  evanlinjin:
    ACK cb1deabcac7a1ad19742f117656ebc08bb14d2ab

Tree-SHA512: 150678735eaddf929c051c0eeef112edee8d70344c17c2846d85dc89baa7075e92273536b6bdf84120d481ca726f45b26452c062683664536fc09ab1394146f3