mirror of
https://github.com/vacp2p/zerokit.git
synced 2026-01-09 21:58:06 -05:00
Changes: - Unified error types (`PoseidonError`, `HashError`, etc.) across hashing, keygen, witness calculation, and serialization for consistent and descriptive error handling. - Refactored tests and examples to use `unwrap()` where safe, and limited `expect()` in library code to non-panicking cases with clear messaging. - Improved witness and proof generation by removing panicking code paths and enforcing proper error propagation. - Cleaned up outdated imports, removed unused operations in `graph.rs`, and updated public API documentation. - Updated C, Nim, and WASM FFI bindings with more robust serialization and clearer error log messages. - Added keywords to package.json and update dependencies in Makefile.toml and Nightly CI.
26 lines
854 B
Rust
26 lines
854 B
Rust
/// Errors that can occur during zkey reading operations
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum ZKeyReadError {
|
|
#[error("Empty zkey bytes provided")]
|
|
EmptyBytes,
|
|
#[error("{0}")]
|
|
SerializationError(#[from] ark_serialize::SerializationError),
|
|
}
|
|
|
|
/// Errors that can occur during witness calculation
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum WitnessCalcError {
|
|
#[error("Failed to deserialize witness calculation graph: {0}")]
|
|
GraphDeserialization(#[from] std::io::Error),
|
|
#[error("Failed to evaluate witness calculation graph: {0}")]
|
|
GraphEvaluation(String),
|
|
#[error("Invalid input length for '{name}': expected {expected}, got {actual}")]
|
|
InvalidInputLength {
|
|
name: String,
|
|
expected: usize,
|
|
actual: usize,
|
|
},
|
|
#[error("Missing required input: {0}")]
|
|
MissingInput(String),
|
|
}
|