Skip to content

Commit d12c0f6

Browse files
committed
musig: add missing Panics sections to docs
1 parent 856c2ff commit d12c0f6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/musig.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ impl KeyAggCache {
307307
/// let _agg_pk = key_agg_cache.agg_pk();
308308
/// # }
309309
/// ```
310+
///
311+
/// # Panics
312+
///
313+
/// Panics if an empty slice of pubkeys is provided.
310314
pub fn new<C: Verification>(secp: &Secp256k1<C>, pubkeys: &[&PublicKey]) -> Self {
311315
let cx = secp.ctx().as_ptr();
312316

@@ -729,6 +733,10 @@ impl AggregatedNonce {
729733
/// let aggnonce = AggregatedNonce::new(&secp, &[&pub_nonce1, &pub_nonce2]);
730734
/// # }
731735
/// ```
736+
/// # Panics
737+
///
738+
/// Panics if an empty slice of nonces is provided.
739+
///
732740
pub fn new<C: Signing>(secp: &Secp256k1<C>, nonces: &[&PublicNonce]) -> Self {
733741
if nonces.is_empty() {
734742
panic!("Cannot aggregate an empty slice of nonces");
@@ -1140,6 +1148,10 @@ impl Session {
11401148
/// assert!(aggregated_signature.verify(&secp, &agg_pk, &msg_bytes).is_ok());
11411149
/// # }
11421150
/// ```
1151+
///
1152+
/// # Panics
1153+
///
1154+
/// Panics if an empty slice of partial signatures is provided.
11431155
pub fn partial_sig_agg(&self, partial_sigs: &[&PartialSignature]) -> AggregatedSignature {
11441156
if partial_sigs.is_empty() {
11451157
panic!("Cannot aggregate an empty slice of partial signatures");

0 commit comments

Comments
 (0)