#[non_exhaustive]pub enum Error {
TreeFull {
capacity: usize,
attempted_index: usize,
},
InvalidProof,
UnknownRoot,
InvalidLength {
expected: usize,
actual: usize,
},
ParseError(String),
FieldOverflow,
InvalidTreeConfig(String),
LeafIndexOutOfBounds {
index: u32,
tree_size: u32,
},
}Expand description
All errors that can occur in stealth-lib operations.
This enum is #[non_exhaustive] to allow adding new variants in future
minor versions without breaking semver compatibility.
§Example
use stealth_lib::Error;
fn example() -> Result<(), Error> {
Err(Error::TreeFull {
capacity: 1048576,
attempted_index: 1048576,
})
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TreeFull
Merkle tree has reached maximum capacity.
This occurs when attempting to insert a leaf into a full tree.
The tree capacity is 2^levels.
Fields
InvalidProof
Invalid Merkle proof.
The proof does not verify against the expected root.
UnknownRoot
Root not found in history.
The provided root hash is not in the tree’s root history buffer.
InvalidLength
Input data has invalid length.
Expected a specific number of bytes but received a different amount.
ParseError(String)
Parsing failed.
Failed to parse input data (e.g., from string representation).
FieldOverflow
Arithmetic overflow in field operations.
An arithmetic operation would overflow the field modulus.
InvalidTreeConfig(String)
Invalid tree configuration.
The tree parameters are invalid (e.g., zero levels).
LeafIndexOutOfBounds
Leaf index out of bounds.
The requested leaf index does not exist in the tree.
Trait Implementations§
Source§impl From<SolanaError> for Error
impl From<SolanaError> for Error
Source§fn from(err: SolanaError) -> Self
fn from(err: SolanaError) -> Self
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.