Skip to content

Commit

Permalink
Add Musig2 example file
Browse files Browse the repository at this point in the history
  • Loading branch information
jlest01 committed Aug 30, 2024
1 parent 1fd6a91 commit 0a2361b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/musig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main() {
let seckey2 = SecretKey::new(&mut rng);
let pubkey2 = PublicKey::from_secret_key(&secp, &seckey2);

let pubkeys = vec![pubkey1, pubkey2];
let pubkeys = [pubkey1, pubkey2];
let pubkeys_ref: Vec<&PublicKey> = pubkeys.iter().collect();
let pubkeys_ref = pubkeys_ref.as_slice();

Expand Down Expand Up @@ -51,7 +51,7 @@ fn main() {
let sec_nonce2 = nonce_pair2.0;
let pub_nonce2 = nonce_pair2.1;

let nonces = vec![pub_nonce1, pub_nonce2];
let nonces = [pub_nonce1, pub_nonce2];
let nonces_ref: Vec<&MusigPubNonce> = nonces.iter().collect();
let nonces_ref = nonces_ref.as_slice();

Expand All @@ -71,7 +71,7 @@ fn main() {
let is_partial_signature_valid = session.partial_verify(&secp, &musig_key_agg_cache, partial_sign2, pub_nonce2, pubkey2);
assert!(is_partial_signature_valid);

let partial_sigs = vec![partial_sign1, partial_sign2];
let partial_sigs = [partial_sign1, partial_sign2];
let partial_sigs_ref: Vec<&MusigPartialSignature> = partial_sigs.iter().collect();
let partial_sigs_ref = partial_sigs_ref.as_slice();

Expand Down

0 comments on commit 0a2361b

Please sign in to comment.