From da7c7eb9f0fa19723ae3976f8cb5fed0fde0eea8 Mon Sep 17 00:00:00 2001 From: Fmt Bot Date: Sun, 12 Jul 2026 02:09:15 +0000 Subject: [PATCH] 2026-07-12 automated rustfmt nightly --- src/builder.rs | 7 +++---- src/payment/store.rs | 3 ++- src/probing.rs | 42 ++++++++++++++++++++++-------------------- tests/probing_tests.rs | 7 ++----- 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index 639838ff3a..a70b04b2ab 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -644,14 +644,13 @@ impl NodeBuilder { /// # #[cfg(not(feature = "uniffi"))] /// # { /// use std::time::Duration; - /// use ldk_node::Builder; + /// /// use ldk_node::probing::ProbingConfigBuilder; + /// use ldk_node::Builder; /// /// let mut builder = Builder::new(); /// builder.set_probing_config( - /// ProbingConfigBuilder::high_degree(100) - /// .interval(Duration::from_secs(30)) - /// .build() + /// ProbingConfigBuilder::high_degree(100).interval(Duration::from_secs(30)).build(), /// ); /// # } /// ``` diff --git a/src/payment/store.rs b/src/payment/store.rs index 38583dd7e7..d2b92747a2 100644 --- a/src/payment/store.rs +++ b/src/payment/store.rs @@ -926,9 +926,10 @@ mod tests { #[test] fn known_onchain_tx_type_survives_unknown_update() { - use bitcoin::hashes::Hash; use std::str::FromStr; + use bitcoin::hashes::Hash; + let txid = Txid::from_byte_array([8u8; 32]); let payment_id = PaymentId(txid.to_byte_array()); let pubkey = PublicKey::from_str( diff --git a/src/probing.rs b/src/probing.rs index 840a73a2e8..ecb8bf6891 100644 --- a/src/probing.rs +++ b/src/probing.rs @@ -34,14 +34,15 @@ //! # #[cfg(not(feature = "uniffi"))] //! # { //! use std::time::Duration; -//! use ldk_node::Builder; +//! //! use ldk_node::probing::ProbingConfigBuilder; +//! use ldk_node::Builder; //! //! let probing_config = ProbingConfigBuilder::high_degree(100) -//! .interval(Duration::from_secs(30)) -//! .max_locked_msat(500_000) -//! .diversity_penalty_msat(250) -//! .build(); +//! .interval(Duration::from_secs(30)) +//! .max_locked_msat(500_000) +//! .diversity_penalty_msat(250) +//! .build(); //! //! let mut builder = Builder::new(); //! builder.set_probing_config(probing_config); @@ -70,9 +71,9 @@ use std::time::{Duration, Instant}; use bitcoin::secp256k1::PublicKey; use lightning::ln::channelmanager::{PaymentId, RecentPaymentDetails}; use lightning::routing::gossip::NodeId; -use lightning::routing::router::Router as LdkRouter; use lightning::routing::router::{ - Path, PaymentParameters, RouteHop, RouteParameters, MAX_PATH_LENGTH_ESTIMATE, + Path, PaymentParameters, RouteHop, RouteParameters, Router as LdkRouter, + MAX_PATH_LENGTH_ESTIMATE, }; use lightning_invoice::DEFAULT_MIN_FINAL_CLTV_EXPIRY_DELTA; use lightning_types::features::{ChannelFeatures, NodeFeatures}; @@ -123,14 +124,15 @@ impl fmt::Debug for ProbingStrategyKind { /// # #[cfg(not(feature = "uniffi"))] /// # { /// use std::time::Duration; -/// use ldk_node::Builder; +/// /// use ldk_node::probing::ProbingConfigBuilder; +/// use ldk_node::Builder; /// /// let config = ProbingConfigBuilder::high_degree(100) -/// .interval(Duration::from_secs(30)) -/// .max_locked_msat(500_000) -/// .diversity_penalty_msat(250) -/// .build(); +/// .interval(Duration::from_secs(30)) +/// .max_locked_msat(500_000) +/// .diversity_penalty_msat(250) +/// .build(); /// /// let mut builder = Builder::new(); /// builder.set_probing_config(config); @@ -143,16 +145,16 @@ impl fmt::Debug for ProbingStrategyKind { /// use ldk_node::probing::ProbingStrategy; /// /// struct FixedPathStrategy { -/// path: Path, +/// path: Path, /// } /// impl ProbingStrategy for FixedPathStrategy { -/// fn next_probe(&self) -> Option { -/// if self.path.hops.len() > 1 { -/// Some(self.path.clone()) -/// } else { -/// None -/// } -/// } +/// fn next_probe(&self) -> Option { +/// if self.path.hops.len() > 1 { +/// Some(self.path.clone()) +/// } else { +/// None +/// } +/// } /// } /// ``` #[derive(Clone, Debug)] diff --git a/tests/probing_tests.rs b/tests/probing_tests.rs index a26127d735..c5ed0226b5 100644 --- a/tests/probing_tests.rs +++ b/tests/probing_tests.rs @@ -21,22 +21,19 @@ mod common; use std::sync::atomic::{AtomicBool, Ordering}; +use std::sync::{Arc, Mutex}; +use std::time::Duration; use common::{ expect_channel_ready_event, expect_event, generate_blocks_and_wait, open_channel, premine_and_distribute_funds, random_chain_source, random_config, setup_bitcoind_and_electrsd, setup_node, wait_for_channel_ready_to_send, TestNode, TestStoreType, }; - use ldk_node::bitcoin::Amount; use ldk_node::probing::{ProbingConfigBuilder, ProbingStrategy}; use ldk_node::Event; - use lightning::routing::router::Path; -use std::sync::{Arc, Mutex}; -use std::time::Duration; - const PROBE_AMOUNT_MSAT: u64 = 1_000_000; const PROBING_INTERVAL_MILLISECONDS: u64 = 100;