Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
ozankaymak committed Aug 29, 2024
1 parent 1acb70e commit 3126d91
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
13 changes: 3 additions & 10 deletions core/tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,8 @@ pub async fn run_single_deposit(
// Send operators some bitcoin so that they can afford the kickoff tx
let secp = bitcoin::secp256k1::Secp256k1::new();
let operator_internal_xonly_pk = config.operators_xonly_pks.get(i).unwrap();
let operator_address = Address::p2tr(
&secp,
*operator_internal_xonly_pk,
None,
config.network,
);
let operator_address =
Address::p2tr(&secp, *operator_internal_xonly_pk, None, config.network);
let operator_funding_outpoint = rpc
.send_to_address(&operator_address, 2 * BRIDGE_AMOUNT_SATS)
.unwrap();
Expand Down Expand Up @@ -195,10 +191,7 @@ pub async fn run_single_deposit(
i,
config.verifiers_public_keys.clone(),
&agg_nonces[i + 1].clone(),
operator_take_partial_sigs
.iter()
.map(|v| v[i])
.collect(),
operator_take_partial_sigs.iter().map(|v| v[i]).collect(),
config.network,
)?;

Expand Down
26 changes: 12 additions & 14 deletions core/tests/musig2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,12 @@ async fn test_musig2_key_spend() {
musig2::verify_single(musig_agg_pubkey, final_signature, message)
.expect("Verification failed!");
let schnorr_sig = secp256k1::schnorr::Signature::from_slice(&final_signature).unwrap();
secp
.verify_schnorr(
&schnorr_sig,
&Message::from_digest(message),
&musig_agg_xonly_pubkey_wrapped,
)
.unwrap();
secp.verify_schnorr(
&schnorr_sig,
&Message::from_digest(message),
&musig_agg_xonly_pubkey_wrapped,
)
.unwrap();
println!("MuSig2 signature verified successfully!");
println!("SECP Verified Successfully");
tx_details.tx.input[0].witness.push(final_signature);
Expand Down Expand Up @@ -214,13 +213,12 @@ async fn test_musig2_key_spend_with_script() {
musig2::verify_single(musig_agg_pubkey, final_signature, message)
.expect("Verification failed!");
let schnorr_sig = secp256k1::schnorr::Signature::from_slice(&final_signature).unwrap();
secp
.verify_schnorr(
&schnorr_sig,
&Message::from_digest(message),
&musig_agg_xonly_pubkey_wrapped,
)
.unwrap();
secp.verify_schnorr(
&schnorr_sig,
&Message::from_digest(message),
&musig_agg_xonly_pubkey_wrapped,
)
.unwrap();
// println!("MuSig2 signature verified successfully!");
// println!("SECP Verification: {:?}", res);
tx_details.tx.input[0].witness.push(final_signature);
Expand Down

0 comments on commit 3126d91

Please sign in to comment.