Skip to content

Commit c475db5

Browse files
authored
Merge pull request #4000 from TheBlueMatt/2025-08-3997-followups
Trivial 3997 followups
2 parents 192618b + 7fba8fc commit c475db5

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

ci/check-lint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ set -x
55
CLIPPY() {
66
# shellcheck disable=SC2086
77
RUSTFLAGS='-D warnings' cargo clippy $1 -- $2 \
8+
`# https://github.com/rust-lang/rust-clippy/issues/15442` \
9+
-A unused_imports \
810
`# Things clippy defaults to allowing but we should avoid` \
911
-D clippy::clone_on_ref_ptr \
1012
`# Things where clippy is just wrong` \

lightning-block-sync/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ use bitcoin::hash_types::BlockHash;
4949
use bitcoin::pow::Work;
5050

5151
use lightning::chain;
52-
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
53-
use lightning::chain::Listen as _;
52+
use lightning::chain::Listen;
5453

5554
use std::future::Future;
5655
use std::ops::Deref;

lightning/src/chain/chainmonitor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ use crate::chain::channelmonitor::{
3333
WithChannelMonitor,
3434
};
3535
use crate::chain::transaction::{OutPoint, TransactionData};
36-
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
37-
use crate::chain::Filter as _;
38-
use crate::chain::{ChannelMonitorUpdateStatus, WatchedOutput};
36+
use crate::chain::{ChannelMonitorUpdateStatus, Filter, WatchedOutput};
3937
use crate::events::{self, Event, EventHandler, ReplayEvent};
4038
use crate::ln::channel_state::ChannelDetails;
4139
use crate::ln::msgs::{self, BaseMessageHandler, Init, MessageSendEvent, SendOnlyMessageHandler};

lightning/src/chain/channelmonitor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ use crate::chain::package::{
4242
HolderHTLCOutput, PackageSolvingData, PackageTemplate, RevokedHTLCOutput, RevokedOutput,
4343
};
4444
use crate::chain::transaction::{OutPoint, TransactionData};
45-
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
46-
use crate::chain::Filter as _;
45+
use crate::chain::Filter;
4746
use crate::chain::{BestBlock, WatchedOutput};
4847
use crate::events::bump_transaction::{AnchorDescriptor, BumpTransactionEvent};
4948
use crate::events::{ClosureReason, Event, EventHandler, ReplayEvent};

lightning/src/ln/channel.rs

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14136,6 +14136,7 @@ mod tests {
1413614136
use crate::ln::script::ShutdownScript;
1413714137
use crate::prelude::*;
1413814138
use crate::routing::router::{Path, RouteHop};
14139+
#[cfg(ldk_test_vectors)]
1413914140
use crate::sign::{ChannelSigner, EntropySource, InMemorySigner, SignerProvider};
1414014141
#[cfg(splicing)]
1414114142
use crate::sync::Mutex;
@@ -14156,8 +14157,7 @@ mod tests {
1415614157
use bitcoin::hex::FromHex;
1415714158
use bitcoin::locktime::absolute::LockTime;
1415814159
use bitcoin::network::Network;
14159-
use bitcoin::opcodes;
14160-
use bitcoin::script::{Builder, ScriptBuf};
14160+
use bitcoin::script::Builder;
1416114161
use bitcoin::secp256k1::ffi::Signature as FFISignature;
1416214162
use bitcoin::secp256k1::{ecdsa::Signature, Secp256k1};
1416314163
use bitcoin::secp256k1::{PublicKey, SecretKey};
@@ -14166,7 +14166,7 @@ mod tests {
1416614166
use bitcoin::transaction::{Transaction, TxOut, Version};
1416714167
#[cfg(splicing)]
1416814168
use bitcoin::Weight;
14169-
use bitcoin::{WPubkeyHash, WitnessProgram, WitnessVersion};
14169+
use bitcoin::{WitnessProgram, WitnessVersion};
1417014170
use std::cmp;
1417114171

1417214172
#[test]
@@ -14192,17 +14192,19 @@ mod tests {
1419214192
);
1419314193
}
1419414194

14195-
#[allow(dead_code)]
14195+
#[cfg(ldk_test_vectors)]
1419614196
struct Keys {
14197-
signer: InMemorySigner,
14197+
signer: crate::sign::InMemorySigner,
1419814198
}
1419914199

14200+
#[cfg(ldk_test_vectors)]
1420014201
impl EntropySource for Keys {
1420114202
fn get_secure_random_bytes(&self) -> [u8; 32] {
1420214203
[0; 32]
1420314204
}
1420414205
}
1420514206

14207+
#[cfg(ldk_test_vectors)]
1420614208
impl SignerProvider for Keys {
1420714209
type EcdsaSigner = InMemorySigner;
1420814210
#[cfg(taproot)]
@@ -14216,16 +14218,18 @@ mod tests {
1421614218
self.signer.clone()
1421714219
}
1421814220

14219-
fn get_destination_script(&self, _channel_keys_id: [u8; 32]) -> Result<ScriptBuf, ()> {
14221+
fn get_destination_script(
14222+
&self, _channel_keys_id: [u8; 32],
14223+
) -> Result<bitcoin::script::ScriptBuf, ()> {
1422014224
let secp_ctx = Secp256k1::signing_only();
1422114225
let hex = "0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
1422214226
let channel_monitor_claim_key =
1422314227
SecretKey::from_slice(&<Vec<u8>>::from_hex(hex).unwrap()[..]).unwrap();
14224-
let channel_monitor_claim_key_hash = WPubkeyHash::hash(
14228+
let channel_monitor_claim_key_hash = bitcoin::WPubkeyHash::hash(
1422514229
&PublicKey::from_secret_key(&secp_ctx, &channel_monitor_claim_key).serialize(),
1422614230
);
1422714231
Ok(Builder::new()
14228-
.push_opcode(opcodes::all::OP_PUSHBYTES_0)
14232+
.push_opcode(bitcoin::opcodes::all::OP_PUSHBYTES_0)
1422914233
.push_slice(channel_monitor_claim_key_hash)
1423014234
.into_script())
1423114235
}
@@ -15906,7 +15910,7 @@ mod tests {
1590615910
fn funding_input_sats(input_value_sats: u64) -> (TxIn, Transaction, Weight) {
1590715911
use crate::sign::P2WPKH_WITNESS_WEIGHT;
1590815912

15909-
let input_1_prev_out = TxOut { value: Amount::from_sat(input_value_sats), script_pubkey: ScriptBuf::default() };
15913+
let input_1_prev_out = TxOut { value: Amount::from_sat(input_value_sats), script_pubkey: bitcoin::ScriptBuf::default() };
1591015914
let input_1_prev_tx = Transaction {
1591115915
input: vec![], output: vec![input_1_prev_out],
1591215916
version: Version::TWO, lock_time: bitcoin::absolute::LockTime::ZERO,

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ use crate::chain::channelmonitor::{
5050
LATENCY_GRACE_PERIOD_BLOCKS, MAX_BLOCKS_FOR_CONF,
5151
};
5252
use crate::chain::transaction::{OutPoint, TransactionData};
53-
#[allow(unused_imports)] // This thinks trait imports are unused if they're use in macros :(
54-
use crate::chain::Watch as _;
55-
use crate::chain::{BestBlock, ChannelMonitorUpdateStatus, Confirm};
53+
use crate::chain::{BestBlock, ChannelMonitorUpdateStatus, Confirm, Watch};
5654
use crate::events::{
5755
self, ClosureReason, Event, EventHandler, EventsProvider, HTLCHandlingFailureType,
5856
InboundChannelFunds, PaymentFailureReason, ReplayEvent,

0 commit comments

Comments
 (0)