pub fn check_threshold_is_met(
        threshold: NumberOfNodes,
        num_dealings: NodeIndex,
        num_responses: NodeIndex,
    ) -> Result<(), DkgCreateTranscriptError> {
        if num_dealings < threshold.get()
            || num_responses == 0
            || threshold.get() > (num_responses - 1) / 2 + 1
        {
            return Err(DkgCreateTranscriptError::InsufficientDataError(InvalidArgumentError {
            message: format!("Insufficient information to run DKG safely. threshold: {} num_dealings: {} num_responses: {}", threshold, num_dealings, num_responses),
        }));
        }
        Ok(())
    }
/// Check that we have at least threshold dealings and 2*threshold-1
/// responses.
Check that we have at least threshold dealings and 2*threshold-1
responses.
Check that we have at least threshold dealings and 2 * threshold - 1 responses .
pub fn check_threshold_is_met(
        threshold: NumberOfNodes,
        num_dealings: NodeIndex,
        num_responses: NodeIndex,
    ) -> Result<(), DkgCreateTranscriptError> {
        if num_dealings < threshold.get()
            || num_responses == 0
            || threshold.get() > (num_responses - 1) / 2 + 1
        {
            return Err(DkgCreateTranscriptError::InsufficientDataError(InvalidArgumentError {
            message: format!("Insufficient information to run DKG safely. threshold: {} num_dealings: {} num_responses: {}", threshold, num_dealings, num_responses),
        }));
        }
        Ok(())
    }
pub fn check_threshold_is_met ( threshold : NumberOfNodes , num_dealings : NodeIndex , num_responses : NodeIndex , ) -> Result < ( ) , DkgCreateTranscriptError > { if num_dealings < threshold . get ( ) || num_responses == 0 || threshold . get ( ) > ( num_responses - 1 ) / 2 + 1 { return Err ( DkgCreateTranscriptError :: InsufficientDataError ( InvalidArgumentError { message : format ! ( " " threshold num_dealings num_responses ) , } ) ) ; } Ok ( ( ) ) }
Check that we have at least threshold dealings and 2*threshold-1
responses.
Check that we have at least threshold dealings and 2 * threshold - 1 responses .
threshold
NumberOfNodes
num_dealings
NodeIndex
num_responses
NodeIndex
threshold
NumberOfNodes
num_dealings
NodeIndex
num_responses
NodeIndex