reqwest = { version = "0.11", optional = true, default-features = false, features = ["json"] }
[dev-dependencies]
-lightning = { version = "0.0.118", path = "../lightning", features = ["std"] }
+lightning = { version = "0.0.118", path = "../lightning", features = ["std", "_test_utils"] }
electrsd = { version = "0.26.0", features = ["legacy", "esplora_a33e97e1", "bitcoind_25_0"] }
electrum-client = "0.18.0"
tokio = { version = "1.14.0", features = ["full"] }
use lightning_transaction_sync::EsploraSyncClient;
use lightning::chain::{Confirm, Filter};
use lightning::chain::transaction::TransactionData;
-use lightning::util::logger::{Logger, Record};
+use lightning::util::test_utils::TestLogger;
use electrsd::{bitcoind, bitcoind::BitcoinD, ElectrsD};
use bitcoin::{Amount, Txid, BlockHash};
}
}
-pub struct TestLogger {}
-
-impl Logger for TestLogger {
- fn log(&self, record: &Record) {
- println!("{} -- {}",
- record.level,
- record.args);
- }
-}
-
#[test]
#[cfg(feature = "esplora-blocking")]
fn test_esplora_syncs() {
let (bitcoind, electrsd) = setup_bitcoind_and_electrsd();
generate_blocks_and_wait(&bitcoind, &electrsd, 101);
- let mut logger = TestLogger {};
+ let mut logger = TestLogger::new();
let esplora_url = format!("http://{}", electrsd.esplora_url.as_ref().unwrap());
let tx_sync = EsploraSyncClient::new(esplora_url, &mut logger);
let confirmable = TestConfirmable::new();
async fn test_esplora_syncs() {
let (bitcoind, electrsd) = setup_bitcoind_and_electrsd();
generate_blocks_and_wait(&bitcoind, &electrsd, 101);
- let mut logger = TestLogger {};
+ let mut logger = TestLogger::new();
let esplora_url = format!("http://{}", electrsd.esplora_url.as_ref().unwrap());
let tx_sync = EsploraSyncClient::new(esplora_url, &mut logger);
let confirmable = TestConfirmable::new();