X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Fmod.rs;h=7cbb2ce5ebe1b9eb22b3ac957dbb99b88d72afbc;hb=960dd658db6e66edd5255a5a4bddcbeb89a1e238;hp=38396dd74fc8cad6d1df3450644640c3a04f7610;hpb=f1c7fd2ab9b4df5f4b7cad855501d1178b2eb1c6;p=rust-lightning diff --git a/lightning/src/ln/mod.rs b/lightning/src/ln/mod.rs index 38396dd74..7cbb2ce5e 100644 --- a/lightning/src/ln/mod.rs +++ b/lightning/src/ln/mod.rs @@ -1,38 +1,87 @@ -//! High level lightning structs and impls live here. -//! -//! You probably want to create a channelmanager::ChannelManager, and a router::Router first. -//! Then, you probably want to pass them both on to a peer_handler::PeerManager and use that to -//! create/manage connections and call get_and_clear_pending_events after each action, handling -//! them appropriately. -//! -//! When you want to open/close a channel or send a payment, call into your ChannelManager and when -//! you want to learn things about the network topology (eg get a route for sending a payment), -//! call into your Router. +// This file is Copyright its original authors, visible in version control +// history. +// +// This file is licensed under the Apache License, Version 2.0 or the MIT license +// , at your option. +// You may not use this file except in accordance with one or both of these +// licenses. +//! Implementations of various parts of the Lightning protocol are in this module. + +#[cfg(any(test, feature = "_test_utils"))] +#[macro_use] +pub mod functional_test_utils; + +pub mod onion_payment; pub mod channelmanager; -pub mod channelmonitor; +pub mod channel_keys; +pub mod inbound_payment; pub mod msgs; -pub mod router; pub mod peer_handler; pub mod chan_utils; pub mod features; -pub(crate) mod onchaintx; +pub mod script; +pub mod types; + +pub use types::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret}; -#[cfg(feature = "fuzztarget")] +#[cfg(fuzzing)] pub mod peer_channel_encryptor; -#[cfg(not(feature = "fuzztarget"))] +#[cfg(not(fuzzing))] pub(crate) mod peer_channel_encryptor; -mod channel; -mod onion_utils; -mod wire; +#[cfg(fuzzing)] +pub mod channel; +#[cfg(not(fuzzing))] +pub(crate) mod channel; + +pub(crate) mod onion_utils; +mod outbound_payment; +pub mod wire; + +pub use onion_utils::create_payment_onion; +// Older rustc (which we support) refuses to let us call the get_payment_preimage_hash!() macro +// without the node parameter being mut. This is incorrect, and thus newer rustcs will complain +// about an unnecessary mut. Thus, we silence the unused_mut warning in two test modules below. #[cfg(test)] -#[macro_use] -pub(crate) mod functional_test_utils; +#[allow(unused_mut)] +mod blinded_payment_tests; #[cfg(test)] +#[allow(unused_mut)] mod functional_tests; #[cfg(test)] +#[allow(unused_mut)] +mod payment_tests; +#[cfg(test)] +#[allow(unused_mut)] +mod priv_short_conf_tests; +#[cfg(test)] +#[allow(unused_mut)] mod chanmon_update_fail_tests; #[cfg(test)] +#[allow(unused_mut)] mod reorg_tests; +#[cfg(test)] +#[allow(unused_mut)] +mod reload_tests; +#[cfg(test)] +#[allow(unused_mut)] +mod onion_route_tests; +#[cfg(test)] +#[allow(unused_mut)] +mod monitor_tests; +#[cfg(test)] +#[allow(unused_mut)] +mod shutdown_tests; +#[cfg(all(test, async_signing))] +#[allow(unused_mut)] +mod async_signer_tests; +#[cfg(test)] +#[allow(unused_mut)] +mod offers_tests; +#[allow(dead_code)] // TODO(dual_funding): Exchange for dual_funding cfg +pub(crate) mod interactivetxs; + +pub use self::peer_channel_encryptor::LN_MAX_MSG_LEN;