|
1 | 1 | //! Error Module |
2 | 2 |
|
3 | 3 | use thiserror::Error; |
| 4 | +use zk_kit_lean_imt::lean_imt::LeanIMTError; |
4 | 5 |
|
5 | 6 | #[derive(Error, Debug, PartialEq, Eq)] |
6 | 7 | pub enum SemaphoreError { |
| 8 | + #[error("Member already removed")] |
| 9 | + AlreadyRemovedMember, |
| 10 | + #[error("Member value is empty")] |
| 11 | + EmptyLeaf, |
7 | 12 | #[error("Input array of size {0} exceeds maximum allowed length of 32 bytes")] |
8 | 13 | InputSizeExceeded(usize), |
9 | | - #[error("Public key validation failed: point is not on curve")] |
10 | | - PublicKeyNotOnCurve, |
11 | | - #[error("Signature verification failed")] |
12 | | - SignatureVerificationFailed, |
| 14 | + #[error("LeanIMT error: {0}")] |
| 15 | + LeanIMTError(LeanIMTError), |
13 | 16 | #[error("Message of size {0} exceeds maximum allowed length of 32 bytes")] |
14 | 17 | MessageSizeExceeded(usize), |
| 18 | + #[error("Public key validation failed: point is not on curve")] |
| 19 | + PublicKeyNotOnCurve, |
| 20 | + #[error("Member has been removed")] |
| 21 | + RemovedMember, |
15 | 22 | #[error("Signature point R is not on curve")] |
16 | 23 | SignaturePointNotOnCurve, |
| 24 | + #[error("Signature verification failed")] |
| 25 | + SignatureVerificationFailed, |
| 26 | +} |
| 27 | + |
| 28 | +impl From<LeanIMTError> for SemaphoreError { |
| 29 | + fn from(error: LeanIMTError) -> Self { |
| 30 | + SemaphoreError::LeanIMTError(error) |
| 31 | + } |
17 | 32 | } |
0 commit comments