Add a generalized "Blockchain" interface

This commit is contained in:
Alekos Filini
2020-05-03 16:15:11 +02:00
parent 0988c8b8d5
commit 75a9c30c9a
10 changed files with 498 additions and 323 deletions

View 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<'_>| {