Skip to content

Commit e723094

Browse files
committed
f: fix fmt problems
1 parent d5adf86 commit e723094

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

lightning/src/ln/async_payments_tests.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ use crate::ln::msgs::{
2323
};
2424
use crate::ln::offers_tests;
2525
use crate::ln::onion_utils::LocalHTLCFailureReason;
26-
use crate::ln::outbound_payment::{PendingOutboundPayment, Retry, TEST_ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY};
26+
use crate::ln::outbound_payment::{
27+
PendingOutboundPayment, Retry, TEST_ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY,
28+
};
2729
use crate::offers::async_receive_offer_cache::{
2830
TEST_MAX_CACHED_OFFERS_TARGET, TEST_MAX_UPDATE_ATTEMPTS,
2931
TEST_MIN_OFFER_PATHS_RELATIVE_EXPIRY_SECS, TEST_OFFER_REFRESH_THRESHOLD,
@@ -696,7 +698,8 @@ fn timeout_unreleased_payment() {
696698
let recipient = &nodes[2];
697699

698700
let recipient_id = vec![42; 32];
699-
let inv_server_paths = server.node.blinded_paths_for_async_recipient(recipient_id.clone(), None).unwrap();
701+
let inv_server_paths =
702+
server.node.blinded_paths_for_async_recipient(recipient_id.clone(), None).unwrap();
700703
recipient.node.set_paths_to_static_invoice_server(inv_server_paths).unwrap();
701704

702705
let static_invoice =
@@ -711,10 +714,8 @@ fn timeout_unreleased_payment() {
711714
.pay_for_offer(&offer, None, Some(amt_msat), None, payment_id, Retry::Attempts(0), params)
712715
.unwrap();
713716

714-
let invreq_om = sender
715-
.onion_messenger
716-
.next_onion_message_for_peer(server.node.get_our_node_id())
717-
.unwrap();
717+
let invreq_om =
718+
sender.onion_messenger.next_onion_message_for_peer(server.node.get_our_node_id()).unwrap();
718719
server.onion_messenger.handle_onion_message(sender.node.get_our_node_id(), &invreq_om);
719720

720721
let mut events = server.node.get_and_clear_pending_events();
@@ -725,21 +726,17 @@ fn timeout_unreleased_payment() {
725726
};
726727

727728
server.node.send_static_invoice(static_invoice.clone(), reply_path).unwrap();
728-
let static_invoice_om = server
729-
.onion_messenger
730-
.next_onion_message_for_peer(sender.node.get_our_node_id())
731-
.unwrap();
729+
let static_invoice_om =
730+
server.onion_messenger.next_onion_message_for_peer(sender.node.get_our_node_id()).unwrap();
732731

733732
// We handle the static invoice to held the pending HTLC
734-
sender
735-
.onion_messenger
736-
.handle_onion_message(sender.node.get_our_node_id(), &static_invoice_om);
733+
sender.onion_messenger.handle_onion_message(sender.node.get_our_node_id(), &static_invoice_om);
737734

738735
// We advance enough time to expire the payment.
739736
// We add 2 hours as is the margin added to remove stale payments in non-std implementation.
740737
let timeout_time_expiry = TEST_ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY
741-
+ Duration::from_secs(7200)
742-
+ Duration::from_secs(1);
738+
+ Duration::from_secs(7200)
739+
+ Duration::from_secs(1);
743740
advance_time_by(timeout_time_expiry, sender);
744741
sender.node.timer_tick_occurred();
745742
let events = sender.node.get_and_clear_pending_events();

lightning/src/ln/outbound_payment.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ pub(crate) const IDEMPOTENCY_TIMEOUT_TICKS: u8 = 7;
6060
const ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY: Duration = Duration::from_secs(60 * 60 * 24 * 7);
6161

6262
#[cfg(all(async_payments, test))]
63-
pub(crate) const TEST_ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY: Duration = ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY;
63+
pub(crate) const TEST_ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY: Duration =
64+
ASYNC_PAYMENT_TIMEOUT_RELATIVE_EXPIRY;
6465

6566
/// Stores the session_priv for each part of a payment that is still pending. For versions 0.0.102
6667
/// and later, also stores information for retrying the payment.

0 commit comments

Comments
 (0)