]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Export `outbound_payment` structs in their respective modules
authorMatt Corallo <git@bluematt.me>
Tue, 28 Feb 2023 21:45:14 +0000 (21:45 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 22 Apr 2024 21:57:48 +0000 (21:57 +0000)
Re-exports in Rust make `use` statements a little shorter, but for
otherwise don't materially change a crate's API. Sadly, the C
bindings generator currently can't figure out re-exports, but it
also exports everything into one global namespace, so it doesn't
matter much anyway.

fuzz/src/chanmon_consistency.rs
fuzz/src/full_stack.rs
lightning-invoice/src/payment.rs
lightning-invoice/src/utils.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/mod.rs

index 89ff07fe698268a9f8fff51f1b298c124b46e73b..f44218a44269d4a2bcc5412fdabc131edbade422 100644 (file)
@@ -41,7 +41,8 @@ use lightning::sign::{KeyMaterial, InMemorySigner, Recipient, EntropySource, Nod
 use lightning::events;
 use lightning::events::MessageSendEventsProvider;
 use lightning::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
-use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, PaymentSendFailure, ChannelManagerReadArgs, PaymentId, RecipientOnionFields};
+use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, ChannelManagerReadArgs, PaymentId};
+use lightning::ln::outbound_payment::{RecipientOnionFields, PaymentSendFailure};
 use lightning::ln::channel::FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE;
 use lightning::ln::msgs::{self, CommitmentUpdate, ChannelMessageHandler, DecodeError, UpdateAddHTLC, Init};
 use lightning::ln::script::ShutdownScript;
index 1f5ceb2123517a5b14559ee5e82adc085fe576b7..2dd8e9440d531704381c7785e30ae311b49ccce0 100644 (file)
@@ -38,7 +38,8 @@ use lightning::chain::transaction::OutPoint;
 use lightning::sign::{InMemorySigner, Recipient, KeyMaterial, EntropySource, NodeSigner, SignerProvider};
 use lightning::events::Event;
 use lightning::ln::{ChannelId, PaymentHash, PaymentPreimage, PaymentSecret};
-use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, PaymentId, RecipientOnionFields, Retry};
+use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, PaymentId};
+use lightning::ln::outbound_payment::{RecipientOnionFields, Retry};
 use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor,IgnoringMessageHandler};
 use lightning::ln::msgs::{self, DecodeError};
 use lightning::ln::script::ShutdownScript;
index 8196fa9eb89a81d7df74300484ee96cddee5588f..152b9d348322c009498bf1fae10a8c2854c376fc 100644 (file)
@@ -13,7 +13,7 @@ use crate::Bolt11Invoice;
 use bitcoin::hashes::Hash;
 
 use lightning::ln::PaymentHash;
-use lightning::ln::channelmanager::RecipientOnionFields;
+use lightning::ln::outbound_payment::RecipientOnionFields;
 use lightning::routing::router::{PaymentParameters, RouteParameters};
 
 /// Builds the necessary parameters to pay or pre-flight probe the given zero-amount
@@ -170,7 +170,8 @@ mod tests {
        #[cfg(feature = "std")]
        fn payment_metadata_end_to_end() {
                use lightning::events::Event;
-               use lightning::ln::channelmanager::{Retry, PaymentId};
+               use lightning::ln::channelmanager::PaymentId;
+               use lightning::ln::outbound_payment::Retry;
                use lightning::ln::msgs::ChannelMessageHandler;
                use lightning::ln::functional_test_utils::*;
                // Test that a payment metadata read from an invoice passed to `pay_invoice` makes it all
index 5e8b72467e5da655cd9f77876ac692b948498833..bfd3bb0192d7aef95a63f30b85fe76714775932a 100644 (file)
@@ -825,7 +825,8 @@ mod test {
        use lightning::ln::PaymentHash;
        #[cfg(feature = "std")]
        use lightning::ln::PaymentPreimage;
-       use lightning::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields, Retry};
+       use lightning::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId};
+       use lightning::ln::outbound_payment::{RecipientOnionFields, Retry};
        use lightning::ln::functional_test_utils::*;
        use lightning::ln::msgs::ChannelMessageHandler;
        use lightning::routing::router::{PaymentParameters, RouteParameters};
index 0f881637ff152e5eb3dbe263b086853fab9fbf3c..de1145cc7cedd222b97d02dfc779520d267cd773 100644 (file)
@@ -95,7 +95,7 @@ use core::time::Duration;
 use core::ops::Deref;
 
 // Re-export this for use in the public API.
-pub use crate::ln::outbound_payment::{PaymentSendFailure, ProbeSendFailure, Retry, RetryableSendFailure, RecipientOnionFields};
+pub(crate) use crate::ln::outbound_payment::{PaymentSendFailure, ProbeSendFailure, Retry, RetryableSendFailure, RecipientOnionFields};
 use crate::ln::script::ShutdownScript;
 
 // We hold various information about HTLC relay in the HTLC objects in Channel itself:
index 43ec34eaf610fae5253516f7febde751ba6016b0..5692f23e088478efd2d9e3d5b74951b68281dde0 100644 (file)
@@ -38,7 +38,7 @@ pub(crate) mod channel;
 pub use channel_id::ChannelId;
 
 pub(crate) mod onion_utils;
-mod outbound_payment;
+pub mod outbound_payment;
 pub mod wire;
 
 pub use onion_utils::create_payment_onion;