Skip to content

Commit 1f16da6

Browse files
committed
lint code + remove useless patches
1 parent 545591c commit 1f16da6

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

lightning/Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,3 @@ criterion = { version = "0.4", optional = true, default-features = false }
8181

8282
[target.'cfg(taproot)'.dependencies]
8383
musig2 = { git = "https://github.com/arik-so/rust-musig2", rev = "27797d7" }
84-
85-
[patch.crates-io]
86-
commit_verify = { path = "../../client_side_validation/commit_verify" }
87-
rgb-std = { path = "../../rgb-wallet/std" }
88-
rgb-wallet = { path = "../../rgb-wallet" }

lightning/src/ln/chan_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,7 @@ impl<'a> TrustedCommitmentTransaction<'a> {
17331733
assert!(this_htlc.transaction_output_index.is_some());
17341734
let mut htlc_tx = build_htlc_transaction(&txid, inner.feerate_per_kw, channel_parameters.contest_delay(), &this_htlc, &self.channel_type_features, &keys.broadcaster_delayed_payment_key, &keys.revocation_key);
17351735
if inner.is_colored() {
1736-
if let Err(_e) = color_htlc(&mut htlc_tx, &this_htlc, &ldk_data_dir) {
1736+
if let Err(_e) = color_htlc(&mut htlc_tx, this_htlc, ldk_data_dir) {
17371737
return Err(());
17381738
}
17391739
}
@@ -1764,7 +1764,7 @@ impl<'a> TrustedCommitmentTransaction<'a> {
17641764
&self.channel_type_features, &keys.broadcaster_delayed_payment_key, &keys.revocation_key
17651765
);
17661766
if self.inner.is_colored() {
1767-
color_htlc(&mut htlc_tx, &this_htlc, &ldk_data_dir).expect("successful htlc tx coloring");
1767+
color_htlc(&mut htlc_tx, this_htlc, ldk_data_dir).expect("successful htlc tx coloring");
17681768
}
17691769
htlc_tx
17701770
}

lightning/src/rgb_utils/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub fn write_rgb_transfer_info(path: &PathBuf, info: &TransferInfo) {
132132
fs::write(path, serialized_info).expect("able to write transfer info file")
133133
}
134134

135-
fn counterparty_output_index(outputs: &Vec<TxOut>, channel_type_features: &ChannelTypeFeatures, payment_key: &PublicKey) -> Option<usize> {
135+
fn counterparty_output_index(outputs: &[TxOut], channel_type_features: &ChannelTypeFeatures, payment_key: &PublicKey) -> Option<usize> {
136136
let counterparty_payment_script = get_counterparty_payment_script(channel_type_features, payment_key);
137137
outputs.iter().enumerate()
138138
.find(|(_, out)| out.script_pubkey == counterparty_payment_script)
@@ -530,7 +530,7 @@ pub fn get_rgb_channel_info(channel_id: &ChannelId, ldk_data_dir: &Path) -> (Rgb
530530
}
531531

532532
/// Whether the channel data for a channel exist
533-
pub fn is_channel_rgb(channel_id: &ChannelId, ldk_data_dir: &PathBuf) -> bool {
533+
pub fn is_channel_rgb(channel_id: &ChannelId, ldk_data_dir: &Path) -> bool {
534534
ldk_data_dir.join(channel_id.to_hex()).exists()
535535
}
536536

@@ -681,7 +681,7 @@ pub(crate) fn update_rgb_channel_amount(channel_id: &ChannelId, rgb_offered_htlc
681681
}
682682

683683
/// Whether the payment is colored
684-
pub(crate) fn is_payment_rgb(ldk_data_dir: &PathBuf, payment_hash: &PaymentHash) -> bool {
684+
pub(crate) fn is_payment_rgb(ldk_data_dir: &Path, payment_hash: &PaymentHash) -> bool {
685685
ldk_data_dir.join(hex::encode(payment_hash.0)).exists()
686686
}
687687

lightning/src/sign/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ impl EcdsaChannelSigner for InMemorySigner {
12561256
let chan_type = &channel_parameters.channel_type_features;
12571257
let mut htlc_tx = chan_utils::build_htlc_transaction(&commitment_txid, commitment_tx.feerate_per_kw(), holder_selected_contest_delay, htlc, chan_type, &keys.broadcaster_delayed_payment_key, &keys.revocation_key);
12581258
if commitment_tx.is_colored() {
1259-
if let Err(_e) = color_htlc(&mut htlc_tx, &htlc, &self.ldk_data_dir) {
1259+
if let Err(_e) = color_htlc(&mut htlc_tx, htlc, &self.ldk_data_dir) {
12601260
return Err(())
12611261
}
12621262
}

0 commit comments

Comments
 (0)