1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ConcurrentMerkleTreeError {
#[error("Received an index larger than the rightmost index")]
LeafIndexOutOfBounds,
#[error("Invalid root recomputed from proof")]
InvalidProof,
#[error("Cannot append an empty node")]
CannotAppendEmptyNode,
#[error("Tree is full, cannot append")]
TreeFull,
#[error("Tree already initialized")]
TreeAlreadyInitialized,
#[error("Root not found in changelog buffer")]
RootNotFound,
#[error(
"Valid proof was passed to a leaf, but its value has changed since the proof was issued"
)]
LeafContentsModified,
}