]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#2012: Add functions to test persistence master github/master
authormerge-script <hello@evanlinjin.me>
Mon, 26 Oct 2026 10:17:09 +0000 (21:17 +1100)
committermerge-script <hello@evanlinjin.me>
Mon, 26 Oct 2026 10:17:09 +0000 (21:17 +1100)
commitf2528da88b1041bdddf547d677511aea19ad3573
tree38f8de4a8cf47c7b3dbd5051f94e4ac85dd81375
parent7b68d280995da724ff8588f48a6b34666db4a9dd
parentc537631be11b731f6833c0523bd2c81699edd908
Merge bitcoindevkit/bdk#2012: Add functions to test persistence

c537631be11b731f6833c0523bd2c81699edd908 test(file_store): test `Store` persistence with `assert_persist_changesets` (codingp110)
206f9d01a40f5e4509bfcce57da219a7246727a1 test(chain): test rusqlite persistence with `assert_persist_changesets` (codingp110)
73dc5cd3815c57aa80773d48131e2f88143adc68 feat(testenv): add `persist_test_utils` for testing persistence backends (codingp110)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  Added a helper `assert_persist_changesets` to the testenv for testing custom persistence backends. Partially solves [bdk_wallet#14](https://github.com/bitcoindevkit/bdk_wallet/issues/14) and might help with [bdk_wallet#234](https://github.com/bitcoindevkit/bdk_wallet/issues/234).

  <!-- Describe the purpose of this PR, what's being adding and/or fixed -->

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ### Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  ```
  Added
     - `miniscript` feature to testenv which depends on `bdk_chain/miniscript` .
      - `assert_persist_changesets` to testenv to check `ChangeSet`s are persisted properly.
      - `tx_graph_changesets`, `keychain_txout_changesets`, `local_chain_changesets` which provide changesets
      to be used as arguments to `assert_persist_changesets`.
      - `create_test_tx`, `spk_at_index`,`parse_descriptor`, `create_txout` helpers to testenv for creating changesets for testing.
   Changed
     - default feature of testenv to also activate `miniscript` feature.
  ```

  ### Todo
  * [x] Add docs
  * [x] Add tests to bdk_chain based on testenv utilities

  ### 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
  * [x] I've added docs for the new feature

ACKs for top commit:
  evanlinjin:
    ACK c537631be11b731f6833c0523bd2c81699edd908
  tvpeter:
    ACK c537631be11b731f6833c0523bd2c81699edd908

Tree-SHA512: 1560443445e40bd801635ede9ac4d8e1f95dd19249dbc61ecc170d7aeac7e1e569d0c47da08c2131526e55e7335366f5447b9338e56f91aa53d66373ea8642bb
crates/file_store/src/store.rs