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 tea_sdk::define_scope;
use thiserror::Error;
define_scope! {
RuntimeCodec {
GeneralServiceError;
GlueSQLError;
StateGeneralError;
HttpExecutionError;
BondingGeneralError;
DbNotFoundError;
InvalidTransactionContext;
InvalidValidator => InvalidValidator, @Display, @Display;
UpgradeError=> UpgradeError, @Display, @Display;
InvalidTxnRequest;
AsyncCanceled;
}
}
#[derive(Debug, Error)]
pub enum InvalidValidator {
#[error("Invalid validator: {0}")]
Valued(String),
#[error("My validator list is empty")]
Empty,
}
#[derive(Debug, Error)]
pub enum UpgradeError {
#[error("version {0} is not compatible with {1}")]
IncompatibleVersion(String, String),
}