Skip to content

Commit

Permalink
Fix max_signers retrieval in CLIComms (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykoren authored Feb 10, 2025
1 parent 548a8a7 commit 3613c1b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dkg/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub async fn cli_for_processed_args<C: Ciphersuite + 'static + MaybeIntoEvenY>(

let rng = thread_rng();

let (identifier, max_signers) = comms.get_identifier(input, logger).await?;
let (identifier, max_signers) = comms.get_identifier_and_max_signers(input, logger).await?;

let (round1_secret_package, round1_package) =
frost::keys::dkg::part1(identifier, max_signers, pargs.min_signers, rng)?;
Expand Down
2 changes: 1 addition & 1 deletion dkg/src/comms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use frost::Identifier;
pub trait Comms<C: Ciphersuite> {
/// Return this participant's identifier (in case it's derived from other
/// information) and the number of participants in the signing session.
async fn get_identifier(
async fn get_identifier_and_max_signers(
&mut self,
input: &mut dyn BufRead,
output: &mut dyn Write,
Expand Down
6 changes: 4 additions & 2 deletions dkg/src/comms/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<C> Comms<C> for CLIComms<C>
where
C: Ciphersuite + 'static,
{
async fn get_identifier(
async fn get_identifier_and_max_signers(
&mut self,
_input: &mut dyn BufRead,
_output: &mut dyn Write,
Expand All @@ -54,7 +54,9 @@ where
self.args
.identifier
.ok_or_eyre("identifier must be specified")?,
0,
self.args
.max_signers
.ok_or_eyre("max_signers must be specified")?,
))
}

Expand Down
2 changes: 1 addition & 1 deletion dkg/src/comms/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ impl<C: Ciphersuite> HTTPComms<C> {

#[async_trait(?Send)]
impl<C: Ciphersuite + 'static> Comms<C> for HTTPComms<C> {
async fn get_identifier(
async fn get_identifier_and_max_signers(
&mut self,
_input: &mut dyn BufRead,
_output: &mut dyn Write,
Expand Down

0 comments on commit 3613c1b

Please sign in to comment.