push
github
Merge bitcoindevkit/bdk#1454: Refactor wallet and persist mod, remove bdk_persist crate ec36c7ecc feat(example): use changeset staging with rpc polling example (志宇) 19328d499 feat(wallet)!: change persist API to use `StageExt` and `StageExtAsync` (志宇) 2e40b0118 feat(chain): reintroduce a way to stage changesets before persisting (志宇) 36e82ec68 chore(chain): relax `miniscript` feature flag scope (志宇) 9e97ac033 refactor(persist): update file_store, sqlite, wallet to use bdk_chain::persist (Steve Myers) 54b0c11cb feat(persist): add PersistAsync trait and StagedPersistAsync struct (Steve Myers) aa640ab27 refactor(persist): rename PersistBackend to Persist, move to chain crate (Steve Myers) Pull request description: ### Description Sorry to submit another refactor PR for the persist related stuff, but I think it's worth revisiting. My primary motivations are: 1. remove `db` from `Wallet` so users have the ability to use `async` storage crates, for example using `sqlx`. I updated docs and examples to let users know they are responsible for persisting changes. 2. remove the `anyhow` dependency everywhere (except as a dev test dependency). It really doesn't belong in a lib and by removing persistence from `Wallet` it isn't needed. 3. remove the `bdk_persist` crate and revert back to the original design with generic error types. I kept the `Debug` and `Display` constrains on persist errors so they could still be used with the `anyhow!` macro. ### Notes to the reviewers I also replaced/renamed old `Persist` with `StagedPersist` struct inspired by #1453, it is only used in examples. The `Wallet` handles it's own staging. ### Changelog notice Changed - Removed `db` from `Wallet`, users are now responsible for persisting ... (continued)
176 of 248 new or added lines in 6 files covered. (70.97%)
3 existing lines in 2 files now uncovered.11153 of 13427 relevant lines covered (83.06%)
16771.13 hits per line