]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Export `outbound_payment` structs in their respective modules
authorMatt Corallo <git@bluematt.me>
Thu, 22 Aug 2024 21:09:33 +0000 (21:09 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 3 Sep 2024 14:00:23 +0000 (14:00 +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/src/ln/bolt11_payment.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/invoice_utils.rs
lightning/src/ln/mod.rs

index 8929a579c74096d44cc52100dfb9e53416247f0c..98935c49bee2dea4fa2a18b1b9ebfe65cdda77a7 100644 (file)
@@ -47,9 +47,9 @@ use lightning::events::MessageSendEventsProvider;
 use lightning::ln::channel::FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE;
 use lightning::ln::channel_state::ChannelDetails;
 use lightning::ln::channelmanager::{
-       ChainParameters, ChannelManager, ChannelManagerReadArgs, PaymentId, PaymentSendFailure,
-       RecipientOnionFields,
+       ChainParameters, ChannelManager, ChannelManagerReadArgs, PaymentId,
 };
+use lightning::ln::outbound_payment::{RecipientOnionFields, PaymentSendFailure};
 use lightning::ln::functional_test_utils::*;
 use lightning::ln::msgs::{
        self, ChannelMessageHandler, CommitmentUpdate, DecodeError, Init, UpdateAddHTLC,
index 90449248e32eb69c636ecdb9946712a4869ddc93..bb193cac2646412e40d6fd0cad70623ac3fd738b 100644 (file)
@@ -40,8 +40,9 @@ use lightning::chain::{BestBlock, ChannelMonitorUpdateStatus, Confirm, Listen};
 use lightning::events::Event;
 use lightning::ln::channel_state::ChannelDetails;
 use lightning::ln::channelmanager::{
-       ChainParameters, ChannelManager, InterceptId, PaymentId, RecipientOnionFields, Retry,
+       ChainParameters, ChannelManager, InterceptId, PaymentId,
 };
+use lightning::ln::outbound_payment::{RecipientOnionFields, Retry};
 use lightning::ln::functional_test_utils::*;
 use lightning::ln::msgs::{self, DecodeError};
 use lightning::ln::peer_handler::{
index d0655968a60dce0e8385ab271dac1e4ea6c1178d..30d03f9f2bf216828e952e3b1d2eb930c9c74e11 100644 (file)
@@ -12,7 +12,7 @@
 use bitcoin::hashes::Hash;
 use lightning_invoice::Bolt11Invoice;
 
-use crate::ln::channelmanager::RecipientOnionFields;
+use crate::ln::outbound_payment::RecipientOnionFields;
 use crate::ln::types::PaymentHash;
 use crate::routing::router::{PaymentParameters, RouteParameters};
 
@@ -161,7 +161,8 @@ mod tests {
        #[test]
        fn payment_metadata_end_to_end() {
                use crate::events::Event;
-               use crate::ln::channelmanager::{PaymentId, Retry};
+               use crate::ln::channelmanager::PaymentId;
+               use crate::ln::outbound_payment::Retry;
                use crate::ln::functional_test_utils::*;
                use crate::ln::msgs::ChannelMessageHandler;
 
index b3047930f6146d5549d9535ec5fe9eb08e290522..09fc1e46007e8a3aa4a91d747f7faf1e5f18c385 100644 (file)
@@ -111,7 +111,7 @@ use core::time::Duration;
 use core::ops::Deref;
 
 // Re-export this for use in the public API.
-pub use crate::ln::outbound_payment::{Bolt12PaymentError, PaymentSendFailure, ProbeSendFailure, Retry, RetryableSendFailure, RecipientOnionFields};
+pub(crate) use crate::ln::outbound_payment::{Bolt12PaymentError, 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 71686df59cebd62390d2c15adc16a1f09d87c4cd..79c6c96ca5002b5472949dc95c8dbcc62c1d6ae3 100644 (file)
@@ -825,7 +825,8 @@ mod test {
        use crate::events::{MessageSendEvent, MessageSendEventsProvider};
        use crate::ln::types::PaymentHash;
        use crate::ln::types::PaymentPreimage;
-       use crate::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId, RecipientOnionFields, Retry};
+       use crate::ln::channelmanager::{PhantomRouteHints, MIN_FINAL_CLTV_EXPIRY_DELTA, PaymentId};
+       use crate::ln::outbound_payment::{RecipientOnionFields, Retry};
        use crate::ln::functional_test_utils::*;
        use crate::ln::msgs::ChannelMessageHandler;
        use crate::routing::router::{PaymentParameters, RouteParameters};
index dceb52ab4ae865777ea1dddd674a9fd84e93b945..1a229159edd4ffeb287982d91123e8e91d3e623b 100644 (file)
@@ -49,7 +49,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;