Skip to content

Commit

Permalink
Clippy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrembal committed Sep 5, 2024
1 parent 7d09e00 commit 92f08ee
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions core/src/database/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ mod tests {
.collect();
let agg_nonces: Vec<MuSigAggNonce> = nonce_pairs
.iter()
.map(|(_, pub_nonce)| pub_nonce.clone())
.map(|(_, pub_nonce)| *pub_nonce)
.collect();
db.save_nonces(outpoint, &nonce_pairs).await.unwrap();
db.save_agg_nonces(outpoint, &agg_nonces).await.unwrap();
Expand Down Expand Up @@ -800,7 +800,7 @@ mod tests {
.collect();
let agg_nonces: Vec<MuSigAggNonce> = nonce_pairs
.iter()
.map(|(_, pub_nonce)| pub_nonce.clone())
.map(|(_, pub_nonce)| *pub_nonce)
.collect();
db.save_nonces(outpoint, &nonce_pairs).await.unwrap();
db.save_agg_nonces(outpoint, &agg_nonces).await.unwrap();
Expand Down Expand Up @@ -845,7 +845,7 @@ mod tests {
.collect();
let agg_nonces: Vec<MuSigAggNonce> = nonce_pairs
.iter()
.map(|(_, pub_nonce)| pub_nonce.clone())
.map(|(_, pub_nonce)| *pub_nonce)
.collect();
db.save_nonces(outpoint, &nonce_pairs).await.unwrap();
db.save_agg_nonces(outpoint, &agg_nonces).await.unwrap();
Expand Down
28 changes: 14 additions & 14 deletions core/src/musig2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ mod tests {
let key_agg_ctx = super::create_key_agg_ctx(pks.clone(), None, false).unwrap();
// Aggregate the public nonces into the aggregated nonce
let agg_nonce =
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1.clone()).collect());
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1).collect());
// Extract the aggregated public key
let musig_agg_pubkey: musig2::secp256k1::PublicKey = key_agg_ctx.aggregated_pubkey();
// Calculate the partial signatures
Expand All @@ -223,7 +223,7 @@ mod tests {
None,
false,
nonce_pair.0,
agg_nonce.clone(),
agg_nonce,
kp,
message,
)
Expand Down Expand Up @@ -264,7 +264,7 @@ mod tests {
None,
false,
sec_nonce_0,
agg_nonce.clone(),
agg_nonce,
&kp_0,
message,
);
Expand All @@ -273,7 +273,7 @@ mod tests {
None,
false,
sec_nonce_1,
agg_nonce.clone(),
agg_nonce,
&kp_1,
message,
);
Expand All @@ -283,7 +283,7 @@ mod tests {
Some(TapNodeHash::from_slice(&[1u8; 32]).unwrap()),
true,
sec_nonce_2,
agg_nonce.clone(),
agg_nonce,
&kp_2,
message,
);
Expand Down Expand Up @@ -316,7 +316,7 @@ mod tests {
)
.unwrap();
let agg_nonce =
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1.clone()).collect());
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1).collect());
let musig_agg_pubkey: musig2::secp256k1::PublicKey = key_agg_ctx.aggregated_pubkey();
let partial_sigs: Vec<MuSigPartialSignature> = kp_vec
.iter()
Expand All @@ -327,7 +327,7 @@ mod tests {
Some(TapNodeHash::from_slice(&tweak).unwrap()),
true,
nonce_pair.0,
agg_nonce.clone(),
agg_nonce,
kp,
message,
)
Expand Down Expand Up @@ -367,7 +367,7 @@ mod tests {
Some(TapNodeHash::from_slice(&tweak).unwrap()),
true,
sec_nonce_0,
agg_nonce.clone(),
agg_nonce,
&kp_0,
message,
);
Expand All @@ -376,7 +376,7 @@ mod tests {
Some(TapNodeHash::from_slice(&tweak).unwrap()),
true,
sec_nonce_1,
agg_nonce.clone(),
agg_nonce,
&kp_1,
message,
);
Expand All @@ -386,7 +386,7 @@ mod tests {
None,
false,
sec_nonce_2,
agg_nonce.clone(),
agg_nonce,
&kp_2,
message,
);
Expand Down Expand Up @@ -420,7 +420,7 @@ mod tests {
)
.unwrap();
let agg_nonce =
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1.clone()).collect());
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1).collect());
let dummy_script = script::Builder::new().push_int(1).into_script();
let scripts: Vec<ScriptBuf> = vec![dummy_script];
let receiving_address = bitcoin::Address::p2tr(
Expand Down Expand Up @@ -468,7 +468,7 @@ mod tests {
merkle_root,
true,
nonce_pair.0,
agg_nonce.clone(),
agg_nonce,
kp,
message,
)
Expand Down Expand Up @@ -506,7 +506,7 @@ mod tests {
.map(|kp| kp.public_key())
.collect::<Vec<secp256k1::PublicKey>>();
let agg_nonce =
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1.clone()).collect());
super::aggregate_nonces(nonce_pair_vec.iter().map(|x| x.1).collect());
let musig_agg_xonly_pubkey_wrapped =
XOnlyPublicKey::from_musig2_pks(pks.clone(), None, false);
let musig2_script = bitcoin::script::Builder::new()
Expand Down Expand Up @@ -559,7 +559,7 @@ mod tests {
None,
false,
nonce_pair.0,
agg_nonce.clone(),
agg_nonce,
kp,
message,
)
Expand Down
6 changes: 3 additions & 3 deletions core/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub async fn run_single_deposit(
deposit_outpoint,
signer_address,
evm_address,
agg_nonces[0].clone(),
agg_nonces[0],
move_tx_partial_sigs,
)
.await
Expand Down Expand Up @@ -445,7 +445,7 @@ mod tests {
deposit_outpoint,
signer_address.clone(),
evm_address,
agg_nonces[0].clone(),
agg_nonces[0],
move_tx_partial_sigs,
)
.await
Expand All @@ -457,7 +457,7 @@ mod tests {
deposit_outpoint,
signer_address,
evm_address,
agg_nonces[0].clone(),
agg_nonces[0],
move_tx_partial_sigs_retry,
)
.await
Expand Down
6 changes: 3 additions & 3 deletions core/tests/musig2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async fn test_musig2_key_spend() {
merkle_root,
true,
nonce_pair.0,
agg_nonce.clone(),
agg_nonce,
kp,
message,
)
Expand Down Expand Up @@ -192,7 +192,7 @@ async fn test_musig2_key_spend_with_script() {
merkle_root,
true,
nonce_pair.0,
agg_nonce.clone(),
agg_nonce,
kp,
message,
)
Expand Down Expand Up @@ -300,7 +300,7 @@ async fn test_musig2_script_spend() {
None,
false,
nonce_pair.0,
agg_nonce.clone(),
agg_nonce,
kp,
message,
)
Expand Down

0 comments on commit 92f08ee

Please sign in to comment.