]> Untitled Git - bdk-cli/commitdiff
Add a generalized "Blockchain" interface
authorAlekos Filini <alekos.filini@gmail.com>
Sun, 3 May 2020 14:15:11 +0000 (16:15 +0200)
committerAlekos Filini <alekos.filini@gmail.com>
Sun, 3 May 2020 16:16:11 +0000 (18:16 +0200)
Cargo.toml
examples/repl.rs

index 0edd8c32bf852be71c21ce374c69da79c8235bbb..a3aa967e459241b8d7a6f7b72adc4920b3873b1f 100644 (file)
@@ -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"]
 
index 82c41f308703c566c9ac5448ac8d936f938d9129..66598514d37f6f1caaf59dbb26bda71d2de0d27f 100644 (file)
@@ -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<'_>| {