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
use thiserror::Error;
#[allow(missing_docs)]
#[derive(Error, Debug, PartialEq, Eq)]
pub enum Error {
#[error("signature check failed")]
FailedSignature,
#[error("key not found in the chain")]
KeyNotFound,
#[error("chain doesn't contain any trusted keys")]
Untrusted,
#[error("attempted operation is invalid")]
InvalidOperation,
}
#[derive(Debug, Error, Eq, PartialEq)]
pub(crate) enum IntegrityError {
#[error("signature check failed")]
FailedSignature,
#[error("parent key not found in the chain")]
ParentNotFound,
#[error("chain blocks are in a wrong order")]
WrongBlockOrder,
}