Remove unnecessary RecipientOnionFields clone.
[rust-lightning] / lightning / src / ln / mod.rs
1 // This file is Copyright its original authors, visible in version control
2 // history.
3 //
4 // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
5 // or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
7 // You may not use this file except in accordance with one or both of these
8 // licenses.
9
10 //! Implementations of various parts of the Lightning protocol are in this module.
11
12 #[cfg(any(test, feature = "_test_utils"))]
13 #[macro_use]
14 pub mod functional_test_utils;
15
16 pub mod onion_payment;
17 pub mod channelmanager;
18 pub mod channel_keys;
19 pub mod inbound_payment;
20 pub mod msgs;
21 pub mod peer_handler;
22 pub mod chan_utils;
23 pub mod features;
24 pub mod script;
25 pub mod types;
26
27 pub use types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
28
29 #[cfg(fuzzing)]
30 pub mod peer_channel_encryptor;
31 #[cfg(not(fuzzing))]
32 pub(crate) mod peer_channel_encryptor;
33
34 #[cfg(fuzzing)]
35 pub mod channel;
36 #[cfg(not(fuzzing))]
37 pub(crate) mod channel;
38
39 pub(crate) mod onion_utils;
40 mod outbound_payment;
41 pub mod wire;
42
43 pub use onion_utils::create_payment_onion;
44 // Older rustc (which we support) refuses to let us call the get_payment_preimage_hash!() macro
45 // without the node parameter being mut. This is incorrect, and thus newer rustcs will complain
46 // about an unnecessary mut. Thus, we silence the unused_mut warning in two test modules below.
47
48 #[cfg(test)]
49 #[allow(unused_mut)]
50 mod blinded_payment_tests;
51 #[cfg(test)]
52 #[allow(unused_mut)]
53 mod functional_tests;
54 #[cfg(test)]
55 #[allow(unused_mut)]
56 mod payment_tests;
57 #[cfg(test)]
58 #[allow(unused_mut)]
59 mod priv_short_conf_tests;
60 #[cfg(test)]
61 #[allow(unused_mut)]
62 mod chanmon_update_fail_tests;
63 #[cfg(test)]
64 #[allow(unused_mut)]
65 mod reorg_tests;
66 #[cfg(test)]
67 #[allow(unused_mut)]
68 mod reload_tests;
69 #[cfg(test)]
70 #[allow(unused_mut)]
71 mod onion_route_tests;
72 #[cfg(test)]
73 #[allow(unused_mut)]
74 mod monitor_tests;
75 #[cfg(test)]
76 #[allow(unused_mut)]
77 mod shutdown_tests;
78 #[cfg(all(test, async_signing))]
79 #[allow(unused_mut)]
80 mod async_signer_tests;
81 #[cfg(test)]
82 #[allow(unused_mut)]
83 mod offers_tests;
84 #[allow(dead_code)] // TODO(dual_funding): Exchange for dual_funding cfg
85 pub(crate) mod interactivetxs;
86
87 pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;