Skip to content

Commit 0b0c933

Browse files
committed
Rustfmt mod and lib files
They refer to other files and make rustfmt want to search for those. This is problematic with the skip-insertion script.
1 parent 5688166 commit 0b0c933

File tree

5 files changed

+88
-92
lines changed

5 files changed

+88
-92
lines changed

fuzz/src/msg_targets/mod.rs

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,47 @@
1-
#![cfg_attr(rustfmt, rustfmt_skip)]
2-
mod utils;
31
pub mod msg_accept_channel;
2+
pub mod msg_accept_channel_v2;
43
pub mod msg_announcement_signatures;
4+
pub mod msg_channel_announcement;
5+
pub mod msg_channel_details;
6+
pub mod msg_channel_ready;
7+
pub mod msg_channel_reestablish;
8+
pub mod msg_channel_update;
59
pub mod msg_closing_signed;
610
pub mod msg_commitment_signed;
11+
pub mod msg_decoded_onion_error_packet;
12+
pub mod msg_error_message;
713
pub mod msg_funding_created;
8-
pub mod msg_channel_ready;
914
pub mod msg_funding_signed;
1015
pub mod msg_gossip_timestamp_filter;
1116
pub mod msg_init;
17+
pub mod msg_node_announcement;
1218
pub mod msg_open_channel;
19+
pub mod msg_open_channel_v2;
1320
pub mod msg_ping;
1421
pub mod msg_pong;
1522
pub mod msg_query_channel_range;
23+
pub mod msg_query_short_channel_ids;
24+
pub mod msg_reply_channel_range;
1625
pub mod msg_reply_short_channel_ids_end;
1726
pub mod msg_revoke_and_ack;
1827
pub mod msg_shutdown;
28+
pub mod msg_splice_ack;
29+
pub mod msg_splice_init;
30+
pub mod msg_splice_locked;
31+
pub mod msg_stfu;
32+
pub mod msg_tx_abort;
33+
pub mod msg_tx_ack_rbf;
34+
pub mod msg_tx_add_input;
35+
pub mod msg_tx_add_output;
36+
pub mod msg_tx_complete;
37+
pub mod msg_tx_init_rbf;
38+
pub mod msg_tx_remove_input;
39+
pub mod msg_tx_remove_output;
40+
pub mod msg_tx_signatures;
1941
pub mod msg_update_add_htlc;
2042
pub mod msg_update_fail_htlc;
2143
pub mod msg_update_fail_malformed_htlc;
2244
pub mod msg_update_fee;
2345
pub mod msg_update_fulfill_htlc;
24-
pub mod msg_channel_reestablish;
25-
pub mod msg_decoded_onion_error_packet;
26-
pub mod msg_channel_announcement;
27-
pub mod msg_node_announcement;
28-
pub mod msg_channel_update;
29-
pub mod msg_query_short_channel_ids;
30-
pub mod msg_reply_channel_range;
31-
pub mod msg_error_message;
3246
pub mod msg_warning_message;
33-
pub mod msg_channel_details;
34-
pub mod msg_open_channel_v2;
35-
pub mod msg_accept_channel_v2;
36-
pub mod msg_tx_add_input;
37-
pub mod msg_tx_add_output;
38-
pub mod msg_tx_remove_input;
39-
pub mod msg_tx_remove_output;
40-
pub mod msg_tx_complete;
41-
pub mod msg_tx_signatures;
42-
pub mod msg_tx_init_rbf;
43-
pub mod msg_tx_ack_rbf;
44-
pub mod msg_tx_abort;
45-
pub mod msg_stfu;
46-
pub mod msg_splice_init;
47-
pub mod msg_splice_ack;
48-
pub mod msg_splice_locked;
47+
mod utils;

lightning/src/chain/mod.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(rustfmt, rustfmt_skip)]
2-
31
// This file is Copyright its original authors, visible in version control
42
// history.
53
//
@@ -13,26 +11,26 @@
1311
1412
use bitcoin::block::{Block, Header};
1513
use bitcoin::constants::genesis_block;
16-
use bitcoin::script::{Script, ScriptBuf};
1714
use bitcoin::hash_types::{BlockHash, Txid};
1815
use bitcoin::network::Network;
16+
use bitcoin::script::{Script, ScriptBuf};
1917
use bitcoin::secp256k1::PublicKey;
2018

2119
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, MonitorEvent};
22-
use crate::ln::types::ChannelId;
23-
use crate::sign::ecdsa::EcdsaChannelSigner;
2420
use crate::chain::transaction::{OutPoint, TransactionData};
2521
use crate::impl_writeable_tlv_based;
22+
use crate::ln::types::ChannelId;
23+
use crate::sign::ecdsa::EcdsaChannelSigner;
2624

2725
#[allow(unused_imports)]
2826
use crate::prelude::*;
2927

3028
pub mod chaininterface;
3129
pub mod chainmonitor;
3230
pub mod channelmonitor;
33-
pub mod transaction;
3431
pub(crate) mod onchaintx;
3532
pub(crate) mod package;
33+
pub mod transaction;
3634

3735
/// The best known block as identified by its hash and height.
3836
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
@@ -47,10 +45,7 @@ impl BestBlock {
4745
/// Constructs a `BestBlock` that represents the genesis block at height 0 of the given
4846
/// network.
4947
pub fn from_network(network: Network) -> Self {
50-
BestBlock {
51-
block_hash: genesis_block(network).header.block_hash(),
52-
height: 0,
53-
}
48+
BestBlock { block_hash: genesis_block(network).header.block_hash(), height: 0 }
5449
}
5550

5651
/// Returns a `BestBlock` as identified by the given block hash and height.
@@ -67,7 +62,6 @@ impl_writeable_tlv_based!(BestBlock, {
6762
(2, height, required),
6863
});
6964

70-
7165
/// The `Listen` trait is used to notify when blocks have been connected or disconnected from the
7266
/// chain.
7367
///
@@ -289,7 +283,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
289283
/// [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
290284
/// [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
291285
/// [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
292-
fn watch_channel(&self, channel_id: ChannelId, monitor: ChannelMonitor<ChannelSigner>) -> Result<ChannelMonitorUpdateStatus, ()>;
286+
fn watch_channel(
287+
&self, channel_id: ChannelId, monitor: ChannelMonitor<ChannelSigner>,
288+
) -> Result<ChannelMonitorUpdateStatus, ()>;
293289

294290
/// Updates a channel identified by `channel_id` by applying `update` to its monitor.
295291
///
@@ -306,7 +302,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
306302
/// [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
307303
///
308304
/// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
309-
fn update_channel(&self, channel_id: ChannelId, update: &ChannelMonitorUpdate) -> ChannelMonitorUpdateStatus;
305+
fn update_channel(
306+
&self, channel_id: ChannelId, update: &ChannelMonitorUpdate,
307+
) -> ChannelMonitorUpdateStatus;
310308

311309
/// Returns any monitor events since the last call. Subsequent calls must only return new
312310
/// events.
@@ -317,7 +315,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
317315
///
318316
/// For details on asynchronous [`ChannelMonitor`] updating and returning
319317
/// [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
320-
fn release_pending_monitor_events(&self) -> Vec<(OutPoint, ChannelId, Vec<MonitorEvent>, PublicKey)>;
318+
fn release_pending_monitor_events(
319+
&self,
320+
) -> Vec<(OutPoint, ChannelId, Vec<MonitorEvent>, PublicKey)>;
321321
}
322322

323323
/// The `Filter` trait defines behavior for indicating chain activity of interest pertaining to

lightning/src/lib.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(rustfmt, rustfmt_skip)]
2-
31
// This file is Copyright its original authors, visible in version control
42
// history.
53
//
@@ -32,18 +30,14 @@
3230
//! * `grind_signatures`
3331
3432
#![cfg_attr(not(any(test, fuzzing, feature = "_test_utils")), deny(missing_docs))]
35-
3633
#![deny(rustdoc::broken_intra_doc_links)]
3734
#![deny(rustdoc::private_intra_doc_links)]
38-
3935
// In general, rust is absolutely horrid at supporting users doing things like,
4036
// for example, compiling Rust code for real environments. Disable useless lints
4137
// that don't do anything but annoy us and cant actually ever be resolved.
4238
#![allow(bare_trait_objects)]
4339
#![allow(ellipsis_inclusive_range_patterns)]
44-
4540
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
46-
4741
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
4842

4943
#[cfg(all(fuzzing, test))]
@@ -61,24 +55,28 @@ pub extern crate lightning_invoice as bolt11_invoice;
6155
#[cfg(any(test, feature = "std"))]
6256
extern crate core;
6357

64-
#[cfg(any(test, feature = "_test_utils"))] extern crate regex;
58+
#[cfg(any(test, feature = "_test_utils"))]
59+
extern crate regex;
6560

66-
#[cfg(not(feature = "std"))] extern crate libm;
61+
#[cfg(not(feature = "std"))]
62+
extern crate libm;
6763

68-
#[cfg(ldk_bench)] extern crate criterion;
64+
#[cfg(ldk_bench)]
65+
extern crate criterion;
6966

70-
#[cfg(all(feature = "std", test))] extern crate parking_lot;
67+
#[cfg(all(feature = "std", test))]
68+
extern crate parking_lot;
7169

7270
#[macro_use]
7371
pub mod util;
72+
pub mod blinded_path;
7473
pub mod chain;
74+
pub mod events;
7575
pub mod ln;
7676
pub mod offers;
77+
pub mod onion_message;
7778
pub mod routing;
7879
pub mod sign;
79-
pub mod onion_message;
80-
pub mod blinded_path;
81-
pub mod events;
8280

8381
pub(crate) mod crypto;
8482

@@ -96,7 +94,7 @@ pub mod io_extras {
9694
pub use bitcoin::io::sink;
9795

9896
pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> Result<u64, io::Error>
99-
where
97+
where
10098
R: Read,
10199
W: Write,
102100
{
@@ -106,7 +104,10 @@ pub mod io_extras {
106104
loop {
107105
match reader.read(&mut buf) {
108106
Ok(0) => break,
109-
Ok(n) => { writer.write_all(&buf[0..n])?; count += n as u64; },
107+
Ok(n) => {
108+
writer.write_all(&buf[0..n])?;
109+
count += n as u64;
110+
},
110111
Err(ref e) if e.kind() == io::ErrorKind::Interrupted => {},
111112
Err(e) => return Err(e.into()),
112113
};
@@ -132,7 +133,7 @@ pub mod io_extras {
132133
mod prelude {
133134
#![allow(unused_imports)]
134135

135-
pub use alloc::{vec, vec::Vec, string::String, collections::VecDeque, boxed::Box};
136+
pub use alloc::{boxed::Box, collections::VecDeque, string::String, vec, vec::Vec};
136137

137138
pub use alloc::borrow::ToOwned;
138139
pub use alloc::string::ToString;

lightning/src/ln/mod.rs

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(rustfmt, rustfmt_skip)]
2-
31
// This file is Copyright its original authors, visible in version control
42
// history.
53
//
@@ -15,15 +13,15 @@
1513
#[macro_use]
1614
pub mod functional_test_utils;
1715

18-
pub mod onion_payment;
19-
pub mod channelmanager;
16+
pub mod chan_utils;
2017
pub mod channel_keys;
2118
pub mod channel_state;
19+
pub mod channelmanager;
20+
mod features;
2221
pub mod inbound_payment;
2322
pub mod msgs;
23+
pub mod onion_payment;
2424
pub mod peer_handler;
25-
pub mod chan_utils;
26-
mod features;
2725
pub mod script;
2826
pub mod types;
2927

@@ -59,64 +57,64 @@ pub use onion_utils::process_onion_failure;
5957
#[cfg(fuzzing)]
6058
pub use onion_utils::AttributionData;
6159

60+
#[cfg(all(test, async_payments))]
61+
#[allow(unused_mut)]
62+
mod async_payments_tests;
6263
#[cfg(test)]
6364
#[allow(unused_mut)]
64-
pub mod bolt11_payment_tests;
65+
mod async_signer_tests;
6566
#[cfg(test)]
6667
#[allow(unused_mut)]
6768
mod blinded_payment_tests;
68-
#[cfg(all(test, async_payments))]
69+
#[cfg(test)]
6970
#[allow(unused_mut)]
70-
mod async_payments_tests;
71+
pub mod bolt11_payment_tests;
72+
#[cfg(test)]
73+
#[allow(unused_mut)]
74+
mod chanmon_update_fail_tests;
75+
#[cfg(test)]
76+
#[allow(unused_mut)]
77+
mod dual_funding_tests;
7178
#[cfg(any(test, feature = "_externalize_tests"))]
7279
#[allow(unused_mut)]
7380
pub mod functional_tests;
7481
#[cfg(any(test, feature = "_externalize_tests"))]
7582
#[allow(unused_mut)]
7683
pub mod htlc_reserve_unit_tests;
77-
#[cfg(any(test, feature = "_externalize_tests"))]
78-
#[allow(unused_mut)]
79-
pub mod update_fee_tests;
80-
#[cfg(all(test, splicing))]
81-
#[allow(unused_mut)]
82-
mod splicing_tests;
8384
#[cfg(test)]
8485
#[allow(unused_mut)]
8586
mod max_payment_path_len_tests;
8687
#[cfg(test)]
8788
#[allow(unused_mut)]
88-
mod payment_tests;
89-
#[cfg(test)]
90-
#[allow(unused_mut)]
91-
mod priv_short_conf_tests;
92-
#[cfg(test)]
93-
#[allow(unused_mut)]
94-
mod chanmon_update_fail_tests;
95-
#[cfg(test)]
96-
#[allow(unused_mut)]
97-
mod reorg_tests;
89+
mod monitor_tests;
9890
#[cfg(test)]
9991
#[allow(unused_mut)]
100-
mod reload_tests;
92+
mod offers_tests;
10193
#[cfg(test)]
10294
#[allow(unused_mut)]
10395
mod onion_route_tests;
10496
#[cfg(test)]
10597
#[allow(unused_mut)]
106-
mod monitor_tests;
98+
mod payment_tests;
10799
#[cfg(test)]
108100
#[allow(unused_mut)]
109-
mod shutdown_tests;
101+
mod priv_short_conf_tests;
110102
#[cfg(test)]
111103
mod quiescence_tests;
112104
#[cfg(test)]
113105
#[allow(unused_mut)]
114-
mod async_signer_tests;
106+
mod reload_tests;
115107
#[cfg(test)]
116108
#[allow(unused_mut)]
117-
mod offers_tests;
109+
mod reorg_tests;
118110
#[cfg(test)]
119111
#[allow(unused_mut)]
120-
mod dual_funding_tests;
112+
mod shutdown_tests;
113+
#[cfg(all(test, splicing))]
114+
#[allow(unused_mut)]
115+
mod splicing_tests;
116+
#[cfg(any(test, feature = "_externalize_tests"))]
117+
#[allow(unused_mut)]
118+
pub mod update_fee_tests;
121119

122120
pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;

lightning/src/routing/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![cfg_attr(rustfmt, rustfmt_skip)]
2-
31
// This file is Copyright its original authors, visible in version control
42
// history.
53
//
@@ -11,10 +9,10 @@
119

1210
//! Structs and impls for receiving messages about the network and storing the topology live here.
1311
14-
pub mod utxo;
1512
pub mod gossip;
13+
mod log_approx;
1614
pub mod router;
1715
pub mod scoring;
18-
mod log_approx;
1916
#[cfg(test)]
2017
pub(crate) mod test_utils;
18+
pub mod utxo;

0 commit comments

Comments
 (0)