Skip to content

Commit e793efe

Browse files
committed
Wrap long onion_message fuzz strings
Some editors at vim slow to a crawl when scrolling over long strings when syntax highlighting is turned on. Limit the length in fuzz strings to avoid this.
1 parent d2242f6 commit e793efe

File tree

1 file changed

+102
-3
lines changed

1 file changed

+102
-3
lines changed

fuzz/src/onion_message.rs

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,23 +211,122 @@ mod tests {
211211

212212
#[test]
213213
fn test_no_onion_message_breakage() {
214-
let two_unblinded_hops_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210202020202020202020202020202020202020202020202020202020202020202026d000000000000000000000000000000eb0000000000000000000000000000000000000000000000000000000000000036041096000000000000000000000000000000fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000";
214+
let two_unblinded_hops_om = "\
215+
020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000\
216+
000000000000000000000000000000000000000000000000e01350433042102020202020202020202020202\
217+
02020202020202020202020202020202020202026d000000000000000000000000000000eb0000000000000\
218+
000000000000000000000000000000000000000000000000036041096000000000000000000000000000000\
219+
fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000\
220+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
221+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
222+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
223+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
224+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
225+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
226+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
227+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
228+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
229+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
230+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
231+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
232+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
233+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
234+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
235+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
236+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
237+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
238+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
239+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
240+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
241+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
242+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
243+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
244+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
245+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
246+
000000000000000000000000000000000000000004800000000000000000000000000000000000000000000\
247+
000000000000000000";
215248
let logger = TrackingLogger { lines: Mutex::new(HashMap::new()) };
216249
super::do_test(&::hex::decode(two_unblinded_hops_om).unwrap(), &logger);
217250
{
218251
let log_entries = logger.lines.lock().unwrap();
219252
assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(), "Forwarding an onion message to peer 020202020202020202020202020202020202020202020202020202020202020202".to_string())), Some(&1));
220253
}
221254

222-
let two_unblinded_two_blinded_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210202020202020202020202020202020202020202020202020202020202020202026d0000000000000000000000000000009e0000000000000000000000000000000000000000000000000000000000000058045604210203030303030303030303030303030303030303030303030303030303030303020821020000000000000000000000000000000000000000000000000000000000000e0196000000000000000000000000000000e9000000000000000000000000000000000000000000000000000000000000003504330421020404040404040404040404040404040404040404040404040404040404040402ca00000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000003604103f000000000000000000000000000000fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000";
255+
let two_unblinded_two_blinded_om = "\
256+
020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000\
257+
000000000000000000000000000000000000000000000000e01350433042102020202020202020202020202\
258+
02020202020202020202020202020202020202026d0000000000000000000000000000009e0000000000000\
259+
000000000000000000000000000000000000000000000000058045604210203030303030303030303030303\
260+
030303030303030303030303030303030303020821020000000000000000000000000000000000000000000\
261+
000000000000000000e0196000000000000000000000000000000e900000000000000000000000000000000\
262+
000000000000000000000000000000350433042102040404040404040404040404040404040404040404040\
263+
4040404040404040402ca000000000000000000000000000000420000000000000000000000000000000000\
264+
00000000000000000000000000003604103f000000000000000000000000000000fd1092202a2a2a2a2a2a2\
265+
a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a000000000000000000000000000000000000\
266+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
267+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
268+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
269+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
270+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
271+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
272+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
273+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
274+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
275+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
276+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
277+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
278+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
279+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
280+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
281+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
282+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
283+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
284+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
285+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
286+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
287+
000000000000000000000000000000000000000004800000000000000000000000000000000000000000000\
288+
000000000000000000";
223289
let logger = TrackingLogger { lines: Mutex::new(HashMap::new()) };
224290
super::do_test(&::hex::decode(two_unblinded_two_blinded_om).unwrap(), &logger);
225291
{
226292
let log_entries = logger.lines.lock().unwrap();
227293
assert_eq!(log_entries.get(&("lightning::onion_message::messenger".to_string(), "Forwarding an onion message to peer 020202020202020202020202020202020202020202020202020202020202020202".to_string())), Some(&1));
228294
}
229295

230-
let three_blinded_om = "020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000000000000000000000000000000000000000000000000000e0135043304210202020202020202020202020202020202020202020202020202020202020202026d000000000000000000000000000000b20000000000000000000000000000000000000000000000000000000000000035043304210203030303030303030303030303030303030303030303030303030303030303029600000000000000000000000000000033000000000000000000000000000000000000000000000000000000000000003604104e000000000000000000000000000000fd1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004800000000000000000000000000000000000000000000000000000000000000";
296+
let three_blinded_om = "\
297+
020000000000000000000000000000000000000000000000000000000000000e01055600020000000000000\
298+
000000000000000000000000000000000000000000000000e01350433042102020202020202020202020202\
299+
02020202020202020202020202020202020202026d000000000000000000000000000000b20000000000000\
300+
000000000000000000000000000000000000000000000000035043304210203030303030303030303030303\
301+
030303030303030303030303030303030303029600000000000000000000000000000033000000000000000\
302+
000000000000000000000000000000000000000000000003604104e000000000000000000000000000000fd\
303+
1092202a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a2a00000000000000000\
304+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
305+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
306+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
307+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
308+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
309+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
310+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
311+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
312+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
313+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
314+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
315+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
316+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
317+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
318+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
319+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
320+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
321+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
322+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
323+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
324+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
325+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
326+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
327+
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\
328+
000000000000000000000000000000000000000004800000000000000000000000000000000000000000000\
329+
000000000000000000";
231330
let logger = TrackingLogger { lines: Mutex::new(HashMap::new()) };
232331
super::do_test(&::hex::decode(three_blinded_om).unwrap(), &logger);
233332
{

0 commit comments

Comments
 (0)