Skip to content

Commit f95c642

Browse files
committed
Merge #300: Add utilities to test persistence
abcf868 refactor: remove bdk_testenv dependency (codingp110) f539909 docs: document persist_test_utils module (codingp110) a03d3e3 test: use utils to test file_store and rusqlite (codingp110) 62060fd feat: add utilities to test persistence of wallet (codingp110) Pull request description: <!-- You can erase any parts of this template not applicable to your Pull Request. --> ### 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: * [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 #### New Features: * [x] I've added tests for the new feature * [x] I've added docs for the new feature ACKs for top commit: ValuedMammal: ACK abcf868 Tree-SHA512: 854e24ace5366c9bf744db602c99e98849654dc162cd5689b8de49bcdf608a11834875cc9d11086cc5c67ef802eb6ce79c380e56386862644471fbc699fc297a
2 parents 740c8c9 + abcf868 commit f95c642

File tree

4 files changed

+470
-1
lines changed

4 files changed

+470
-1
lines changed

wallet/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ bitcoin = { version = "0.32.6", features = [ "serde", "base64" ], default-featur
2222
serde = { version = "^1.0", features = ["derive"] }
2323
serde_json = { version = "^1.0" }
2424
bdk_chain = { version = "0.23.1", features = [ "miniscript", "serde" ], default-features = false }
25+
anyhow = { version = "1.0.98", optional = true }
26+
tempfile = { version = "3.20.0", optional = true }
2527

2628
# Optional dependencies
2729
bip39 = { version = "2.0", optional = true }
@@ -35,7 +37,7 @@ all-keys = ["keys-bip39"]
3537
keys-bip39 = ["bip39"]
3638
rusqlite = ["bdk_chain/rusqlite"]
3739
file_store = ["bdk_file_store"]
38-
test-utils = ["std"]
40+
test-utils = ["std", "anyhow", "tempfile"]
3941

4042
[dev-dependencies]
4143
assert_matches = "1.5.0"

wallet/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ pub mod keys;
3131
pub mod psbt;
3232
#[cfg(feature = "test-utils")]
3333
pub mod test_utils;
34+
35+
#[cfg(feature = "test-utils")]
36+
pub mod persist_test_utils;
37+
3438
mod types;
3539
mod wallet;
3640

0 commit comments

Comments
 (0)