From 82828d34bd00f77b8db8ad9a30f229dc0d58e266 Mon Sep 17 00:00:00 2001 From: Devrandom Date: Sat, 28 Dec 2024 10:01:58 +0100 Subject: [PATCH] f rebase 2 --- lightning/src/ln/channelmanager.rs | 10 +++++----- lightning/src/ln/outbound_payment.rs | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index cc8d5a78614..ab860a8173c 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -56,7 +56,7 @@ use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelType #[cfg(any(feature = "_test_utils", test))] use crate::types::features::Bolt11InvoiceFeatures; use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, Payee, PaymentParameters, RouteParameters, Router}; -#[cfg(test)] +#[cfg(any(test, feature = "_test_utils"))] use crate::routing::router::Route; use crate::ln::onion_payment::{check_incoming_htlc_cltv, create_recv_pending_htlc_info, create_fwd_pending_htlc_info, decode_incoming_update_add_htlc_onion, InboundHTLCErr, NextPacketDetails}; use crate::ln::msgs; @@ -128,8 +128,8 @@ use core::ops::Deref; use bitcoin::hex::impl_fmt_traits; // Re-export this for use in the public API. pub use crate::ln::outbound_payment::{Bolt12PaymentError, ProbeSendFailure, Retry, RetryableSendFailure, RecipientOnionFields}; -#[cfg(test)] -pub(crate) use crate::ln::outbound_payment::PaymentSendFailure; +#[cfg(any(test, feature = "_test_utils"))] +pub use crate::ln::outbound_payment::PaymentSendFailure; use crate::ln::script::ShutdownScript; // We hold various information about HTLC relay in the HTLC objects in Channel itself: @@ -4627,8 +4627,8 @@ where // [`TestRouter::expect_find_route`] instead. // // [`TestRouter::expect_find_route`]: crate::util::test_utils::TestRouter::expect_find_route - #[cfg(test)] - pub(crate) fn send_payment_with_route( + #[cfg(any(test, feature = "_test_utils"))] + pub fn send_payment_with_route( &self, route: Route, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, payment_id: PaymentId ) -> Result<(), PaymentSendFailure> { diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs index 51143d92ab4..c24e987619c 100644 --- a/lightning/src/ln/outbound_payment.rs +++ b/lightning/src/ln/outbound_payment.rs @@ -482,7 +482,8 @@ pub enum RetryableSendFailure { /// as the Err() type describing which state the payment is in, see the description of individual /// enum states for more. #[derive(Clone, Debug, PartialEq, Eq)] -pub(crate) enum PaymentSendFailure { +// FIXME +pub enum PaymentSendFailure { /// A parameter which was passed to send_payment was invalid, preventing us from attempting to /// send the payment at all. /// @@ -790,7 +791,7 @@ impl OutboundPayments { best_block_height, logger, pending_events, &send_payment_along_path) } - #[cfg(test)] + #[cfg(any(test, feature = "_test_utils"))] pub(super) fn send_payment_with_route( &self, route: &Route, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, payment_id: PaymentId, entropy_source: &ES, node_signer: &NS, best_block_height: u32,