Skip to content

Commit e81c6ef

Browse files
committed
Use three keys in combine_keys example
We can combine two keys with `pk1.combine(&pk2)`, for the `combine_keys` example we might as well show off the ability to combine more than two keys.
1 parent 5e317d0 commit e81c6ef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/key.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,8 @@ impl PublicKey {
540540
/// let mut rng = rand::thread_rng();
541541
/// let (_, pk1) = secp.generate_keypair(&mut rng);
542542
/// let (_, pk2) = secp.generate_keypair(&mut rng);
543-
/// let sum = PublicKey::combine_keys(&[&pk1, &pk2]).expect("It's improbable to fail for 2 random public keys");
543+
/// let (_, pk3) = secp.generate_keypair(&mut rng);
544+
/// let sum = PublicKey::combine_keys(&[&pk1, &pk2, &pk3]).expect("It's improbable to fail for 3 random public keys");
544545
/// # }
545546
/// ```
546547
pub fn combine_keys(keys: &[&PublicKey]) -> Result<PublicKey, Error> {

0 commit comments

Comments
 (0)