Fix cfg(test) indentation
[rust-lightning] / lightning / src / ln / outbound_payment.rs
index 95ad59e634faf41bf461855255b10ec5574cdcb8..6da14388ad8ae2c7b65a7244a8e324422ede393e 100644 (file)
@@ -13,7 +13,7 @@ use bitcoin::hashes::Hash;
 use bitcoin::hashes::sha256::Hash as Sha256;
 use bitcoin::secp256k1::{self, Secp256k1, SecretKey};
 
-use crate::chain::keysinterface::{KeysInterface, Recipient};
+use crate::chain::keysinterface::{EntropySource, KeysInterface, NodeSigner, Recipient};
 use crate::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
 use crate::ln::channelmanager::{HTLCSource, IDEMPOTENCY_TIMEOUT_TICKS, PaymentId};
 use crate::ln::msgs::DecodeError;
@@ -403,7 +403,15 @@ impl OutboundPayments {
                }
        }
 
-       pub(super) fn add_new_pending_payment<K: Deref>(
+       #[cfg(test)]
+       pub(super) fn test_add_new_pending_payment<K: Deref>(
+               &self, payment_hash: PaymentHash, payment_secret: Option<PaymentSecret>, payment_id: PaymentId,
+               route: &Route, keys_manager: &K, best_block_height: u32
+       ) -> Result<Vec<[u8; 32]>, PaymentSendFailure> where K::Target: KeysInterface {
+               self.add_new_pending_payment(payment_hash, payment_secret, payment_id, route, keys_manager, best_block_height)
+       }
+
+       fn add_new_pending_payment<K: Deref>(
                &self, payment_hash: PaymentHash, payment_secret: Option<PaymentSecret>, payment_id: PaymentId,
                route: &Route, keys_manager: &K, best_block_height: u32
        ) -> Result<Vec<[u8; 32]>, PaymentSendFailure> where K::Target: KeysInterface {
@@ -712,9 +720,9 @@ impl OutboundPayments {
                log_trace!(logger, "Failing outbound payment HTLC with payment_hash {}", log_bytes!(payment_hash.0));
 
                let path_failure = {
-       #[cfg(test)]
+                       #[cfg(test)]
                        let (network_update, short_channel_id, payment_retryable, onion_error_code, onion_error_data) = onion_error.decode_onion_failure(secp_ctx, logger, &source);
-       #[cfg(not(test))]
+                       #[cfg(not(test))]
                        let (network_update, short_channel_id, payment_retryable, _, _) = onion_error.decode_onion_failure(secp_ctx, logger, &source);
 
                        if payment_is_probe(payment_hash, &payment_id, probing_cookie_secret) {