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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
use thiserror::Error as DeriveError;
use runtime::ZeroingAlloc;
pub mod snapshot;
pub mod store;
pub mod vault;
pub use runtime;
#[global_allocator]
static ALLOC: ZeroingAlloc<std::alloc::System> = ZeroingAlloc(std::alloc::System);
#[derive(Debug, DeriveError)]
pub enum Error {
#[error("IOError: `{0}`")]
IoError(#[from] std::io::Error),
#[error("Snapshot Error: `{0}`")]
SnapshotError(String),
#[error("Crypto Error: `{0}`")]
CryptoError(crypto::Error),
#[error("LZ4 Error: `{0}`")]
Lz4Error(String),
#[error("TryInto Error: `{0}`")]
TryIntoError(#[from] std::array::TryFromSliceError),
#[error("Database Error: `{0}`")]
DatabaseError(String),
#[error("Version Error: `{0}`")]
VersionError(String),
#[error("Chain error: `{0}`")]
ChainError(String),
#[error("Base64Error")]
Base64Error,
#[error("Base64Error: `{0}`")]
Base64ErrorDetailed(String),
#[error("Interface Error")]
InterfaceError,
#[error("Other Error")]
OtherError(String),
#[error("Provider Error: `{0}`")]
ProviderError(String),
#[error("Value Error: `{0}`")]
ValueError(String),
#[error("Protocol Error: `{0}`")]
ProtocolError(String),
}
pub type Result<T> = std::result::Result<T, Error>;
impl From<crypto::Error> for Error {
fn from(e: crypto::Error) -> Self {
Self::CryptoError(e)
}
}