// licenses.
use lightning::util::logger::{Logger, Record};
-use std::sync::{Arc, Mutex};
use std::io::Write;
+use std::sync::{Arc, Mutex};
-pub trait Output : Clone + 'static {
+pub trait Output: Clone + 'static {
fn locked_write(&self, data: &[u8]);
}
}
}
-pub struct TestLogger<Out : Output> {
+pub struct TestLogger<Out: Output> {
id: String,
out: Out,
}
self.0.locked_write(data);
Ok(data.len())
}
- fn flush(&mut self) -> Result<(), std::io::Error> { Ok(()) }
+ fn flush(&mut self) -> Result<(), std::io::Error> {
+ Ok(())
+ }
}
impl<Out: Output> Logger for TestLogger<Out> {
fn log(&self, record: Record) {
- write!(LockedWriteAdapter(&self.out),
- "{:<5} {} [{} : {}] {}\n", record.level.to_string(), self.id, record.module_path, record.line, record.args)
- .unwrap();
+ write!(
+ LockedWriteAdapter(&self.out),
+ "{:<5} {} [{} : {}] {}\n",
+ record.level.to_string(),
+ self.id,
+ record.module_path,
+ record.line,
+ record.args
+ )
+ .unwrap();
}
}
use lightning::chain;
-use lightning::chain::{chainmonitor, channelmonitor};
use lightning::chain::transaction::OutPoint;
+use lightning::chain::{chainmonitor, channelmonitor};
use lightning::util::test_channel_signer::TestChannelSigner;
use std::sync::Mutex;
pub update_ret: Mutex<chain::ChannelMonitorUpdateStatus>,
}
impl chainmonitor::Persist<TestChannelSigner> for TestPersister {
- fn persist_new_channel(&self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>) -> chain::ChannelMonitorUpdateStatus {
+ fn persist_new_channel(
+ &self, _funding_txo: OutPoint, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>,
+ ) -> chain::ChannelMonitorUpdateStatus {
self.update_ret.lock().unwrap().clone()
}
- fn update_persisted_channel(&self, _funding_txo: OutPoint, _update: Option<&channelmonitor::ChannelMonitorUpdate>, _data: &channelmonitor::ChannelMonitor<TestChannelSigner>) -> chain::ChannelMonitorUpdateStatus {
+ fn update_persisted_channel(
+ &self, _funding_txo: OutPoint, _update: Option<&channelmonitor::ChannelMonitorUpdate>,
+ _data: &channelmonitor::ChannelMonitor<TestChannelSigner>,
+ ) -> chain::ChannelMonitorUpdateStatus {
self.update_ret.lock().unwrap().clone()
}
- fn archive_persisted_channel(&self, _: OutPoint) {
- }
+ fn archive_persisted_channel(&self, _: OutPoint) {}
}
./bench/benches/bench.rs
./fuzz/src/chanmon_consistency.rs
./fuzz/src/full_stack.rs
-./fuzz/src/utils/mod.rs
-./fuzz/src/utils/test_logger.rs
-./fuzz/src/utils/test_persister.rs
./fuzz/src/zbase32.rs
./lightning-background-processor/src/lib.rs
./lightning-block-sync/src/convert.rs