Skip to content

Commit ed867ba

Browse files
psiveselyromac
authored andcommitted
Remove ShareIdentifierTooBig error and validation
Since id is a `u8` it will never be greater than 255.
1 parent b03433a commit ed867ba

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

src/errors.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ error_chain! {
5959
display("The shares are incompatible with each other.")
6060
}
6161

62-
ShareIdentifierTooBig(id: u8, n: u8) {
63-
description("Share identifier too big")
64-
display("Found share identifier ({}) bigger than the maximum number of shares ({}).", id, n)
65-
}
66-
6762
MissingShares(provided: usize, required: usize) {
6863
description("The number of shares provided is insufficient to recover the secret.")
6964
display("{} shares are required to recover the secret, found only {}.", required, provided)

src/share/validation.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ pub(crate) fn validate_shares<S: IsShare>(shares: Vec<S>) -> Result<(u8, Vec<S>)
3737
for share in shares {
3838
let (id, threshold) = (share.get_id(), share.get_threshold());
3939

40-
if id > MAX_SHARES {
41-
bail!(ErrorKind::ShareIdentifierTooBig(id, MAX_SHARES))
42-
}
43-
4440
if id < 1 {
4541
bail!(ErrorKind::ShareParsingInvalidShareId(id))
4642
}

0 commit comments

Comments
 (0)