MissingShares should take u8 for required arg

This commit is contained in:
Noah Vesely
2018-03-27 14:37:11 -06:00
committed by Romain Ruetschi
parent fd74534fa1
commit cb13a9b5db
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ error_chain! {
display("The shares are incompatible with each other.")
}
MissingShares(provided: usize, required: usize) {
MissingShares(provided: usize, required: u8) {
description("The number of shares provided is insufficient to recover the secret.")
display("{} shares are required to recover the secret, found only {}.", required, provided)
}

View File

@ -81,7 +81,7 @@ pub(crate) fn validate_shares<S: IsShare>(shares: Vec<S>) -> Result<(u8, Vec<S>)
let threshold = k_compatibility_sets.keys().last().unwrap().to_owned();
if shares_count < threshold as usize {
bail!(ErrorKind::MissingShares(shares_count, threshold as usize));
bail!(ErrorKind::MissingShares(shares_count, threshold));
}
Ok((threshold, result))