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
use ckb_error::{prelude::*, Error, ErrorKind};
use ckb_types::packed::Byte32;
#[derive(Error, Debug, Clone, Eq, PartialEq)]
pub enum SpecError {
#[error("FileNotFound")]
FileNotFound(String),
#[error("ChainNameNotAllowed: {0}")]
ChainNameNotAllowed(String),
#[error("GenesisMismatch(expected: {expected}, actual: {actual})")]
GenesisMismatch {
expected: Byte32,
actual: Byte32,
},
}
impl From<SpecError> for Error {
fn from(error: SpecError) -> Self {
ErrorKind::Spec.because(error)
}
}