Skip to content

Commit f554c59

Browse files
committed
Drop redundant .clone() in check_spends calls.
The API to rust-bitcoin to check a transaction correctly spends another changed some time ago, but we still have a lot of needless .clone()s in our tests.
1 parent 9de9288 commit f554c59

File tree

3 files changed

+109
-109
lines changed

3 files changed

+109
-109
lines changed

lightning/src/ln/functional_test_utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ pub fn test_txn_broadcast<'a, 'b, 'c>(node: &Node<'a, 'b, 'c>, chan: &(msgs::Cha
10331033
let mut res = Vec::with_capacity(2);
10341034
node_txn.retain(|tx| {
10351035
if tx.input.len() == 1 && tx.input[0].previous_output.txid == chan.3.txid() {
1036-
check_spends!(tx, chan.3.clone());
1036+
check_spends!(tx, chan.3);
10371037
if commitment_tx.is_none() {
10381038
res.push(tx.clone());
10391039
}
@@ -1049,7 +1049,7 @@ pub fn test_txn_broadcast<'a, 'b, 'c>(node: &Node<'a, 'b, 'c>, chan: &(msgs::Cha
10491049
if has_htlc_tx != HTLCType::NONE {
10501050
node_txn.retain(|tx| {
10511051
if tx.input.len() == 1 && tx.input[0].previous_output.txid == res[0].txid() {
1052-
check_spends!(tx, res[0].clone());
1052+
check_spends!(tx, res[0]);
10531053
if has_htlc_tx == HTLCType::TIMEOUT {
10541054
assert!(tx.lock_time != 0);
10551055
} else {
@@ -1098,7 +1098,7 @@ pub fn check_preimage_claim<'a, 'b, 'c>(node: &Node<'a, 'b, 'c>, prev_txn: &Vec<
10981098

10991099
for tx in prev_txn {
11001100
if node_txn[0].input[0].previous_output.txid == tx.txid() {
1101-
check_spends!(node_txn[0], tx.clone());
1101+
check_spends!(node_txn[0], tx);
11021102
assert!(node_txn[0].input[0].witness[2].len() > 106); // must spend an htlc output
11031103
assert_eq!(tx.input.len(), 1); // must spend a commitment tx
11041104

0 commit comments

Comments
 (0)