]> 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>
Tue, 14 May 2024 20:46:40 +0000 (20:46 +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 b3cf867d6e330d5e684c78f2406c815d0a284a04..ba8ba3e1dc711056aaa5d2b6d025410fa574f76e 100644 (file)
@@ -41,7 +41,8 @@ use lightning::sign::{KeyMaterial, InMemorySigner, Recipient, EntropySource, Nod
 use lightning::events;
 use lightning::events::MessageSendEventsProvider;
 use lightning::ln::{ChannelId, 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 d07def30ff987176305faa2a76367b6b073b5fa0..09e5b430d5fad0d41e9e02f8efb4a5cb20649831 100644 (file)
@@ -37,7 +37,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, InterceptId};
+use lightning::ln::channelmanager::{ChainParameters, ChannelDetails, ChannelManager, PaymentId, InterceptId};
+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 a8ffce7bbd9604d8583da0fdbaf2a2254f749b17..57b9f9b844a4d74e600042248bc92d9fa795ed72 100644 (file)
@@ -13,7 +13,7 @@ use crate::Bolt11Invoice;
 use bitcoin::hashes::Hash;
 
 use lightning::ln::types::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 22e493ae1c570705da884a22b3c42a4e1ec02c0d..1dda97fb49be246d5459080b4c7d1542d63f2ca6 100644 (file)
@@ -827,7 +827,8 @@ mod test {
        use lightning::ln::types::PaymentHash;
        #[cfg(feature = "std")]
        use lightning::ln::types::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 8fb29b394cb2f19d7032e06be6de4adf4c220337..04acfa1a2ea601ad236569016f8830129f245278 100644 (file)
@@ -103,7 +103,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 7cbb2ce5ebe1b9eb22b3ac957dbb99b88d72afbc..987275c5b2436b8f302407a7db5d757b2d38395c 100644 (file)
@@ -37,7 +37,7 @@ pub mod channel;
 pub(crate) mod channel;
 
 pub(crate) mod onion_utils;
-mod outbound_payment;
+pub mod outbound_payment;
 pub mod wire;
 
 pub use onion_utils::create_payment_onion;