Skip to content

Commit 8c507ae

Browse files
committed
feat: group
1 parent a646e72 commit 8c507ae

File tree

6 files changed

+644
-87
lines changed

6 files changed

+644
-87
lines changed

src/baby_jubjub.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ pub const BASE_Y: Fq =
9999
#[cfg(test)]
100100
mod tests {
101101
//! Implementation of the tests presented in the EIP-2494
102+
102103
use super::*;
103104
use ark_ec::CurveGroup;
104105
use ark_ff::{PrimeField, Zero};

src/error.rs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
//! Error Module
22
33
use thiserror::Error;
4+
use zk_kit_lean_imt::lean_imt::LeanIMTError;
45

56
#[derive(Error, Debug, PartialEq, Eq)]
67
pub enum SemaphoreError {
8+
#[error("Member already removed")]
9+
AlreadyRemovedMember,
10+
#[error("Member value is empty")]
11+
EmptyLeaf,
712
#[error("Input array of size {0} exceeds maximum allowed length of 32 bytes")]
813
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),
1316
#[error("Message of size {0} exceeds maximum allowed length of 32 bytes")]
1417
MessageSizeExceeded(usize),
18+
#[error("Public key validation failed: point is not on curve")]
19+
PublicKeyNotOnCurve,
20+
#[error("Member has been removed")]
21+
RemovedMember,
1522
#[error("Signature point R is not on curve")]
1623
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+
}
1732
}

0 commit comments

Comments
 (0)