Skip to content

Commit

Permalink
WIP Test
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Nov 22, 2023
1 parent c84a822 commit d72eec7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/sweep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,3 +533,46 @@ where
.collect::<Vec<_>>()
}
}

#[cfg(test)]
mod tests {
use lightning::util::test_utils::{TestBroadcaster, TestLogger};

use crate::test::utils::random_storage_path;
use crate::wallet::Wallet;

use bdk::blockchain::esplora::EsploraBlockchain;
use bdk::database::SqliteDatabase;
use bdk::template::Bip84;

use esplora_client::Builder;

use bitcoin::Network;

use std::sync::Arc;

#[test]
fn test_broadcasting() {
let storage_path = random_storage_path();
let seed_bytes = [42u8; 64];
let network = Network::Regtest;
let logger = Arc::new(TestLogger::new());

let xprv = bitcoin::util::bip32::ExtendedPrivKey::new_master(network, &seed_bytes).unwrap();

let database_path = format!("{}/bdk_test_wallet.sqlite", storage_path.display());
let database = SqliteDatabase::new(database_path);

let bdk_wallet = bdk::Wallet::new(
Bip84(xprv, bdk::KeychainKind::External),
Some(Bip84(xprv, bdk::KeychainKind::Internal)),
network,
database,
)
.unwrap();

//let esplora_client = Client::new("asdf");
let blockchain = EsploraBlockchain::from_client(esplora_client, 20);
//let wallet = Wallet::new(blockchain, bdk_wallet, runtime, logger);
}
}

0 comments on commit d72eec7

Please sign in to comment.