mithril_stm/circuits/halo2/off_circuit/error.rs
1use thiserror::Error;
2
3// NOTE:
4// At this stage of the Halo2 certificate prototype import, we keep
5// `SignatureError` and `MerkleTreeError` as separate enums even though they
6// currently share the same variants.
7//
8// This mirrors the structure of the original prototype and keeps error
9// semantics explicit at call sites (signature vs merkle verification).
10// As the circuit module evolves and error handling stabilizes, these error
11// types may later be refactored or unified if appropriate.
12
13#[derive(Debug, Error)]
14pub enum SignatureError {
15 #[error("Verification failed: Signature is invalid.")]
16 VerificationFailed,
17 /// This error occurs when the serialization of the raw bytes failed
18 #[error("Invalid bytes")]
19 SerializationError,
20}
21
22#[derive(Debug, Error)]
23pub enum MerkleTreeError {
24 #[error("Verification failed: Merkle proof is invalid.")]
25 VerificationFailed,
26 /// This error occurs when the serialization of the raw bytes failed
27 #[error("Invalid bytes")]
28 SerializationError,
29}