mirror of
https://github.com/mii443/RustySecrets.git
synced 2025-08-22 16:25:32 +00:00
MissingShares should take u8
for required
arg
This commit is contained in:
committed by
Romain Ruetschi
parent
fd74534fa1
commit
cb13a9b5db
@ -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)
|
||||
}
|
||||
|
@ -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))
|
||||
|
Reference in New Issue
Block a user