Skip to content

Commit 7188d5b

Browse files
authored
Merge pull request #3643 from TheBlueMatt/2025-03-3016-followups
Trivial #3016 followups
2 parents df68774 + 0dc91d5 commit 7188d5b

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

lightning/src/ln/channelmanager.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ use crate::types::features::{Bolt12InvoiceFeatures, ChannelFeatures, ChannelType
5656
use crate::types::features::Bolt11InvoiceFeatures;
5757
#[cfg(trampoline)]
5858
use crate::routing::gossip::NodeId;
59-
use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, Payee, PaymentParameters, RouteParameters, RouteParametersConfig, Router};
60-
#[cfg(any(feature = "_test_utils", test))]
61-
use crate::routing::router::{FixedRouter, Route};
59+
use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, Payee, PaymentParameters, RouteParameters, RouteParametersConfig, Router, FixedRouter, Route};
6260
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};
6361
use crate::ln::msgs;
6462
use crate::ln::onion_utils;
@@ -4670,7 +4668,6 @@ where
46704668
///
46714669
/// LDK will not automatically retry this payment, though it may be manually re-sent after an
46724670
/// [`Event::PaymentFailed`] is generated.
4673-
#[cfg(any(test, feature = "_test_utils"))]
46744671
pub fn send_payment_with_route(
46754672
&self, mut route: Route, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields,
46764673
payment_id: PaymentId

lightning/src/ln/functional_test_utils.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ impl<'a, 'b, 'c> Node<'a, 'b, 'c> {
513513
/// Toggles this node's signer to be available for the given signer operation.
514514
/// This is useful for testing behavior for restoring an async signer that previously
515515
/// could not return a signature immediately.
516-
pub fn enable_channel_signer_op(&self, peer_id: &PublicKey, chan_id: &ChannelId, signer_op: SignerOp) {
516+
pub fn enable_channel_signer_op(&self, peer_id: &PublicKey, chan_id: &ChannelId, signer_op: SignerOp) {
517517
self.set_channel_signer_ops(peer_id, chan_id, signer_op, true);
518518
}
519519

@@ -532,7 +532,7 @@ impl<'a, 'b, 'c> Node<'a, 'b, 'c> {
532532
/// will behave normally, returning `Ok`. When set to `false`, and the channel signer will
533533
/// act like an off-line remote signer, returning `Err`. This applies to the signer in all
534534
/// relevant places, i.e. the channel manager, chain monitor, and the keys manager.
535-
fn set_channel_signer_ops(&self, peer_id: &PublicKey, chan_id: &ChannelId, signer_op: SignerOp, available: bool) {
535+
fn set_channel_signer_ops(&self, peer_id: &PublicKey, chan_id: &ChannelId, signer_op: SignerOp, available: bool) {
536536
use crate::sign::ChannelSigner;
537537
log_debug!(self.logger, "Setting channel signer for {} as available={}", chan_id, available);
538538

@@ -2549,11 +2549,12 @@ pub fn expect_payment_failed_conditions_event<'a, 'b, 'c, 'd, 'e>(
25492549
if conditions.expected_mpp_parts_remain { assert_eq!(payment_failed_events.len(), 1); } else { assert_eq!(payment_failed_events.len(), 2); }
25502550
let expected_payment_id = match &payment_failed_events[0] {
25512551
Event::PaymentPathFailed { payment_hash, payment_failed_permanently, payment_id, failure,
2552-
error_code,
2553-
error_data, .. } => {
2552+
error_code,
2553+
error_data, ..
2554+
} => {
25542555
assert_eq!(*payment_hash, expected_payment_hash, "unexpected payment_hash");
25552556
assert_eq!(*payment_failed_permanently, expected_payment_failed_permanently, "unexpected payment_failed_permanently value");
2556-
{
2557+
{
25572558
assert!(error_code.is_some(), "expected error_code.is_some() = true");
25582559
assert!(error_data.is_some(), "expected error_data.is_some() = true");
25592560
if let Some((code, data)) = conditions.expected_htlc_error_data {

lightning/src/ln/functional_tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2899,7 +2899,7 @@ pub fn claim_htlc_outputs() {
28992899
//
29002900
// This is a regression test for https://github.com/lightningdevkit/rust-lightning/issues/3537.
29012901
#[xtest(feature = "_externalize_tests")]
2902-
fn test_multiple_package_conflicts() {
2902+
pub fn test_multiple_package_conflicts() {
29032903
let chanmon_cfgs = create_chanmon_cfgs(3);
29042904
let node_cfgs = create_node_cfgs(3, &chanmon_cfgs);
29052905
let mut user_cfg = test_default_channel_config();
@@ -5047,7 +5047,7 @@ pub fn test_static_spendable_outputs_timeout_tx() {
50475047
check_spends!(spend_txn[2], node_txn[0], commitment_tx[0]); // All outputs
50485048
}
50495049

5050-
pub fn do_test_static_spendable_outputs_justice_tx_revoked_commitment_tx(split_tx: bool) {
5050+
fn do_test_static_spendable_outputs_justice_tx_revoked_commitment_tx(split_tx: bool) {
50515051
let chanmon_cfgs = create_chanmon_cfgs(2);
50525052
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
50535053
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
@@ -10603,7 +10603,7 @@ pub fn test_max_dust_htlc_exposure() {
1060310603
}
1060410604

1060510605
#[xtest(feature = "_externalize_tests")]
10606-
fn test_nondust_htlc_excess_fees_are_dust() {
10606+
pub fn test_nondust_htlc_excess_fees_are_dust() {
1060710607
// Test that the excess transaction fees paid in nondust HTLCs count towards our dust limit
1060810608
const DEFAULT_FEERATE: u32 = 253;
1060910609
const HIGH_FEERATE: u32 = 275;
@@ -11943,7 +11943,7 @@ pub fn test_manual_funding_abandon() {
1194311943
}
1194411944

1194511945
#[xtest(feature = "_externalize_tests")]
11946-
fn test_funding_signed_event() {
11946+
pub fn test_funding_signed_event() {
1194711947
let mut cfg = UserConfig::default();
1194811948
cfg.channel_handshake_config.minimum_depth = 1;
1194911949
let chanmon_cfgs = create_chanmon_cfgs(2);

lightning/src/routing/router.rs

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use crate::offers::invoice::Bolt12Invoice;
2525
use crate::routing::gossip::{DirectedChannelInfo, EffectiveCapacity, ReadOnlyNetworkGraph, NetworkGraph, NodeId};
2626
use crate::routing::scoring::{ChannelUsage, LockableScore, ScoreLookUp};
2727
use crate::sign::EntropySource;
28-
#[cfg(any(test, feature = "_test_utils"))]
2928
use crate::sync::Mutex;
3029
use crate::util::ser::{Writeable, Readable, ReadableArgs, Writer};
3130
use crate::util::logger::Logger;
@@ -190,20 +189,17 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, ES: Deref, S: Deref, SP: Size
190189
/// A `Router` that returns a fixed route one time, erroring otherwise. Useful for
191190
/// `ChannelManager::send_payment_with_route` to support sending to specific routes without
192191
/// requiring a custom `Router` implementation.
193-
#[cfg(any(test, feature = "_test_utils"))]
194192
pub(crate) struct FixedRouter {
195193
// Use an `Option` to avoid needing to clone the route when `find_route` is called.
196194
route: Mutex<Option<Route>>,
197195
}
198196

199-
#[cfg(any(test, feature = "_test_utils"))]
200197
impl FixedRouter {
201198
pub(crate) fn new(route: Route) -> Self {
202199
Self { route: Mutex::new(Some(route)) }
203200
}
204201
}
205202

206-
#[cfg(any(test, feature = "_test_utils"))]
207203
impl Router for FixedRouter {
208204
fn find_route(
209205
&self, _payer: &PublicKey, _route_params: &RouteParameters,

0 commit comments

Comments
 (0)