drive_abci/error/
execution.rs1use dpp::bls_signatures::BlsError;
2use dpp::dashcore::consensus::encode::Error as DashCoreConsensusEncodeError;
3use dpp::identity::TimestampMillis;
4use dpp::version::FeatureVersion;
5use drive::error::Error as DriveError;
6
7#[derive(Debug, thiserror::Error)]
10pub enum ExecutionError {
11 #[error("missing required key: {0}")]
13 MissingRequiredKey(&'static str),
14
15 #[error("state not initialized: {0}")]
17 StateNotInitialized(&'static str),
18
19 #[error("overflow error: {0}")]
21 Overflow(&'static str),
22
23 #[error("conversion error: {0}")]
25 Conversion(String),
26
27 #[error("platform corrupted code execution error: {0}")]
29 CorruptedCodeExecution(&'static str),
30
31 #[error("platform corrupted code version mismatch: {0}")]
33 CorruptedCodeVersionMismatch(&'static str),
34
35 #[error("platform unknown version on {method}, received: {received}")]
37 UnknownVersionMismatch {
38 method: String,
40 known_versions: Vec<FeatureVersion>,
42 received: FeatureVersion,
44 },
45
46 #[error("{method} not active for drive version")]
48 VersionNotActive {
49 method: String,
51 known_versions: Vec<FeatureVersion>,
53 },
54
55 #[error("platform corrupted cached state error: {0}")]
57 CorruptedCachedState(String),
58
59 #[error("initialization fork not active: {0}")]
61 InitializationForkNotActive(String),
62
63 #[error("initial height {initial_height} is not chain locked. latest chainlocked height is {chain_lock_height}")]
65 InitializationHeightIsNotLocked {
66 initial_height: u32,
68 chain_lock_height: u32,
70 },
71
72 #[error("genesis time {genesis_time} for initial height {initial_height} is in the future. current time is {current_time}")]
74 InitializationGenesisTimeInFuture {
75 initial_height: u32,
77 genesis_time: TimestampMillis,
79 current_time: TimestampMillis,
81 },
82
83 #[error("initialization error: {0}")]
85 InitializationError(&'static str),
86
87 #[error("drive incoherence error: {0}")]
89 DriveIncoherence(&'static str),
90
91 #[error("protocol upgrade incoherence error: {0}")]
93 ProtocolUpgradeIncoherence(&'static str),
94
95 #[error("drive missing data error: {0}")]
97 DriveMissingData(String),
98
99 #[error("corrupted credits not balanced error: {0}")]
101 CorruptedCreditsNotBalanced(String),
102
103 #[error("corrupted tokens not balanced error: {0}")]
105 CorruptedTokensNotBalanced(String),
106
107 #[error("transaction not present error: {0}")]
109 NotInTransaction(&'static str),
110
111 #[error("cannot update proposed app version: {0}")]
113 UpdateValidatorProposedAppVersionError(#[from] DriveError),
114
115 #[error("corrupted drive response error: {0}")]
117 CorruptedDriveResponse(String),
118
119 #[error("dash core consensus encode error: {0}")]
121 DashCoreConsensusEncodeError(#[from] DashCoreConsensusEncodeError),
122
123 #[error("dash core bad response error: {0}")]
125 DashCoreBadResponseError(String),
126
127 #[error("data trigger execution error: {0}")]
129 DataTriggerExecutionError(String),
130
131 #[error("dash core response bls error: {0}")]
133 BlsErrorFromDashCoreResponse(BlsError),
134
135 #[error("bls error: {0}")]
137 BlsErrorGeneral(#[from] BlsError),
138
139 #[error("io error: {0}")]
141 IOError(#[from] std::io::Error),
142}