Remove ShareIdentifierTooBig error and validation

Since id is a `u8` it will never be greater than 255.
This commit is contained in:
Noah Vesely
2018-03-26 17:10:38 -06:00
committed by Romain Ruetschi
parent b03433af09
commit ed867ba938
2 changed files with 0 additions and 9 deletions

View File

@ -59,11 +59,6 @@ error_chain! {
display("The shares are incompatible with each other.") display("The shares are incompatible with each other.")
} }
ShareIdentifierTooBig(id: u8, n: u8) {
description("Share identifier too big")
display("Found share identifier ({}) bigger than the maximum number of shares ({}).", id, n)
}
MissingShares(provided: usize, required: usize) { MissingShares(provided: usize, required: usize) {
description("The number of shares provided is insufficient to recover the secret.") description("The number of shares provided is insufficient to recover the secret.")
display("{} shares are required to recover the secret, found only {}.", required, provided) display("{} shares are required to recover the secret, found only {}.", required, provided)

View File

@ -37,10 +37,6 @@ pub(crate) fn validate_shares<S: IsShare>(shares: Vec<S>) -> Result<(u8, Vec<S>)
for share in shares { for share in shares {
let (id, threshold) = (share.get_id(), share.get_threshold()); let (id, threshold) = (share.get_id(), share.get_threshold());
if id > MAX_SHARES {
bail!(ErrorKind::ShareIdentifierTooBig(id, MAX_SHARES))
}
if id < 1 { if id < 1 {
bail!(ErrorKind::ShareParsingInvalidShareId(id)) bail!(ErrorKind::ShareParsingInvalidShareId(id))
} }