From: Matt Corallo Date: Thu, 31 Aug 2023 18:47:13 +0000 (+0000) Subject: Fix various unused warnings in test and regular builds X-Git-Tag: v0.0.117-alpha1~16^2~6 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=4835b1697c38110050004fb493517e26eaaf4685;p=rust-lightning Fix various unused warnings in test and regular builds --- diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index 0a685f534..3456a238e 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -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}; diff --git a/lightning/src/ln/shutdown_tests.rs b/lightning/src/ln/shutdown_tests.rs index 846bcaf90..1310d25d4 100644 --- a/lightning/src/ln/shutdown_tests.rs +++ b/lightning/src/ln/shutdown_tests.rs @@ -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()); diff --git a/lightning/src/util/test_utils.rs b/lightning/src/util/test_utils.rs index 8e2be87d8..09c99815b 100644 --- a/lightning/src/util/test_utils.rs +++ b/lightning/src/util/test_utils.rs @@ -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 { self.watchtower_state.lock().unwrap().get(&funding_txo).unwrap().get(commitment_txid).cloned()