Major refactor of the Esplora client

Now we're back to using regular bdk types, which is a big advantage.
This commit is contained in:
Dave Hrycyszyn
2024-07-25 19:54:37 +01:00
parent e4e8298fcd
commit 4b63245bfe
11 changed files with 133 additions and 536 deletions

View File

@@ -2,9 +2,7 @@ use bft_json_crdt::{
json_crdt::{BaseCrdt, SignedOp},
keypair::make_keypair,
};
use side_node::{
bft_crdt::websocket::Client, bft_crdt::TransactionList, bitcoin, node::SideNode, utils,
};
use side_node::{bft_crdt::websocket::Client, bft_crdt::TransactionList, node::SideNode, utils};
use tokio::sync::mpsc;
#[tokio::test]
@@ -37,9 +35,9 @@ async fn test_distribute_via_websockets() {
async fn setup(_: &str) -> SideNode {
// First, load up the keys and create a bft-bft-crdt
let bft_crdt_keys = make_keypair();
let mnemonic_words = bitcoin::keys::make_mnemonic();
let keys = bitcoin::keys::get(mnemonic_words).unwrap();
let bitcoin_wallet = bitcoin::clients::electrum::create_wallet(keys).unwrap();
// let mnemonic_words = bitcoin::keys::make_mnemonic();
// let keys = bitcoin::keys::get(mnemonic_words).unwrap();
// let bitcoin_wallet = bitcoin::clients::electrum::create_wallet(keys).unwrap();
let crdt = BaseCrdt::<TransactionList>::new(&bft_crdt_keys);
// Channels for internal communication, and a tokio task for stdin input
@@ -51,7 +49,7 @@ async fn setup(_: &str) -> SideNode {
let node = SideNode::new(
crdt,
bft_crdt_keys,
bitcoin_wallet,
// bitcoin_wallet,
incoming_receiver,
stdin_receiver,
handle,