Refactor wallet and persist mod, remove bdk_persist crate#1454
Refactor wallet and persist mod, remove bdk_persist crate#1454notmandatory merged 7 commits intobitcoindevkit:masterfrom
Conversation
e5a10f7 to
e5c73ec
Compare
2fc8540 to
6b047ea
Compare
6b047ea to
39d4c86
Compare
96c758c to
4ab0648
Compare
|
@matthiasdebernardini I added an async version of the persist trait called |
|
This is looking good. Removing the persistence backend from wallet is a welcome change. The main concern with doing so is newly revealed addresses not being persisted, but this is addressed with good documentation. |
|
Maybe worth keeping the |
c2ac570 to
c23d2bc
Compare
395ffa3 to
4b5166b
Compare
c1b3e0c to
ded0bfe
Compare
c9d1b41 to
dbbc8ce
Compare
There was a problem hiding this comment.
ACK 6323d55
I rebased to add one more small fix to the bdk_wallet README.md.
dbbc8ce to
6323d55
Compare
Also add refactored StagedPersist to chain crate with tests.
…::persist Also update examples and remove bdk_persist crate.
Still enable the `persist` submodule without `miniscript` feature flag. Only disable `CombinedChangeSet`. Also stop `cargo clippy` from complaining about unused imports when `miniscript` is disabled.
A staging area is helpful because we can contain logic to ignore empty changesets and not clear staging area if the persistence backend fails.
6323d55 to
ec36c7e
Compare
|
Had to do one final force push after rebasing on master. |
|
ACK ec36c7e |
Description
Sorry to submit another refactor PR for the persist related stuff, but I think it's worth revisiting. My primary motivations are:
dbfromWalletso users have the ability to useasyncstorage crates, for example usingsqlx. I updated docs and examples to let users know they are responsible for persisting changes.anyhowdependency everywhere (except as a dev test dependency). It really doesn't belong in a lib and by removing persistence fromWalletit isn't needed.bdk_persistcrate and revert back to the original design with generic error types. I kept theDebugandDisplayconstrains on persist errors so they could still be used with theanyhow!macro.Notes to the reviewers
I also replaced/renamed old
PersistwithStagedPersiststruct inspired by #1453, it is only used in examples. TheWallethandles it's own staging.Changelog notice
Changed
dbfromWallet, users are now responsible for persisting changes, see docs and examples.bdk_persistcrate and moved logic back tobdk_chain::persistmodule.PersistBackendAsync,StagedExt, andStageExtAsynctraits.Walletfunctionscommit_toandcommit_to_async.Checklists
All Submissions:
cargo fmtandcargo clippybefore committing