From: Valentine Wallace Date: Mon, 19 Dec 2022 20:30:16 +0000 (-0500) Subject: Start parameters on a newline if they don't fit X-Git-Tag: v0.0.114-beta~81^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=ec55730959103b71417d23d3a77011ca7d7d4ee5;p=rust-lightning Start parameters on a newline if they don't fit Separating out this commit to keep the main refactor move-only --- diff --git a/lightning/src/ln/outbound_payment.rs b/lightning/src/ln/outbound_payment.rs index eacf46892..2f520fa71 100644 --- a/lightning/src/ln/outbound_payment.rs +++ b/lightning/src/ln/outbound_payment.rs @@ -271,10 +271,10 @@ impl OutboundPayments { } } - pub(super) fn send_payment(&self, route: &Route, payment_hash: PaymentHash, - payment_secret: &Option, payment_id: PaymentId, keys_manager: &K, - best_block_height: u32, send_payment_along_path: F) - -> Result<(), PaymentSendFailure> + pub(super) fn send_payment( + &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option, + payment_id: PaymentId, keys_manager: &K, best_block_height: u32, send_payment_along_path: F + ) -> Result<(), PaymentSendFailure> where K::Target: KeysInterface, F: Fn(&Vec, &Option, &PaymentHash, &Option, u64, @@ -284,10 +284,10 @@ impl OutboundPayments { self.send_payment_internal(route, payment_hash, payment_secret, None, payment_id, None, onion_session_privs, keys_manager, best_block_height, send_payment_along_path) } - pub(super) fn send_spontaneous_payment(&self, route: &Route, - payment_preimage: Option, payment_id: PaymentId, keys_manager: &K, - best_block_height: u32, send_payment_along_path: F) - -> Result + pub(super) fn send_spontaneous_payment( + &self, route: &Route, payment_preimage: Option, payment_id: PaymentId, + keys_manager: &K, best_block_height: u32, send_payment_along_path: F + ) -> Result where K::Target: KeysInterface, F: Fn(&Vec, &Option, &PaymentHash, &Option, u64, @@ -306,9 +306,10 @@ impl OutboundPayments { } } - pub(super) fn retry_payment(&self, route: &Route, payment_id: PaymentId, - keys_manager: &K, best_block_height: u32, send_payment_along_path: F) - -> Result<(), PaymentSendFailure> + pub(super) fn retry_payment( + &self, route: &Route, payment_id: PaymentId, keys_manager: &K, best_block_height: u32, + send_payment_along_path: F + ) -> Result<(), PaymentSendFailure> where K::Target: KeysInterface, F: Fn(&Vec, &Option, &PaymentHash, &Option, u64, @@ -374,9 +375,10 @@ impl OutboundPayments { self.send_payment_internal(route, payment_hash, &payment_secret, None, payment_id, Some(total_msat), onion_session_privs, keys_manager, best_block_height, send_payment_along_path) } - pub(super) fn send_probe(&self, hops: Vec, probing_cookie_secret: [u8; 32], - keys_manager: &K, best_block_height: u32, send_payment_along_path: F) - -> Result<(PaymentHash, PaymentId), PaymentSendFailure> + pub(super) fn send_probe( + &self, hops: Vec, probing_cookie_secret: [u8; 32], keys_manager: &K, + best_block_height: u32, send_payment_along_path: F + ) -> Result<(PaymentHash, PaymentId), PaymentSendFailure> where K::Target: KeysInterface, F: Fn(&Vec, &Option, &PaymentHash, &Option, u64, @@ -401,10 +403,10 @@ impl OutboundPayments { } } - pub(super) fn add_new_pending_payment(&self, payment_hash: PaymentHash, - payment_secret: Option, payment_id: PaymentId, route: &Route, keys_manager: &K, - best_block_height: u32) - -> Result, PaymentSendFailure> where K::Target: KeysInterface { + pub(super) fn add_new_pending_payment( + &self, payment_hash: PaymentHash, payment_secret: Option, payment_id: PaymentId, + route: &Route, keys_manager: &K, best_block_height: u32 + ) -> Result, PaymentSendFailure> where K::Target: KeysInterface { let mut onion_session_privs = Vec::with_capacity(route.paths.len()); for _ in 0..route.paths.len() { onion_session_privs.push(keys_manager.get_secure_random_bytes()); @@ -433,8 +435,8 @@ impl OutboundPayments { } } - fn send_payment_internal - (&self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option, + fn send_payment_internal( + &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option, keysend_preimage: Option, payment_id: PaymentId, recv_value_msat: Option, onion_session_privs: Vec<[u8; 32]>, keys_manager: &K, best_block_height: u32, send_payment_along_path: F) -> Result<(), PaymentSendFailure> @@ -542,11 +544,11 @@ impl OutboundPayments { } #[cfg(test)] - pub(super) fn test_send_payment_internal - (&self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option, - keysend_preimage: Option, payment_id: PaymentId, recv_value_msat: Option, - onion_session_privs: Vec<[u8; 32]>, keys_manager: &K, best_block_height: u32, - send_payment_along_path: F) -> Result<(), PaymentSendFailure> + pub(super) fn test_send_payment_internal( + &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option, + keysend_preimage: Option, payment_id: PaymentId, recv_value_msat: Option, + onion_session_privs: Vec<[u8; 32]>, keys_manager: &K, best_block_height: u32, + send_payment_along_path: F) -> Result<(), PaymentSendFailure> where K::Target: KeysInterface, F: Fn(&Vec, &Option, &PaymentHash, &Option, u64, @@ -557,9 +559,9 @@ impl OutboundPayments { send_payment_along_path) } - pub(super) fn claim_htlc(&self, payment_id: PaymentId, - payment_preimage: PaymentPreimage, session_priv: SecretKey, path: Vec, - from_onchain: bool, pending_events: &Mutex>, logger: &L) + pub(super) fn claim_htlc( + &self, payment_id: PaymentId, payment_preimage: PaymentPreimage, session_priv: SecretKey, + path: Vec, from_onchain: bool, pending_events: &Mutex>, logger: &L) where L::Target: Logger { let mut session_priv_bytes = [0; 32]; session_priv_bytes.copy_from_slice(&session_priv[..]); @@ -665,11 +667,11 @@ impl OutboundPayments { }); } - pub(super) fn fail_htlc(&self, source: &HTLCSource, payment_hash: &PaymentHash, - onion_error: &HTLCFailReason, path: &Vec, session_priv: &SecretKey, - payment_id: &PaymentId, payment_params: &Option, - probing_cookie_secret: [u8; 32], secp_ctx: &Secp256k1, - pending_events: &Mutex>, logger: &L) + pub(super) fn fail_htlc( + &self, source: &HTLCSource, payment_hash: &PaymentHash, onion_error: &HTLCFailReason, + path: &Vec, session_priv: &SecretKey, payment_id: &PaymentId, + payment_params: &Option, probing_cookie_secret: [u8; 32], + secp_ctx: &Secp256k1, pending_events: &Mutex>, logger: &L) where L::Target: Logger { let mut session_priv_bytes = [0; 32]; session_priv_bytes.copy_from_slice(&session_priv[..]);