X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Fonion_message.rs;h=de7b8b6b4c612a412902720df613f768649205d4;hb=c7a89598fe28aa3f68cc73817752a6cdb6be2534;hp=13de5005cf8be1e2fee35f9fc501366bd4e46434;hpb=2659a2375eb819fe050f057b068c3e27f98a30f7;p=rust-lightning diff --git a/fuzz/src/onion_message.rs b/fuzz/src/onion_message.rs index 13de5005..de7b8b6b 100644 --- a/fuzz/src/onion_message.rs +++ b/fuzz/src/onion_message.rs @@ -91,6 +91,7 @@ impl OffersMessageHandler for TestOffersMessageHandler { } } +#[derive(Debug)] struct TestCustomMessage {} const CUSTOM_MESSAGE_TYPE: u64 = 4242; @@ -218,7 +219,7 @@ mod tests { pub lines: Mutex>, } impl Logger for TrackingLogger { - fn log(&self, record: &Record) { + fn log(&self, record: Record) { *self.lines.lock().unwrap().entry((record.module_path.to_string(), format!("{}", record.args))).or_insert(0) += 1; println!("{:<5} [{} : {}, {}] {}", record.level.to_string(), record.module_path, record.file, record.line, record.args); } @@ -265,9 +266,10 @@ mod tests { { let log_entries = logger.lines.lock().unwrap(); assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(), - "Received an onion message with path_id None and a reply_path".to_string())), Some(&1)); + "Received an onion message with path_id None and a reply_path: Custom(TestCustomMessage)" + .to_string())), Some(&1)); assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(), - "Sending onion message when responding to Custom onion message with path_id None".to_string())), Some(&1)); + "Sending onion message: TestCustomMessage".to_string())), Some(&1)); } let two_unblinded_hops_om = "\