Merge pull request #136 from TheBlueMatt/2018-08-excess-signed-data-bolt-7
[rust-lightning] / fuzz / fuzz_targets / msg_targets / msg_target_template.txt
index 55a9761c9d611127c261b68bba4cd72ec0243a25..6053c041cf72c64462cd0fd5047e14a7d36a70ee 100644 (file)
@@ -13,15 +13,15 @@ mod utils;
 #[inline]
 pub fn do_test(data: &[u8]) {
        reset_rng_state();
-       test_msg!(msgs::MSG_TARGET, data);
+       TEST_MSG!(msgs::MSG_TARGET, dataEXTRA_ARGS);
 }
 
 #[cfg(feature = "afl")]
-extern crate afl;
+#[macro_use] extern crate afl;
 #[cfg(feature = "afl")]
 fn main() {
-       afl::read_stdio_bytes(|data| {
-               do_test(&data);
+       fuzz!(|data| {
+               do_test(data);
        });
 }
 
@@ -36,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());
        }
 }