From: Alekos Filini Date: Sun, 3 May 2020 14:15:11 +0000 (+0200) Subject: Add a generalized "Blockchain" interface X-Git-Tag: 0.1.0-beta.1~32 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.EncoderStringWriter.html?a=commitdiff_plain;h=a39d50f41aa92be3c7112ef962454ad7d6e2ef7b;p=bdk-cli Add a generalized "Blockchain" interface --- diff --git a/Cargo.toml b/Cargo.toml index 0edd8c3..a3aa967 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ electrum-client = { version = "0.1.0-beta.5", optional = true } [features] minimal = [] compiler = ["miniscript/compiler"] -default = ["sled", "electrum-client"] +default = ["key-value-db", "electrum"] electrum = ["electrum-client"] key-value-db = ["sled"] diff --git a/examples/repl.rs b/examples/repl.rs index 82c41f3..6659851 100644 --- a/examples/repl.rs +++ b/examples/repl.rs @@ -23,6 +23,7 @@ use bitcoin::util::psbt::PartiallySignedTransaction; use bitcoin::{Address, Network, OutPoint}; use magical_bitcoin_wallet::bitcoin; +use magical_bitcoin_wallet::blockchain::ElectrumBlockchain; use magical_bitcoin_wallet::sled; use magical_bitcoin_wallet::types::ScriptType; use magical_bitcoin_wallet::{Client, Wallet}; @@ -255,7 +256,14 @@ fn main() { debug!("database opened successfully"); let client = Client::new(matches.value_of("server").unwrap()).unwrap(); - let wallet = Wallet::new(descriptor, change_descriptor, network, tree, client).unwrap(); + let wallet = Wallet::new( + descriptor, + change_descriptor, + network, + tree, + ElectrumBlockchain::from(client), + ) + .unwrap(); // TODO: print errors in a nice way let handle_matches = |matches: ArgMatches<'_>| {