use hex::decode instead of extend_vec_from_hex
[rust-lightning] / fuzz / fuzz_targets / msg_targets / msg_target_template.txt
index d5754ad22e584f422c5d4d8cadb5082f38df806c..f65e91f598c3d6f9bcf616a93f08e33932784a09 100644 (file)
@@ -1,3 +1,6 @@
+// This file is auto-generated by gen_target.sh based on msg_target_template.txt
+// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
+
 extern crate lightning;
 
 use lightning::ln::msgs;
@@ -6,15 +9,11 @@ use lightning::util::reset_rng_state;
 use lightning::ln::msgs::{MsgEncodable, MsgDecodable};
 
 mod utils;
-use utils::slice_to_be16;
 
 #[inline]
 pub fn do_test(data: &[u8]) {
        reset_rng_state();
-       let mut read_pos = 0;
-       loop {
-               test_msg!(msgs::MSG_TARGET, data, read_pos);
-       }
+       test_msg!(msgs::MSG_TARGET, data);
 }
 
 #[cfg(feature = "afl")]
@@ -37,13 +36,11 @@ fn main() {
        }
 }
 
+extern crate hex;
 #[cfg(test)]
 mod tests {
-       use utils::extend_vec_from_hex;
        #[test]
        fn duplicate_crash() {
-               let mut a = Vec::new();
-               extend_vec_from_hex("00", &mut a);
-               super::do_test(&a);
+               super::do_test(&::hex::decode("00").unwrap());
        }
 }