Skip to content

wip,draft: Add async support to persist_test_utils#343

Draft
ValuedMammal wants to merge 3 commits intobitcoindevkit:masterfrom
ValuedMammal:feat/persist_test_utils_async
Draft

wip,draft: Add async support to persist_test_utils#343
ValuedMammal wants to merge 3 commits intobitcoindevkit:masterfrom
ValuedMammal:feat/persist_test_utils_async

Conversation

@ValuedMammal
Copy link
Collaborator

@ValuedMammal ValuedMammal commented Nov 7, 2025

Description

Initial work on expanding persist_test_utils module by adding a function persist_wallet_changeset_async to be used for testing an AsyncWalletPersister implementation.

Changelog notice

Added

  • persist_wallet_changeset_async to persistence test suite for testing an AsyncWalletPersister.

Checklists

All Submissions:

New Features:

  • I've added docs for the new feature

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.17%. Comparing base (c422104) to head (8be4c86).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #343   +/-   ##
=======================================
  Coverage   79.17%   79.17%           
=======================================
  Files          24       24           
  Lines        5311     5311           
  Branches      242      242           
=======================================
  Hits         4205     4205           
  Misses       1029     1029           
  Partials       77       77           
Flag Coverage Δ
rust 79.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ValuedMammal ValuedMammal force-pushed the feat/persist_test_utils_async branch 2 times, most recently from 15149b5 to bf0057f Compare February 7, 2026 05:49
Comment on lines +146 to +151
pub fn persist_multiple_wallet_changesets<F, P>(create_stores: F) -> Result<(), PersistError>
where
F: Fn() -> Result<(P, P), P::Error>,
P: WalletPersister,
P::Error: StdErr + 'static,
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@110CodingP I changed this by removing the &Path arg from the create_stores Fn, which means this function is no longer in control of the path in which the stores are created. After thinking about it I'm not sure this is a feature that needs to be tested. Any thought about whether to keep or improve it somehow?

Copy link
Contributor

Choose a reason for hiding this comment

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

I added this function just because we had a test in bdk_redb that checks if two different wallets can be persisted in the same file. So this test just differentiates between these two kinds of backends. I am not very confident about whether this is worth keeping since it might be just bdk_redb that can use it. Will think more about the improvement part.
Sorry for the late reply 🙏 , didn't check the notifications carefully...

@ValuedMammal ValuedMammal force-pushed the feat/persist_test_utils_async branch from bf0057f to 7e53c18 Compare February 26, 2026 03:49
Changed the definition of `persist_*` functions to take a
`create_store` Fn (and no path) as the caller may want more
control of the path to the database file.

- deps: Make tempfile, anyhow dev-dependencies
@ValuedMammal ValuedMammal force-pushed the feat/persist_test_utils_async branch from 7e53c18 to 8be4c86 Compare February 26, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants