Skip to content

Commit

Permalink
Add wallet persistence
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn authored and danielabrozzoni committed Mar 2, 2023
1 parent 57538e5 commit 5985706
Show file tree
Hide file tree
Showing 9 changed files with 408 additions and 206 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ js-sys = "0.3"
[features]
default = ["std"]
std = []
file-store = [ "std", "bdk_chain/file_store"]
compiler = ["miniscript/compiler"]
all-keys = ["keys-bip39"]
keys-bip39 = ["bip39"]
Expand Down
2 changes: 0 additions & 2 deletions src/descriptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ pub mod checksum;
pub mod dsl;
pub mod error;
pub mod policy;
mod spk_iter;
pub mod template;
pub use spk_iter::SpkIter;

pub use self::checksum::calc_checksum;
use self::checksum::calc_checksum_bytes;
Expand Down
63 changes: 0 additions & 63 deletions src/descriptor/spk_iter.rs

This file was deleted.

8 changes: 4 additions & 4 deletions src/wallet/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ impl FullyNodedExport {
///
/// If the database is empty or `include_blockheight` is false, the `blockheight` field
/// returned will be `0`.
pub fn export_wallet(
wallet: &Wallet,
pub fn export_wallet<D>(
wallet: &Wallet<D>,
label: &str,
include_blockheight: bool,
) -> Result<Self, &'static str> {
Expand Down Expand Up @@ -231,8 +231,8 @@ mod test {
descriptor: &str,
change_descriptor: Option<&str>,
network: Network,
) -> Wallet {
let mut wallet = Wallet::new(descriptor, change_descriptor, network).unwrap();
) -> Wallet<()> {
let mut wallet = Wallet::new(descriptor, change_descriptor, (), network).unwrap();
let transaction = Transaction {
input: vec![],
output: vec![],
Expand Down
Loading

0 comments on commit 5985706

Please sign in to comment.