Skip to content

Commit

Permalink
add missing frost run_dkg_sign_v2; change log spam to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
xoloki committed Oct 22, 2024
1 parent e70ffb5 commit 0b56917
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
14 changes: 9 additions & 5 deletions src/state_machine/coordinator/fire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,19 +949,19 @@ impl<Aggregator: AggregatorTrait> Coordinator<Aggregator> {
&key_ids,
merkle_root,
)?;
info!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
debug!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
self.schnorr_proof = Some(schnorr_proof);
} else if let SignatureType::Schnorr = signature_type {
let schnorr_proof =
self.aggregator
.sign_schnorr(&self.message, &nonces, &shares, &key_ids)?;
info!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
debug!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
self.schnorr_proof = Some(schnorr_proof);
} else {
let signature = self
.aggregator
.sign(&self.message, &nonces, &shares, &key_ids)?;
info!("Signature ({}, {})", signature.R, signature.z);
debug!("Signature ({}, {})", signature.R, signature.z);
self.signature = Some(signature);
}

Expand Down Expand Up @@ -1357,12 +1357,16 @@ pub mod test {

#[test]
fn run_dkg_sign_v1() {
run_dkg_sign::<FireCoordinator<v1::Aggregator>, v1::Signer>(5, 2);
for _ in 0..4 {
run_dkg_sign::<FireCoordinator<v1::Aggregator>, v1::Signer>(5, 2);
}
}

#[test]
fn run_dkg_sign_v2() {
run_dkg_sign::<FireCoordinator<v2::Aggregator>, v2::Signer>(5, 2);
for _ in 0..4 {
run_dkg_sign::<FireCoordinator<v2::Aggregator>, v2::Signer>(5, 2);
}
}

#[test]
Expand Down
17 changes: 13 additions & 4 deletions src/state_machine/coordinator/frost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,19 +505,19 @@ impl<Aggregator: AggregatorTrait> Coordinator<Aggregator> {
&key_ids,
merkle_root,
)?;
info!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
debug!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
self.schnorr_proof = Some(schnorr_proof);
} else if let SignatureType::Schnorr = signature_type {
let schnorr_proof =
self.aggregator
.sign_schnorr(&self.message, &nonces, shares, &key_ids)?;
info!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
debug!("SchnorrProof ({}, {})", schnorr_proof.r, schnorr_proof.s);
self.schnorr_proof = Some(schnorr_proof);
} else {
let signature = self
.aggregator
.sign(&self.message, &nonces, shares, &key_ids)?;
info!("Signature ({}, {})", signature.R, signature.z);
debug!("Signature ({}, {})", signature.R, signature.z);
self.signature = Some(signature);
}

Expand Down Expand Up @@ -862,7 +862,16 @@ pub mod test {

#[test]
fn run_dkg_sign_v1() {
run_dkg_sign::<FrostCoordinator<v1::Aggregator>, v1::Signer>(5, 2);
for _ in 0..4 {
run_dkg_sign::<FrostCoordinator<v1::Aggregator>, v1::Signer>(5, 2);
}
}

#[test]
fn run_dkg_sign_v2() {
for _ in 0..4 {
run_dkg_sign::<FrostCoordinator<v2::Aggregator>, v2::Signer>(5, 2);
}
}

#[test]
Expand Down

0 comments on commit 0b56917

Please sign in to comment.