lightning/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]
13pub(crate) mod fuzz_wrappers;
14
15#[macro_use]
16pub mod ser_macros;
17
18pub mod errors;
19pub mod ser;
20pub mod message_signing;
21pub mod persist;
22pub mod scid_utils;
23pub mod sweep;
24pub mod wakers;
25#[cfg(fuzzing)]
26pub mod base32;
27#[cfg(not(fuzzing))]
28pub(crate) mod base32;
29
30pub(crate) mod atomic_counter;
31pub(crate) mod async_poll;
32pub(crate) mod byte_utils;
33pub(crate) mod transaction_utils;
34pub mod hash_tables;
35
36#[cfg(feature = "std")]
37pub(crate) mod time;
38
39pub mod indexed_map;
40
41/// Logging macro utilities.
42#[macro_use]
43pub(crate) mod macro_logger;
44
45// These have to come after macro_logger to build
46pub mod logger;
47pub mod config;
48
49#[cfg(any(test, feature = "_test_utils"))]
50pub mod test_utils;
51
52/// impls of traits that add exra enforcement on the way they're called. Useful for detecting state
53/// machine errors and used in fuzz targets and tests.
54#[cfg(any(test, feature = "_test_utils"))]
55pub mod test_channel_signer;
56
57pub mod string {
58	//! Utilities to wrap untrusted strings and handle them (more) safely
59	//!
60	//! These re-exports are deprecated in favor of [`lightning::types::string`].
61	//!
62	//! [`lightning::types::string`]: crate::types::string
63	pub use lightning_types::string::{PrintableString, UntrustedString};
64}