From: Elias Rohrer Date: Thu, 6 Jun 2024 11:09:43 +0000 (+0200) Subject: `rustfmt`: `fuzz/src/msg_targets/*` X-Git-Tag: v0.0.124-beta~91^2~9 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=b9c52f6941ded397dfa5e61ccc94401c9cb0a193;p=rust-lightning `rustfmt`: `fuzz/src/msg_targets/*` --- diff --git a/fuzz/src/msg_targets/gen_target.sh b/fuzz/src/msg_targets/gen_target.sh index 8bce10059..05997c075 100755 --- a/fuzz/src/msg_targets/gen_target.sh +++ b/fuzz/src/msg_targets/gen_target.sh @@ -7,7 +7,10 @@ GEN_TEST() { echo "pub mod $tn;" >> mod.rs } -echo "mod utils;" > mod.rs +{ + echo "#![cfg_attr(rustfmt, rustfmt_skip)]" + echo "mod utils;" +} > mod.rs # Note when adding new targets here you should add a similar line in src/bin/gen_target.sh diff --git a/fuzz/src/msg_targets/mod.rs b/fuzz/src/msg_targets/mod.rs index 837bee65d..15750a9a5 100644 --- a/fuzz/src/msg_targets/mod.rs +++ b/fuzz/src/msg_targets/mod.rs @@ -1,3 +1,4 @@ +#![cfg_attr(rustfmt, rustfmt_skip)] mod utils; pub mod msg_accept_channel; pub mod msg_announcement_signatures; diff --git a/fuzz/src/msg_targets/msg_accept_channel.rs b/fuzz/src/msg_targets/msg_accept_channel.rs index d4e7acf1d..216fe7c59 100644 --- a/fuzz/src/msg_targets/msg_accept_channel.rs +++ b/fuzz/src/msg_targets/msg_accept_channel.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_accept_channel_v2.rs b/fuzz/src/msg_targets/msg_accept_channel_v2.rs index 36b646644..c1d7fb55c 100644 --- a/fuzz/src/msg_targets/msg_accept_channel_v2.rs +++ b/fuzz/src/msg_targets/msg_accept_channel_v2.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_announcement_signatures.rs b/fuzz/src/msg_targets/msg_announcement_signatures.rs index cf0ca2e2d..6010e6001 100644 --- a/fuzz/src/msg_targets/msg_announcement_signatures.rs +++ b/fuzz/src/msg_targets/msg_announcement_signatures.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_channel_announcement.rs b/fuzz/src/msg_targets/msg_channel_announcement.rs index 0c67ca16e..d4084c618 100644 --- a/fuzz/src/msg_targets/msg_channel_announcement.rs +++ b/fuzz/src/msg_targets/msg_channel_announcement.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_channel_details.rs b/fuzz/src/msg_targets/msg_channel_details.rs index 59554fab1..eb9f8beee 100644 --- a/fuzz/src/msg_targets/msg_channel_details.rs +++ b/fuzz/src/msg_targets/msg_channel_details.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_channel_ready.rs b/fuzz/src/msg_targets/msg_channel_ready.rs index 5b13486f5..318092890 100644 --- a/fuzz/src/msg_targets/msg_channel_ready.rs +++ b/fuzz/src/msg_targets/msg_channel_ready.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_channel_reestablish.rs b/fuzz/src/msg_targets/msg_channel_reestablish.rs index fdc2d1fa6..f766892a2 100644 --- a/fuzz/src/msg_targets/msg_channel_reestablish.rs +++ b/fuzz/src/msg_targets/msg_channel_reestablish.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_channel_update.rs b/fuzz/src/msg_targets/msg_channel_update.rs index 27dadaed5..358305b9d 100644 --- a/fuzz/src/msg_targets/msg_channel_update.rs +++ b/fuzz/src/msg_targets/msg_channel_update.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_closing_signed.rs b/fuzz/src/msg_targets/msg_closing_signed.rs index 0497b1fcc..74e04d667 100644 --- a/fuzz/src/msg_targets/msg_closing_signed.rs +++ b/fuzz/src/msg_targets/msg_closing_signed.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_commitment_signed.rs b/fuzz/src/msg_targets/msg_commitment_signed.rs index 8726efc58..7ece31435 100644 --- a/fuzz/src/msg_targets/msg_commitment_signed.rs +++ b/fuzz/src/msg_targets/msg_commitment_signed.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_decoded_onion_error_packet.rs b/fuzz/src/msg_targets/msg_decoded_onion_error_packet.rs index 3f5243d4e..9d245e2f2 100644 --- a/fuzz/src/msg_targets/msg_decoded_onion_error_packet.rs +++ b/fuzz/src/msg_targets/msg_decoded_onion_error_packet.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_error_message.rs b/fuzz/src/msg_targets/msg_error_message.rs index 6d9d8e27e..ae16e1686 100644 --- a/fuzz/src/msg_targets/msg_error_message.rs +++ b/fuzz/src/msg_targets/msg_error_message.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_funding_created.rs b/fuzz/src/msg_targets/msg_funding_created.rs index c03975da7..a6c5ba148 100644 --- a/fuzz/src/msg_targets/msg_funding_created.rs +++ b/fuzz/src/msg_targets/msg_funding_created.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_funding_signed.rs b/fuzz/src/msg_targets/msg_funding_signed.rs index 8788d34bc..34f0fddaa 100644 --- a/fuzz/src/msg_targets/msg_funding_signed.rs +++ b/fuzz/src/msg_targets/msg_funding_signed.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_gossip_timestamp_filter.rs b/fuzz/src/msg_targets/msg_gossip_timestamp_filter.rs index 884449b06..8e0fb7c53 100644 --- a/fuzz/src/msg_targets/msg_gossip_timestamp_filter.rs +++ b/fuzz/src/msg_targets/msg_gossip_timestamp_filter.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_init.rs b/fuzz/src/msg_targets/msg_init.rs index 1f21f4b3d..5f11441dd 100644 --- a/fuzz/src/msg_targets/msg_init.rs +++ b/fuzz/src/msg_targets/msg_init.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_node_announcement.rs b/fuzz/src/msg_targets/msg_node_announcement.rs index ab2ba7550..ce9bb30d3 100644 --- a/fuzz/src/msg_targets/msg_node_announcement.rs +++ b/fuzz/src/msg_targets/msg_node_announcement.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_open_channel.rs b/fuzz/src/msg_targets/msg_open_channel.rs index cacb5d767..9c924e501 100644 --- a/fuzz/src/msg_targets/msg_open_channel.rs +++ b/fuzz/src/msg_targets/msg_open_channel.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_open_channel_v2.rs b/fuzz/src/msg_targets/msg_open_channel_v2.rs index 4f6457a3e..a43d58ee9 100644 --- a/fuzz/src/msg_targets/msg_open_channel_v2.rs +++ b/fuzz/src/msg_targets/msg_open_channel_v2.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_ping.rs b/fuzz/src/msg_targets/msg_ping.rs index 2509fef7e..2ff548164 100644 --- a/fuzz/src/msg_targets/msg_ping.rs +++ b/fuzz/src/msg_targets/msg_ping.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_pong.rs b/fuzz/src/msg_targets/msg_pong.rs index 1c90eefdb..52b9ee084 100644 --- a/fuzz/src/msg_targets/msg_pong.rs +++ b/fuzz/src/msg_targets/msg_pong.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_query_channel_range.rs b/fuzz/src/msg_targets/msg_query_channel_range.rs index fe2fb4051..6b5963678 100644 --- a/fuzz/src/msg_targets/msg_query_channel_range.rs +++ b/fuzz/src/msg_targets/msg_query_channel_range.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_query_short_channel_ids.rs b/fuzz/src/msg_targets/msg_query_short_channel_ids.rs index bd8fa59d1..c15915fd1 100644 --- a/fuzz/src/msg_targets/msg_query_short_channel_ids.rs +++ b/fuzz/src/msg_targets/msg_query_short_channel_ids.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_reply_channel_range.rs b/fuzz/src/msg_targets/msg_reply_channel_range.rs index 43a3e0f3d..3cb94af6c 100644 --- a/fuzz/src/msg_targets/msg_reply_channel_range.rs +++ b/fuzz/src/msg_targets/msg_reply_channel_range.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_reply_short_channel_ids_end.rs b/fuzz/src/msg_targets/msg_reply_short_channel_ids_end.rs index dc765c76b..a53459997 100644 --- a/fuzz/src/msg_targets/msg_reply_short_channel_ids_end.rs +++ b/fuzz/src/msg_targets/msg_reply_short_channel_ids_end.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_revoke_and_ack.rs b/fuzz/src/msg_targets/msg_revoke_and_ack.rs index 9190c98e8..26f2d7524 100644 --- a/fuzz/src/msg_targets/msg_revoke_and_ack.rs +++ b/fuzz/src/msg_targets/msg_revoke_and_ack.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_shutdown.rs b/fuzz/src/msg_targets/msg_shutdown.rs index 26133f7d1..77c4cfdaa 100644 --- a/fuzz/src/msg_targets/msg_shutdown.rs +++ b/fuzz/src/msg_targets/msg_shutdown.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_splice.rs b/fuzz/src/msg_targets/msg_splice.rs index e6a18d256..f203da056 100644 --- a/fuzz/src/msg_targets/msg_splice.rs +++ b/fuzz/src/msg_targets/msg_splice.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_splice_ack.rs b/fuzz/src/msg_targets/msg_splice_ack.rs index cc77c198b..65949d273 100644 --- a/fuzz/src/msg_targets/msg_splice_ack.rs +++ b/fuzz/src/msg_targets/msg_splice_ack.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_splice_locked.rs b/fuzz/src/msg_targets/msg_splice_locked.rs index 39e340fd4..02e762ade 100644 --- a/fuzz/src/msg_targets/msg_splice_locked.rs +++ b/fuzz/src/msg_targets/msg_splice_locked.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_stfu.rs b/fuzz/src/msg_targets/msg_stfu.rs index be2029194..87845cf28 100644 --- a/fuzz/src/msg_targets/msg_stfu.rs +++ b/fuzz/src/msg_targets/msg_stfu.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_abort.rs b/fuzz/src/msg_targets/msg_tx_abort.rs index c361b6546..c80df4850 100644 --- a/fuzz/src/msg_targets/msg_tx_abort.rs +++ b/fuzz/src/msg_targets/msg_tx_abort.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_ack_rbf.rs b/fuzz/src/msg_targets/msg_tx_ack_rbf.rs index 9931bfcfb..41fd1ed9c 100644 --- a/fuzz/src/msg_targets/msg_tx_ack_rbf.rs +++ b/fuzz/src/msg_targets/msg_tx_ack_rbf.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_add_input.rs b/fuzz/src/msg_targets/msg_tx_add_input.rs index f212b59cd..8ae0c6103 100644 --- a/fuzz/src/msg_targets/msg_tx_add_input.rs +++ b/fuzz/src/msg_targets/msg_tx_add_input.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_add_output.rs b/fuzz/src/msg_targets/msg_tx_add_output.rs index 49b23218f..04511ed59 100644 --- a/fuzz/src/msg_targets/msg_tx_add_output.rs +++ b/fuzz/src/msg_targets/msg_tx_add_output.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_complete.rs b/fuzz/src/msg_targets/msg_tx_complete.rs index c4227b152..4cd1a2712 100644 --- a/fuzz/src/msg_targets/msg_tx_complete.rs +++ b/fuzz/src/msg_targets/msg_tx_complete.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_init_rbf.rs b/fuzz/src/msg_targets/msg_tx_init_rbf.rs index ea021dc60..eab0a747e 100644 --- a/fuzz/src/msg_targets/msg_tx_init_rbf.rs +++ b/fuzz/src/msg_targets/msg_tx_init_rbf.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_remove_input.rs b/fuzz/src/msg_targets/msg_tx_remove_input.rs index fe69ad41b..1f934eac2 100644 --- a/fuzz/src/msg_targets/msg_tx_remove_input.rs +++ b/fuzz/src/msg_targets/msg_tx_remove_input.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_remove_output.rs b/fuzz/src/msg_targets/msg_tx_remove_output.rs index 6c09d4d9f..a9e0e8b2e 100644 --- a/fuzz/src/msg_targets/msg_tx_remove_output.rs +++ b/fuzz/src/msg_targets/msg_tx_remove_output.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_tx_signatures.rs b/fuzz/src/msg_targets/msg_tx_signatures.rs index 54392d48c..17dc063ad 100644 --- a/fuzz/src/msg_targets/msg_tx_signatures.rs +++ b/fuzz/src/msg_targets/msg_tx_signatures.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_update_add_htlc.rs b/fuzz/src/msg_targets/msg_update_add_htlc.rs index e8edf4f4d..45a261624 100644 --- a/fuzz/src/msg_targets/msg_update_add_htlc.rs +++ b/fuzz/src/msg_targets/msg_update_add_htlc.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_update_fail_htlc.rs b/fuzz/src/msg_targets/msg_update_fail_htlc.rs index b93cc60b5..e338beeee 100644 --- a/fuzz/src/msg_targets/msg_update_fail_htlc.rs +++ b/fuzz/src/msg_targets/msg_update_fail_htlc.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_update_fail_malformed_htlc.rs b/fuzz/src/msg_targets/msg_update_fail_malformed_htlc.rs index 24718d54a..6c1914f03 100644 --- a/fuzz/src/msg_targets/msg_update_fail_malformed_htlc.rs +++ b/fuzz/src/msg_targets/msg_update_fail_malformed_htlc.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_update_fee.rs b/fuzz/src/msg_targets/msg_update_fee.rs index 92661537b..991dde925 100644 --- a/fuzz/src/msg_targets/msg_update_fee.rs +++ b/fuzz/src/msg_targets/msg_update_fee.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_update_fulfill_htlc.rs b/fuzz/src/msg_targets/msg_update_fulfill_htlc.rs index 7f9463e27..61e3f30b9 100644 --- a/fuzz/src/msg_targets/msg_update_fulfill_htlc.rs +++ b/fuzz/src/msg_targets/msg_update_fulfill_htlc.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/msg_warning_message.rs b/fuzz/src/msg_targets/msg_warning_message.rs index a5bcf4111..0e1a45666 100644 --- a/fuzz/src/msg_targets/msg_warning_message.rs +++ b/fuzz/src/msg_targets/msg_warning_message.rs @@ -10,6 +10,8 @@ // 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. +#![cfg_attr(rustfmt, rustfmt_skip)] + use crate::msg_targets::utils::VecWriter; use crate::utils::test_logger; diff --git a/fuzz/src/msg_targets/utils.rs b/fuzz/src/msg_targets/utils.rs index 6325f3bf1..5fa474cbf 100644 --- a/fuzz/src/msg_targets/utils.rs +++ b/fuzz/src/msg_targets/utils.rs @@ -29,81 +29,73 @@ impl Writer for VecWriter { // entirely #[macro_export] macro_rules! test_msg { - ($MsgType: path, $data: ident) => { - { - use lightning::util::ser::{Writeable, Readable}; - let mut r = ::std::io::Cursor::new($data); - if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { - let p = r.position() as usize; - let mut w = VecWriter(Vec::new()); - msg.write(&mut w).unwrap(); + ($MsgType: path, $data: ident) => {{ + use lightning::util::ser::{Readable, Writeable}; + let mut r = ::std::io::Cursor::new($data); + if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { + let p = r.position() as usize; + let mut w = VecWriter(Vec::new()); + msg.write(&mut w).unwrap(); - assert_eq!(w.0.len(), p); - assert_eq!(msg.serialized_length(), p); - assert_eq!(&r.into_inner()[..p], &w.0[..p]); - } + assert_eq!(w.0.len(), p); + assert_eq!(msg.serialized_length(), p); + assert_eq!(&r.into_inner()[..p], &w.0[..p]); } - } + }}; } // Tests a message that may lose data on roundtrip, but shoulnd't lose data compared to our // re-serialization. #[macro_export] macro_rules! test_msg_simple { - ($MsgType: path, $data: ident) => { - { - use lightning::util::ser::{Writeable, Readable}; - let mut r = ::std::io::Cursor::new($data); - if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { - let mut w = VecWriter(Vec::new()); - msg.write(&mut w).unwrap(); - assert_eq!(msg.serialized_length(), w.0.len()); + ($MsgType: path, $data: ident) => {{ + use lightning::util::ser::{Readable, Writeable}; + let mut r = ::std::io::Cursor::new($data); + if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { + let mut w = VecWriter(Vec::new()); + msg.write(&mut w).unwrap(); + assert_eq!(msg.serialized_length(), w.0.len()); - let msg = <$MsgType as Readable>::read(&mut ::std::io::Cursor::new(&w.0)).unwrap(); - let mut w_two = VecWriter(Vec::new()); - msg.write(&mut w_two).unwrap(); - assert_eq!(&w.0[..], &w_two.0[..]); - } + let msg = <$MsgType as Readable>::read(&mut ::std::io::Cursor::new(&w.0)).unwrap(); + let mut w_two = VecWriter(Vec::new()); + msg.write(&mut w_two).unwrap(); + assert_eq!(&w.0[..], &w_two.0[..]); } - } + }}; } // Tests a message that must survive roundtrip exactly, and must exactly empty the read buffer and // split it back out on re-serialization. #[macro_export] macro_rules! test_msg_exact { - ($MsgType: path, $data: ident) => { - { - use lightning::util::ser::{Writeable, Readable}; - let mut r = ::std::io::Cursor::new($data); - if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { - let mut w = VecWriter(Vec::new()); - msg.write(&mut w).unwrap(); - assert_eq!(&r.into_inner()[..], &w.0[..]); - assert_eq!(msg.serialized_length(), w.0.len()); - } + ($MsgType: path, $data: ident) => {{ + use lightning::util::ser::{Readable, Writeable}; + let mut r = ::std::io::Cursor::new($data); + if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { + let mut w = VecWriter(Vec::new()); + msg.write(&mut w).unwrap(); + assert_eq!(&r.into_inner()[..], &w.0[..]); + assert_eq!(msg.serialized_length(), w.0.len()); } - } + }}; } // Tests a message that must survive roundtrip exactly, modulo one "hole" which may be set to // any value on re-serialization. #[macro_export] macro_rules! test_msg_hole { - ($MsgType: path, $data: ident, $hole: expr, $hole_len: expr) => { - { - use lightning::util::ser::{Writeable, Readable}; - let mut r = ::std::io::Cursor::new($data); - if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { - let mut w = VecWriter(Vec::new()); - msg.write(&mut w).unwrap(); - let p = w.0.len() as usize; - assert_eq!(msg.serialized_length(), p); + ($MsgType: path, $data: ident, $hole: expr, $hole_len: expr) => {{ + use lightning::util::ser::{Readable, Writeable}; + let mut r = ::std::io::Cursor::new($data); + if let Ok(msg) = <$MsgType as Readable>::read(&mut r) { + let mut w = VecWriter(Vec::new()); + msg.write(&mut w).unwrap(); + let p = w.0.len() as usize; + assert_eq!(msg.serialized_length(), p); - assert_eq!(w.0.len(), p); - assert_eq!(&r.get_ref()[..$hole], &w.0[..$hole]); - assert_eq!(&r.get_ref()[$hole+$hole_len..p], &w.0[$hole+$hole_len..]); - } + assert_eq!(w.0.len(), p); + assert_eq!(&r.get_ref()[..$hole], &w.0[..$hole]); + assert_eq!(&r.get_ref()[$hole + $hole_len..p], &w.0[$hole + $hole_len..]); } - } + }}; } diff --git a/rustfmt_excluded_files b/rustfmt_excluded_files index 5fb910e7c..c94d48bfe 100644 --- a/rustfmt_excluded_files +++ b/rustfmt_excluded_files @@ -1,54 +1,6 @@ ./bench/benches/bench.rs ./fuzz/src/chanmon_consistency.rs ./fuzz/src/full_stack.rs -./fuzz/src/msg_targets/mod.rs -./fuzz/src/msg_targets/msg_accept_channel.rs -./fuzz/src/msg_targets/msg_accept_channel_v2.rs -./fuzz/src/msg_targets/msg_announcement_signatures.rs -./fuzz/src/msg_targets/msg_channel_announcement.rs -./fuzz/src/msg_targets/msg_channel_details.rs -./fuzz/src/msg_targets/msg_channel_ready.rs -./fuzz/src/msg_targets/msg_channel_reestablish.rs -./fuzz/src/msg_targets/msg_channel_update.rs -./fuzz/src/msg_targets/msg_closing_signed.rs -./fuzz/src/msg_targets/msg_commitment_signed.rs -./fuzz/src/msg_targets/msg_decoded_onion_error_packet.rs -./fuzz/src/msg_targets/msg_error_message.rs -./fuzz/src/msg_targets/msg_funding_created.rs -./fuzz/src/msg_targets/msg_funding_signed.rs -./fuzz/src/msg_targets/msg_gossip_timestamp_filter.rs -./fuzz/src/msg_targets/msg_init.rs -./fuzz/src/msg_targets/msg_node_announcement.rs -./fuzz/src/msg_targets/msg_open_channel.rs -./fuzz/src/msg_targets/msg_open_channel_v2.rs -./fuzz/src/msg_targets/msg_ping.rs -./fuzz/src/msg_targets/msg_pong.rs -./fuzz/src/msg_targets/msg_query_channel_range.rs -./fuzz/src/msg_targets/msg_query_short_channel_ids.rs -./fuzz/src/msg_targets/msg_reply_channel_range.rs -./fuzz/src/msg_targets/msg_reply_short_channel_ids_end.rs -./fuzz/src/msg_targets/msg_revoke_and_ack.rs -./fuzz/src/msg_targets/msg_shutdown.rs -./fuzz/src/msg_targets/msg_splice.rs -./fuzz/src/msg_targets/msg_splice_ack.rs -./fuzz/src/msg_targets/msg_splice_locked.rs -./fuzz/src/msg_targets/msg_stfu.rs -./fuzz/src/msg_targets/msg_tx_abort.rs -./fuzz/src/msg_targets/msg_tx_ack_rbf.rs -./fuzz/src/msg_targets/msg_tx_add_input.rs -./fuzz/src/msg_targets/msg_tx_add_output.rs -./fuzz/src/msg_targets/msg_tx_complete.rs -./fuzz/src/msg_targets/msg_tx_init_rbf.rs -./fuzz/src/msg_targets/msg_tx_remove_input.rs -./fuzz/src/msg_targets/msg_tx_remove_output.rs -./fuzz/src/msg_targets/msg_tx_signatures.rs -./fuzz/src/msg_targets/msg_update_add_htlc.rs -./fuzz/src/msg_targets/msg_update_fail_htlc.rs -./fuzz/src/msg_targets/msg_update_fail_malformed_htlc.rs -./fuzz/src/msg_targets/msg_update_fee.rs -./fuzz/src/msg_targets/msg_update_fulfill_htlc.rs -./fuzz/src/msg_targets/msg_warning_message.rs -./fuzz/src/msg_targets/utils.rs ./fuzz/src/offer_deser.rs ./fuzz/src/onion_hop_data.rs ./fuzz/src/onion_message.rs