Skip to content

Commit 68be6f7

Browse files
committed
WIP: Fuzz test onion message replies
1 parent cce4605 commit 68be6f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fuzz/src/onion_message.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ struct TestCustomMessageHandler {}
9595
impl CustomOnionMessageHandler for TestCustomMessageHandler {
9696
type CustomMessage = TestCustomMessage;
9797
fn handle_custom_message(&self, _msg: Self::CustomMessage) -> Option<Self::CustomMessage> {
98-
None
98+
Some(TestCustomMessage {})
9999
}
100100
fn read_custom_message<R: io::Read>(&self, _message_type: u64, buffer: &mut R) -> Result<Option<Self::CustomMessage>, msgs::DecodeError> {
101101
let mut buf = Vec::new();
@@ -197,6 +197,9 @@ mod tests {
197197
let log_entries = logger.lines.lock().unwrap();
198198
assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(),
199199
"Received an onion message with path_id None and no reply_path".to_string())), Some(&1));
200+
// TODO: Add reply path to one_hop_om instead?
201+
assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(),
202+
"No reply path to respond to onion message with path_id None".to_string())), Some(&1));
200203
}
201204

202205
let two_unblinded_hops_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210200000000000000000000000000000000000000000000000000000000000000029500000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000003604104b000000000000000000000000000000fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b200000000000000000000000000000000000000000000000000000000000000";

0 commit comments

Comments
 (0)