Skip to content

Add utilities to test persistence#300

Merged
ValuedMammal merged 4 commits intobitcoindevkit:masterfrom
110CodingP:add_persist_test_utils
Sep 5, 2025
Merged

Add utilities to test persistence#300
ValuedMammal merged 4 commits intobitcoindevkit:masterfrom
110CodingP:add_persist_test_utils

Conversation

@110CodingP
Copy link
Copy Markdown
Collaborator

@110CodingP 110CodingP commented Aug 19, 2025

Description

Added some basic functions to test WalletPersister impl. Fixes #14 and might help with #234 .

Changelog notice

Added
    - functions to test `WalletPersister` impl of custom persistence backends.
    - tests for file_store and rusqlite based on persistence testing functions added

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Added the following functions:-
  - `persist_wallet_changeset`: tests if each field of wallet ChangeSet
  is persisted.
  - `persist_multiple_wallet_changesets`: tests if multiple wallets can
  be persisted in a single file.
  - `persist_network`: tests if network is persisted
  - `persist_keychains`: tests if descriptors are persisted
  - `persist_single_keychain`: tests if descriptor in single keychain
  wallet is persisted.
Used persist_test_utils to test WalletPersister impl of file_store and
rusqlite.
@110CodingP 110CodingP force-pushed the add_persist_test_utils branch from 621ad7b to abcf868 Compare August 23, 2025 13:35
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 17176091820

Details

  • 214 of 256 (83.59%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.04%) to 84.871%

Changes Missing Coverage Covered Lines Changed/Added Lines %
wallet/src/persist_test_utils.rs 214 256 83.59%
Totals Coverage Status
Change from base Build 17132535147: -0.04%
Covered Lines: 6883
Relevant Lines: 8110

💛 - Coveralls

@ValuedMammal ValuedMammal moved this from In Progress to Needs Review in BDK Wallet Aug 24, 2025
@ValuedMammal
Copy link
Copy Markdown
Collaborator

Looks good overall. I haven't noticed any issues 👍

Copy link
Copy Markdown
Collaborator

@ValuedMammal ValuedMammal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK abcf868

@ValuedMammal ValuedMammal merged commit f95c642 into bitcoindevkit:master Sep 5, 2025
20 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Done in BDK Wallet Sep 5, 2025
@ValuedMammal ValuedMammal mentioned this pull request Sep 5, 2025
2 tasks
ValuedMammal added a commit that referenced this pull request Sep 25, 2025
b642284 refactor: remove bdk_testenv dependency (codingp110)
7a5b644 docs: document persist_test_utils module (codingp110)
5d9a95c test: use utils to test file_store and rusqlite (codingp110)
79586e8 feat: add utilities to test persistence of wallet (codingp110)

Pull request description:

  Backports #300 adding the `persist_test_utils` module to the `release/2.2` branch.

  ### 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 `just p` before pushing

ACKs for top commit:
  oleonardolima:
    cACK b642284
  notmandatory:
    ACK b642284

Tree-SHA512: ca482cb61ed9a9e98a18fa35ce534d969b26eb7f71141d66105362d64ba8e18c4664eb5e14e38f61e1c0750d801391a821706ba7141db65a317d9ac22b546316
@ValuedMammal ValuedMammal mentioned this pull request Mar 4, 2026
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Persister test suite for testing redb persister

3 participants