Skip to content

Commit 5b7c1d5

Browse files
committed
Use upstream TestLogger util in tx sync tests
1 parent c8ff321 commit 5b7c1d5

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

lightning-transaction-sync/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ esplora-client = { version = "0.6", default-features = false, optional = true }
2929
reqwest = { version = "0.11", optional = true, default-features = false, features = ["json"] }
3030

3131
[dev-dependencies]
32-
lightning = { version = "0.0.118", path = "../lightning", features = ["std"] }
32+
lightning = { version = "0.0.118", path = "../lightning", features = ["std", "_test_utils"] }
3333
electrsd = { version = "0.26.0", features = ["legacy", "esplora_a33e97e1", "bitcoind_25_0"] }
3434
electrum-client = "0.18.0"
3535
tokio = { version = "1.14.0", features = ["full"] }

lightning-transaction-sync/tests/integration_tests.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use lightning_transaction_sync::EsploraSyncClient;
33
use lightning::chain::{Confirm, Filter};
44
use lightning::chain::transaction::TransactionData;
5-
use lightning::util::logger::{Logger, Record};
5+
use lightning::util::test_utils::TestLogger;
66

77
use electrsd::{bitcoind, bitcoind::BitcoinD, ElectrsD};
88
use bitcoin::{Amount, Txid, BlockHash};
@@ -148,22 +148,12 @@ impl Confirm for TestConfirmable {
148148
}
149149
}
150150

151-
pub struct TestLogger {}
152-
153-
impl Logger for TestLogger {
154-
fn log(&self, record: &Record) {
155-
println!("{} -- {}",
156-
record.level,
157-
record.args);
158-
}
159-
}
160-
161151
#[test]
162152
#[cfg(feature = "esplora-blocking")]
163153
fn test_esplora_syncs() {
164154
let (bitcoind, electrsd) = setup_bitcoind_and_electrsd();
165155
generate_blocks_and_wait(&bitcoind, &electrsd, 101);
166-
let mut logger = TestLogger {};
156+
let mut logger = TestLogger::new();
167157
let esplora_url = format!("http://{}", electrsd.esplora_url.as_ref().unwrap());
168158
let tx_sync = EsploraSyncClient::new(esplora_url, &mut logger);
169159
let confirmable = TestConfirmable::new();
@@ -246,7 +236,7 @@ fn test_esplora_syncs() {
246236
async fn test_esplora_syncs() {
247237
let (bitcoind, electrsd) = setup_bitcoind_and_electrsd();
248238
generate_blocks_and_wait(&bitcoind, &electrsd, 101);
249-
let mut logger = TestLogger {};
239+
let mut logger = TestLogger::new();
250240
let esplora_url = format!("http://{}", electrsd.esplora_url.as_ref().unwrap());
251241
let tx_sync = EsploraSyncClient::new(esplora_url, &mut logger);
252242
let confirmable = TestConfirmable::new();

0 commit comments

Comments
 (0)