lightning/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]
14pub mod functional_test_utils;
15
16pub mod onion_payment;
17pub mod channelmanager;
18pub mod channel_keys;
19pub mod channel_state;
20pub mod inbound_payment;
21pub mod msgs;
22pub mod peer_handler;
23pub mod chan_utils;
24mod features;
25pub mod script;
26pub mod types;
27
28// TODO: These modules were moved from lightning-invoice and need to be better integrated into this
29// crate now:
30pub mod invoice_utils;
31pub mod bolt11_payment;
32
33#[cfg(fuzzing)]
34pub mod peer_channel_encryptor;
35#[cfg(not(fuzzing))]
36pub(crate) mod peer_channel_encryptor;
37
38#[cfg(fuzzing)]
39pub mod channel;
40#[cfg(not(fuzzing))]
41pub(crate) mod channel;
42
43pub(crate) mod onion_utils;
44mod outbound_payment;
45pub mod wire;
46
47#[allow(dead_code)] // TODO(dual_funding): Remove once contribution to V2 channels is enabled.
48pub(crate) mod interactivetxs;
49
50pub use onion_utils::create_payment_onion;
51// Older rustc (which we support) refuses to let us call the get_payment_preimage_hash!() macro
52// without the node parameter being mut. This is incorrect, and thus newer rustcs will complain
53// about an unnecessary mut. Thus, we silence the unused_mut warning in two test modules below.
54
55#[cfg(test)]
56#[allow(unused_mut)]
57mod blinded_payment_tests;
58#[cfg(test)]
59#[allow(unused_mut)]
60mod functional_tests;
61#[cfg(test)]
62#[allow(unused_mut)]
63mod max_payment_path_len_tests;
64#[cfg(test)]
65#[allow(unused_mut)]
66mod payment_tests;
67#[cfg(test)]
68#[allow(unused_mut)]
69mod priv_short_conf_tests;
70#[cfg(test)]
71#[allow(unused_mut)]
72mod chanmon_update_fail_tests;
73#[cfg(test)]
74#[allow(unused_mut)]
75mod reorg_tests;
76#[cfg(test)]
77#[allow(unused_mut)]
78mod reload_tests;
79#[cfg(test)]
80#[allow(unused_mut)]
81mod onion_route_tests;
82#[cfg(test)]
83#[allow(unused_mut)]
84mod monitor_tests;
85#[cfg(test)]
86#[allow(unused_mut)]
87mod shutdown_tests;
88#[cfg(test)]
89#[allow(unused_mut)]
90mod async_signer_tests;
91#[cfg(test)]
92#[allow(unused_mut)]
93mod offers_tests;
94#[cfg(test)]
95#[allow(unused_mut)]
96mod dual_funding_tests;
97
98pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;