Utilize Writer size hinting in message fuzz targets and check them
[rust-lightning] / fuzz / fuzz_targets / msg_targets / msg_error_message_target.rs
index a69ded2ea989723b668301b9ea5ccf75752c6146..5ccbd26468017a644c3388e6712ff60c7eef5e7f 100644 (file)
@@ -6,14 +6,13 @@ extern crate lightning;
 use lightning::ln::msgs;
 use lightning::util::reset_rng_state;
 
-use lightning::ln::msgs::{MsgEncodable, MsgDecodable};
-
 mod utils;
+use utils::VecWriter;
 
 #[inline]
 pub fn do_test(data: &[u8]) {
        reset_rng_state();
-       test_msg!(msgs::ErrorMessage, data);
+       test_msg_hole!(msgs::ErrorMessage, data, 32, 2);
 }
 
 #[cfg(feature = "afl")]