Fix various unused warnings in test and regular builds
authorMatt Corallo <git@bluematt.me>
Thu, 31 Aug 2023 18:47:13 +0000 (18:47 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 12 Sep 2023 16:03:36 +0000 (16:03 +0000)
lightning/src/ln/functional_tests.rs
lightning/src/ln/shutdown_tests.rs
lightning/src/util/test_utils.rs

index 0a685f534b6456b811505e059574ecafb8db9071..3456a238ec74eee8fa26653a45acb27a1785d6ae 100644 (file)
@@ -17,7 +17,7 @@ use crate::chain::chaininterface::LowerBoundedFeeEstimator;
 use crate::chain::channelmonitor;
 use crate::chain::channelmonitor::{CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS, ANTI_REORG_DELAY};
 use crate::chain::transaction::OutPoint;
-use crate::sign::{ChannelSigner, EcdsaChannelSigner, EntropySource, SignerProvider};
+use crate::sign::{EcdsaChannelSigner, EntropySource, SignerProvider};
 use crate::events::{Event, MessageSendEvent, MessageSendEventsProvider, PathFailure, PaymentPurpose, ClosureReason, HTLCDestination, PaymentFailureReason};
 use crate::ln::{ChannelId, PaymentPreimage, PaymentSecret, PaymentHash};
 use crate::ln::channel::{commitment_tx_base_weight, COMMITMENT_TX_WEIGHT_PER_HTLC, CONCURRENT_INBOUND_HTLC_FEE_BUFFER, FEE_SPIKE_BUFFER_FEE_INCREASE_MULTIPLE, MIN_AFFORDABLE_HTLC_COUNT, get_holder_selected_channel_reserve_satoshis, OutboundV1Channel, InboundV1Channel, COINBASE_MATURITY, ChannelPhase};
index 846bcaf9038567e0c31a57e99a882edf55962975..1310d25d476a631cdd87d8268d59ac572005649f 100644 (file)
@@ -209,7 +209,7 @@ fn test_lnd_bug_6039() {
        let mut nodes = create_network(2, &node_cfgs, &node_chanmgrs);
        let chan = create_announced_chan_between_nodes(&nodes, 0, 1);
 
-       let (payment_preimage, payment_hash, ..) = route_payment(&nodes[0], &[&nodes[1]], 100_000);
+       let (payment_preimage, ..) = route_payment(&nodes[0], &[&nodes[1]], 100_000);
 
        nodes[0].node.close_channel(&chan.2, &nodes[1].node.get_our_node_id()).unwrap();
        let node_0_shutdown = get_event_msg!(nodes[0], MessageSendEvent::SendShutdown, nodes[1].node.get_our_node_id());
index 8e2be87d8bef820b4bf56b19829aa09450a9f1d6..09c99815bb70077ad19355eb7683a50a9f31526e 100644 (file)
@@ -62,7 +62,6 @@ use regex;
 use crate::io;
 use crate::prelude::*;
 use core::cell::RefCell;
-use core::ops::Deref;
 use core::time::Duration;
 use crate::sync::{Mutex, Arc};
 use core::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
@@ -297,6 +296,7 @@ pub(crate) struct WatchtowerPersister {
 }
 
 impl WatchtowerPersister {
+       #[cfg(test)]
        pub(crate) fn new(destination_script: Script) -> Self {
                WatchtowerPersister {
                        persister: TestPersister::new(),
@@ -306,6 +306,7 @@ impl WatchtowerPersister {
                }
        }
 
+       #[cfg(test)]
        pub(crate) fn justice_tx(&self, funding_txo: OutPoint, commitment_txid: &Txid)
        -> Option<Transaction> {
                self.watchtower_state.lock().unwrap().get(&funding_txo).unwrap().get(commitment_txid).cloned()