Merge pull request #2008 from valentinewallace/2023-02-remove-manual-retries
[rust-lightning] / lightning / src / util / 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 //! Some utility modules live here. See individual sub-modules for more info.
11
12 #[macro_use]
13 pub(crate) mod fuzz_wrappers;
14
15 #[macro_use]
16 pub mod ser_macros;
17
18 pub mod events;
19 pub mod errors;
20 pub mod ser;
21 pub mod message_signing;
22 pub mod invoice;
23 pub mod persist;
24 pub mod string;
25 pub mod wakers;
26
27 pub(crate) mod atomic_counter;
28 pub(crate) mod byte_utils;
29 pub(crate) mod chacha20;
30 #[cfg(all(any(feature = "_bench_unstable", not(test)), feature = "std"))]
31 pub(crate) mod fairrwlock;
32 #[cfg(fuzzing)]
33 pub mod zbase32;
34 #[cfg(not(fuzzing))]
35 pub(crate) mod zbase32;
36 #[cfg(not(fuzzing))]
37 pub(crate) mod poly1305;
38 pub(crate) mod chacha20poly1305rfc;
39 pub(crate) mod transaction_utils;
40 pub(crate) mod scid_utils;
41 pub(crate) mod time;
42
43 pub mod indexed_map;
44
45 /// Logging macro utilities.
46 #[macro_use]
47 pub(crate) mod macro_logger;
48
49 /// Cryptography utilities.
50 pub(crate) mod crypto;
51
52 // These have to come after macro_logger to build
53 pub mod logger;
54 pub mod config;
55
56 #[cfg(any(test, fuzzing, feature = "_test_utils"))]
57 pub mod test_utils;
58
59 /// impls of traits that add exra enforcement on the way they're called. Useful for detecting state
60 /// machine errors and used in fuzz targets and tests.
61 #[cfg(any(test, fuzzing, feature = "_test_utils"))]
62 pub mod enforcing_trait_impls;
63