1#![allow(non_camel_case_types)]
5#![allow(unused)]
6#![allow(clippy::uninlined_format_args)]
7#![doc = r"# Domains"]
8#![doc = "- anvil_zksync"]
9#![doc = " - env"]
10#![doc = " - gen"]
11#![doc = " - node"]
12#![doc = " - gas_estim"]
13#![doc = " - halt"]
14#![doc = " - revert"]
15#![doc = " - state"]
16#![doc = " - tx_invalid"]
17#![doc = "- compiler"]
18#![doc = " - llvm_evm"]
19#![doc = " - llvm_era"]
20#![doc = " - solc"]
21#![doc = " - solc_fork"]
22#![doc = " - zksolc"]
23#![doc = " - zkvyper"]
24#![doc = "- core"]
25#![doc = " - api"]
26#![doc = " - eravm"]
27#![doc = " - exec"]
28#![doc = " - seq"]
29#![doc = "- foundry"]
30#![doc = " - upstream"]
31#![doc = " - zksync"]
32#![doc = "- hardhat"]
33#![doc = " - upstream"]
34#![doc = " - zksync"]
35#![cfg_attr(not(feature = "std"), no_std)]
36#[cfg(not(feature = "std"))]
37extern crate alloc;
38#[cfg(not(feature = "std"))]
39use alloc::format;
40#[cfg(feature = "runtime_documentation")]
41pub mod documentation;
42pub(crate) mod error;
43pub use error::CustomErrorMessage;
44pub use error::ICustomError;
45pub use error::IError;
46pub use error::IUnifiedError;
47pub use error::NamedError;
48pub(crate) mod identifier;
49pub use identifier::Identifier;
50pub use identifier::Identifying;
51pub use identifier::StructuredErrorCode;
52pub(crate) mod kind;
53pub use kind::Kind;
54#[cfg(feature = "packed_errors")]
55pub mod packed;
56#[cfg(feature = "serialized_errors")]
57pub mod serialized;
58#[cfg(feature = "serialized_errors")]
59pub mod untyped;
60pub use crate::error::domains::ZksyncError;
61#[doc = "AnvilZksyncError"]
62#[doc = " - env"]
63#[doc = " - gen"]
64#[doc = " - node"]
65#[doc = " - gas_estim"]
66#[doc = " - halt"]
67#[doc = " - revert"]
68#[doc = " - state"]
69#[doc = " - tx_invalid"]
70pub mod anvil_zksync {
71 pub use crate::error::domains::AnvilZksync as AnvilZksyncError;
72 pub use crate::error::domains::AnvilZksyncCode;
73 #[doc = "# AnvilEnvironment"]
74 #[doc = " - InvalidArguments"]
75 #[doc = " - ServerStartupFailed"]
76 #[doc = " - LogFileAccessFailed"]
77 #[doc = " - LogFileWriteFailed"]
78 #[doc = " - GenericError"]
79 pub mod env {
80 pub use crate::error::definitions::AnvilEnvironment as AnvilEnvironmentError;
81 pub type AnvilEnvironmentResult<T> = core::result::Result<T, AnvilEnvironmentError>;
82 pub use crate::error::definitions::AnvilEnvironment::GenericError;
83 pub use crate::error::definitions::AnvilEnvironment::InvalidArguments;
84 pub use crate::error::definitions::AnvilEnvironment::LogFileAccessFailed;
85 pub use crate::error::definitions::AnvilEnvironment::LogFileWriteFailed;
86 pub use crate::error::definitions::AnvilEnvironment::ServerStartupFailed;
87 pub use crate::error::definitions::AnvilEnvironmentCode as ErrorCode;
88 #[cfg(not(feature = "std"))]
89 use alloc::format;
90 #[macro_export]
91 macro_rules ! anvil_zksync_env_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: env :: AnvilEnvironmentError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
92 pub use crate::anvil_zksync_env_generic_error as generic_error;
93 pub fn to_generic<T: core::fmt::Display>(err: T) -> AnvilEnvironmentError {
94 GenericError {
95 message: format!("{}", err),
96 }
97 }
98 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
99 super::AnvilZksyncError::AnvilEnvironment(GenericError {
100 message: format!("{}", err),
101 })
102 }
103 }
104 #[doc = "# AnvilGeneric"]
105 #[doc = " - GenericError"]
106 pub mod gen {
107 pub use crate::error::definitions::AnvilGeneric as AnvilGenericError;
108 pub type AnvilGenericResult<T> = core::result::Result<T, AnvilGenericError>;
109 pub use crate::error::definitions::AnvilGeneric::GenericError;
110 pub use crate::error::definitions::AnvilGenericCode as ErrorCode;
111 #[cfg(not(feature = "std"))]
112 use alloc::format;
113 #[macro_export]
114 macro_rules ! anvil_zksync_gen_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: gen :: AnvilGenericError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
115 pub use crate::anvil_zksync_gen_generic_error as generic_error;
116 pub fn to_generic<T: core::fmt::Display>(err: T) -> AnvilGenericError {
117 GenericError {
118 message: format!("{}", err),
119 }
120 }
121 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
122 super::AnvilZksyncError::AnvilGeneric(GenericError {
123 message: format!("{}", err),
124 })
125 }
126 }
127 #[doc = "# AnvilNode"]
128 #[doc = " - TransactionHalt"]
129 #[doc = " - TransactionValidationFailed"]
130 #[doc = " - TransactionGasEstimationFailed"]
131 #[doc = " - TimestampBackwardsError"]
132 #[doc = " - SerializationError"]
133 #[doc = " - GenericError"]
134 pub mod node {
135 pub use crate::error::definitions::AnvilNode as AnvilNodeError;
136 pub type AnvilNodeResult<T> = core::result::Result<T, AnvilNodeError>;
137 pub use crate::error::definitions::AnvilNode::GenericError;
138 pub use crate::error::definitions::AnvilNode::SerializationError;
139 pub use crate::error::definitions::AnvilNode::TimestampBackwardsError;
140 pub use crate::error::definitions::AnvilNode::TransactionGasEstimationFailed;
141 pub use crate::error::definitions::AnvilNode::TransactionHalt;
142 pub use crate::error::definitions::AnvilNode::TransactionValidationFailed;
143 pub use crate::error::definitions::AnvilNodeCode as ErrorCode;
144 #[cfg(not(feature = "std"))]
145 use alloc::format;
146 #[macro_export]
147 macro_rules ! anvil_zksync_node_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: node :: AnvilNodeError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
148 pub use crate::anvil_zksync_node_generic_error as generic_error;
149 pub fn to_generic<T: core::fmt::Display>(err: T) -> AnvilNodeError {
150 GenericError {
151 message: format!("{}", err),
152 }
153 }
154 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
155 super::AnvilZksyncError::AnvilNode(GenericError {
156 message: format!("{}", err),
157 })
158 }
159 }
160 #[doc = "# GasEstimation"]
161 #[doc = " - ExceedsLimitForPublishedPubdata"]
162 #[doc = " - ExceedsBlockGasLimit"]
163 #[doc = " - TransactionHalt"]
164 #[doc = " - TransactionRevert"]
165 #[doc = " - TransactionAlwaysHalts"]
166 #[doc = " - TransactionAlwaysReverts"]
167 #[doc = " - GenericError"]
168 pub mod gas_estim {
169 pub use crate::error::definitions::GasEstimation as GasEstimationError;
170 pub type GasEstimationResult<T> = core::result::Result<T, GasEstimationError>;
171 pub use crate::error::definitions::GasEstimation::ExceedsBlockGasLimit;
172 pub use crate::error::definitions::GasEstimation::ExceedsLimitForPublishedPubdata;
173 pub use crate::error::definitions::GasEstimation::GenericError;
174 pub use crate::error::definitions::GasEstimation::TransactionAlwaysHalts;
175 pub use crate::error::definitions::GasEstimation::TransactionAlwaysReverts;
176 pub use crate::error::definitions::GasEstimation::TransactionHalt;
177 pub use crate::error::definitions::GasEstimation::TransactionRevert;
178 pub use crate::error::definitions::GasEstimationCode as ErrorCode;
179 #[cfg(not(feature = "std"))]
180 use alloc::format;
181 #[macro_export]
182 macro_rules ! anvil_zksync_gas_estim_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: gas_estim :: GasEstimationError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
183 pub use crate::anvil_zksync_gas_estim_generic_error as generic_error;
184 pub fn to_generic<T: core::fmt::Display>(err: T) -> GasEstimationError {
185 GenericError {
186 message: format!("{}", err),
187 }
188 }
189 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
190 super::AnvilZksyncError::GasEstimation(GenericError {
191 message: format!("{}", err),
192 })
193 }
194 }
195 #[doc = "# Halt"]
196 #[doc = " - ValidationFailed"]
197 #[doc = " - PaymasterValidationFailed"]
198 #[doc = " - PrePaymasterPreparationFailed"]
199 #[doc = " - PayForTxFailed"]
200 #[doc = " - FailedToMarkFactoryDependencies"]
201 #[doc = " - FailedToChargeFee"]
202 #[doc = " - FromIsNotAnAccount"]
203 #[doc = " - InnerTxError"]
204 #[doc = " - Unknown"]
205 #[doc = " - UnexpectedVMBehavior"]
206 #[doc = " - BootloaderOutOfGas"]
207 #[doc = " - ValidationOutOfGas"]
208 #[doc = " - TooBigGasLimit"]
209 #[doc = " - NotEnoughGasProvided"]
210 #[doc = " - MissingInvocationLimitReached"]
211 #[doc = " - FailedToSetL2Block"]
212 #[doc = " - FailedToAppendTransactionToL2Block"]
213 #[doc = " - VMPanic"]
214 #[doc = " - TracerCustom"]
215 #[doc = " - FailedToPublishCompressedBytecodes"]
216 #[doc = " - FailedBlockTimestampAssertion"]
217 #[doc = " - GenericError"]
218 pub mod halt {
219 pub use crate::error::definitions::Halt as HaltError;
220 pub type HaltResult<T> = core::result::Result<T, HaltError>;
221 pub use crate::error::definitions::Halt::BootloaderOutOfGas;
222 pub use crate::error::definitions::Halt::FailedBlockTimestampAssertion;
223 pub use crate::error::definitions::Halt::FailedToAppendTransactionToL2Block;
224 pub use crate::error::definitions::Halt::FailedToChargeFee;
225 pub use crate::error::definitions::Halt::FailedToMarkFactoryDependencies;
226 pub use crate::error::definitions::Halt::FailedToPublishCompressedBytecodes;
227 pub use crate::error::definitions::Halt::FailedToSetL2Block;
228 pub use crate::error::definitions::Halt::FromIsNotAnAccount;
229 pub use crate::error::definitions::Halt::GenericError;
230 pub use crate::error::definitions::Halt::InnerTxError;
231 pub use crate::error::definitions::Halt::MissingInvocationLimitReached;
232 pub use crate::error::definitions::Halt::NotEnoughGasProvided;
233 pub use crate::error::definitions::Halt::PayForTxFailed;
234 pub use crate::error::definitions::Halt::PaymasterValidationFailed;
235 pub use crate::error::definitions::Halt::PrePaymasterPreparationFailed;
236 pub use crate::error::definitions::Halt::TooBigGasLimit;
237 pub use crate::error::definitions::Halt::TracerCustom;
238 pub use crate::error::definitions::Halt::UnexpectedVMBehavior;
239 pub use crate::error::definitions::Halt::Unknown;
240 pub use crate::error::definitions::Halt::VMPanic;
241 pub use crate::error::definitions::Halt::ValidationFailed;
242 pub use crate::error::definitions::Halt::ValidationOutOfGas;
243 pub use crate::error::definitions::HaltCode as ErrorCode;
244 #[cfg(not(feature = "std"))]
245 use alloc::format;
246 #[macro_export]
247 macro_rules ! anvil_zksync_halt_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: halt :: HaltError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
248 pub use crate::anvil_zksync_halt_generic_error as generic_error;
249 pub fn to_generic<T: core::fmt::Display>(err: T) -> HaltError {
250 GenericError {
251 message: format!("{}", err),
252 }
253 }
254 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
255 super::AnvilZksyncError::Halt(GenericError {
256 message: format!("{}", err),
257 })
258 }
259 }
260 #[doc = "# Revert"]
261 #[doc = " - General"]
262 #[doc = " - InnerTxError"]
263 #[doc = " - VmError"]
264 #[doc = " - Unknown"]
265 #[doc = " - GenericError"]
266 pub mod revert {
267 pub use crate::error::definitions::Revert as RevertError;
268 pub type RevertResult<T> = core::result::Result<T, RevertError>;
269 pub use crate::error::definitions::Revert::General;
270 pub use crate::error::definitions::Revert::GenericError;
271 pub use crate::error::definitions::Revert::InnerTxError;
272 pub use crate::error::definitions::Revert::Unknown;
273 pub use crate::error::definitions::Revert::VmError;
274 pub use crate::error::definitions::RevertCode as ErrorCode;
275 #[cfg(not(feature = "std"))]
276 use alloc::format;
277 #[macro_export]
278 macro_rules ! anvil_zksync_revert_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: revert :: RevertError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
279 pub use crate::anvil_zksync_revert_generic_error as generic_error;
280 pub fn to_generic<T: core::fmt::Display>(err: T) -> RevertError {
281 GenericError {
282 message: format!("{}", err),
283 }
284 }
285 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
286 super::AnvilZksyncError::Revert(GenericError {
287 message: format!("{}", err),
288 })
289 }
290 }
291 #[doc = "# StateLoader"]
292 #[doc = " - LoadingStateOverExistingState"]
293 #[doc = " - LoadEmptyState"]
294 #[doc = " - StateDecompression"]
295 #[doc = " - StateDeserialization"]
296 #[doc = " - UnknownStateVersion"]
297 #[doc = " - StateFileAccess"]
298 #[doc = " - GenericError"]
299 pub mod state {
300 pub use crate::error::definitions::StateLoader as StateLoaderError;
301 pub type StateLoaderResult<T> = core::result::Result<T, StateLoaderError>;
302 pub use crate::error::definitions::StateLoader::GenericError;
303 pub use crate::error::definitions::StateLoader::LoadEmptyState;
304 pub use crate::error::definitions::StateLoader::LoadingStateOverExistingState;
305 pub use crate::error::definitions::StateLoader::StateDecompression;
306 pub use crate::error::definitions::StateLoader::StateDeserialization;
307 pub use crate::error::definitions::StateLoader::StateFileAccess;
308 pub use crate::error::definitions::StateLoader::UnknownStateVersion;
309 pub use crate::error::definitions::StateLoaderCode as ErrorCode;
310 #[cfg(not(feature = "std"))]
311 use alloc::format;
312 #[macro_export]
313 macro_rules ! anvil_zksync_state_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: state :: StateLoaderError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
314 pub use crate::anvil_zksync_state_generic_error as generic_error;
315 pub fn to_generic<T: core::fmt::Display>(err: T) -> StateLoaderError {
316 GenericError {
317 message: format!("{}", err),
318 }
319 }
320 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
321 super::AnvilZksyncError::StateLoader(GenericError {
322 message: format!("{}", err),
323 })
324 }
325 }
326 #[doc = "# TransactionValidation"]
327 #[doc = " - InvalidGasLimit"]
328 #[doc = " - GasPerPubdataLimit"]
329 #[doc = " - MaxFeePerGasTooLow"]
330 #[doc = " - MaxPriorityFeeGreaterThanMaxFee"]
331 #[doc = " - GenericError"]
332 pub mod tx_invalid {
333 pub use crate::error::definitions::TransactionValidation as TransactionValidationError;
334 pub type TransactionValidationResult<T> =
335 core::result::Result<T, TransactionValidationError>;
336 pub use crate::error::definitions::TransactionValidation::GasPerPubdataLimit;
337 pub use crate::error::definitions::TransactionValidation::GenericError;
338 pub use crate::error::definitions::TransactionValidation::InvalidGasLimit;
339 pub use crate::error::definitions::TransactionValidation::MaxFeePerGasTooLow;
340 pub use crate::error::definitions::TransactionValidation::MaxPriorityFeeGreaterThanMaxFee;
341 pub use crate::error::definitions::TransactionValidationCode as ErrorCode;
342 #[cfg(not(feature = "std"))]
343 use alloc::format;
344 #[macro_export]
345 macro_rules ! anvil_zksync_tx_invalid_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: tx_invalid :: TransactionValidationError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
346 pub use crate::anvil_zksync_tx_invalid_generic_error as generic_error;
347 pub fn to_generic<T: core::fmt::Display>(err: T) -> TransactionValidationError {
348 GenericError {
349 message: format!("{}", err),
350 }
351 }
352 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::AnvilZksyncError {
353 super::AnvilZksyncError::TransactionValidation(GenericError {
354 message: format!("{}", err),
355 })
356 }
357 }
358}
359#[doc = "CompilerError"]
360#[doc = " - llvm_evm"]
361#[doc = " - llvm_era"]
362#[doc = " - solc"]
363#[doc = " - solc_fork"]
364#[doc = " - zksolc"]
365#[doc = " - zkvyper"]
366pub mod compiler {
367 pub use crate::error::domains::Compiler as CompilerError;
368 pub use crate::error::domains::CompilerCode;
369 #[doc = "# LLVM_EVM"]
370 #[doc = " - GenericError"]
371 pub mod llvm_evm {
372 pub use crate::error::definitions::LLVM_EVM as LLVM_EVMError;
373 pub type LLVM_EVMResult<T> = core::result::Result<T, LLVM_EVMError>;
374 pub use crate::error::definitions::LLVM_EVMCode as ErrorCode;
375 pub use crate::error::definitions::LLVM_EVM::GenericError;
376 #[cfg(not(feature = "std"))]
377 use alloc::format;
378 #[macro_export]
379 macro_rules ! compiler_llvm_evm_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: llvm_evm :: LLVM_EVMError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
380 pub use crate::compiler_llvm_evm_generic_error as generic_error;
381 pub fn to_generic<T: core::fmt::Display>(err: T) -> LLVM_EVMError {
382 GenericError {
383 message: format!("{}", err),
384 }
385 }
386 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CompilerError {
387 super::CompilerError::LLVM_EVM(GenericError {
388 message: format!("{}", err),
389 })
390 }
391 }
392 #[doc = "# LLVM_Era"]
393 #[doc = " - GenericError"]
394 pub mod llvm_era {
395 pub use crate::error::definitions::LLVM_Era as LLVM_EraError;
396 pub type LLVM_EraResult<T> = core::result::Result<T, LLVM_EraError>;
397 pub use crate::error::definitions::LLVM_Era::GenericError;
398 pub use crate::error::definitions::LLVM_EraCode as ErrorCode;
399 #[cfg(not(feature = "std"))]
400 use alloc::format;
401 #[macro_export]
402 macro_rules ! compiler_llvm_era_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: llvm_era :: LLVM_EraError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
403 pub use crate::compiler_llvm_era_generic_error as generic_error;
404 pub fn to_generic<T: core::fmt::Display>(err: T) -> LLVM_EraError {
405 GenericError {
406 message: format!("{}", err),
407 }
408 }
409 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CompilerError {
410 super::CompilerError::LLVM_Era(GenericError {
411 message: format!("{}", err),
412 })
413 }
414 }
415 #[doc = "# Solc"]
416 #[doc = " - GenericError"]
417 pub mod solc {
418 pub use crate::error::definitions::Solc as SolcError;
419 pub type SolcResult<T> = core::result::Result<T, SolcError>;
420 pub use crate::error::definitions::Solc::GenericError;
421 pub use crate::error::definitions::SolcCode as ErrorCode;
422 #[cfg(not(feature = "std"))]
423 use alloc::format;
424 #[macro_export]
425 macro_rules ! compiler_solc_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: solc :: SolcError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
426 pub use crate::compiler_solc_generic_error as generic_error;
427 pub fn to_generic<T: core::fmt::Display>(err: T) -> SolcError {
428 GenericError {
429 message: format!("{}", err),
430 }
431 }
432 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CompilerError {
433 super::CompilerError::Solc(GenericError {
434 message: format!("{}", err),
435 })
436 }
437 }
438 #[doc = "# SolcFork"]
439 #[doc = " - GenericError"]
440 pub mod solc_fork {
441 pub use crate::error::definitions::SolcFork as SolcForkError;
442 pub type SolcForkResult<T> = core::result::Result<T, SolcForkError>;
443 pub use crate::error::definitions::SolcFork::GenericError;
444 pub use crate::error::definitions::SolcForkCode as ErrorCode;
445 #[cfg(not(feature = "std"))]
446 use alloc::format;
447 #[macro_export]
448 macro_rules ! compiler_solc_fork_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: solc_fork :: SolcForkError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
449 pub use crate::compiler_solc_fork_generic_error as generic_error;
450 pub fn to_generic<T: core::fmt::Display>(err: T) -> SolcForkError {
451 GenericError {
452 message: format!("{}", err),
453 }
454 }
455 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CompilerError {
456 super::CompilerError::SolcFork(GenericError {
457 message: format!("{}", err),
458 })
459 }
460 }
461 #[doc = "# Zksolc"]
462 #[doc = " - GenericError"]
463 pub mod zksolc {
464 pub use crate::error::definitions::Zksolc as ZksolcError;
465 pub type ZksolcResult<T> = core::result::Result<T, ZksolcError>;
466 pub use crate::error::definitions::Zksolc::GenericError;
467 pub use crate::error::definitions::ZksolcCode as ErrorCode;
468 #[cfg(not(feature = "std"))]
469 use alloc::format;
470 #[macro_export]
471 macro_rules ! compiler_zksolc_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: zksolc :: ZksolcError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
472 pub use crate::compiler_zksolc_generic_error as generic_error;
473 pub fn to_generic<T: core::fmt::Display>(err: T) -> ZksolcError {
474 GenericError {
475 message: format!("{}", err),
476 }
477 }
478 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CompilerError {
479 super::CompilerError::Zksolc(GenericError {
480 message: format!("{}", err),
481 })
482 }
483 }
484 #[doc = "# Zkvyper"]
485 #[doc = " - GenericError"]
486 pub mod zkvyper {
487 pub use crate::error::definitions::Zkvyper as ZkvyperError;
488 pub type ZkvyperResult<T> = core::result::Result<T, ZkvyperError>;
489 pub use crate::error::definitions::Zkvyper::GenericError;
490 pub use crate::error::definitions::ZkvyperCode as ErrorCode;
491 #[cfg(not(feature = "std"))]
492 use alloc::format;
493 #[macro_export]
494 macro_rules ! compiler_zkvyper_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: zkvyper :: ZkvyperError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
495 pub use crate::compiler_zkvyper_generic_error as generic_error;
496 pub fn to_generic<T: core::fmt::Display>(err: T) -> ZkvyperError {
497 GenericError {
498 message: format!("{}", err),
499 }
500 }
501 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CompilerError {
502 super::CompilerError::Zkvyper(GenericError {
503 message: format!("{}", err),
504 })
505 }
506 }
507}
508#[doc = "CoreError"]
509#[doc = " - api"]
510#[doc = " - eravm"]
511#[doc = " - exec"]
512#[doc = " - seq"]
513pub mod core {
514 pub use crate::error::domains::Core as CoreError;
515 pub use crate::error::domains::CoreCode;
516 #[doc = "# API"]
517 #[doc = " - GenericError"]
518 pub mod api {
519 pub use crate::error::definitions::API as APIError;
520 pub type APIResult<T> = core::result::Result<T, APIError>;
521 pub use crate::error::definitions::APICode as ErrorCode;
522 pub use crate::error::definitions::API::GenericError;
523 #[cfg(not(feature = "std"))]
524 use alloc::format;
525 #[macro_export]
526 macro_rules ! core_api_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: api :: APIError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
527 pub use crate::core_api_generic_error as generic_error;
528 pub fn to_generic<T: core::fmt::Display>(err: T) -> APIError {
529 GenericError {
530 message: format!("{}", err),
531 }
532 }
533 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CoreError {
534 super::CoreError::API(GenericError {
535 message: format!("{}", err),
536 })
537 }
538 }
539 #[doc = "# EraVM"]
540 #[doc = " - GenericError"]
541 pub mod eravm {
542 pub use crate::error::definitions::EraVM as EraVMError;
543 pub type EraVMResult<T> = core::result::Result<T, EraVMError>;
544 pub use crate::error::definitions::EraVM::GenericError;
545 pub use crate::error::definitions::EraVMCode as ErrorCode;
546 #[cfg(not(feature = "std"))]
547 use alloc::format;
548 #[macro_export]
549 macro_rules ! core_eravm_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: eravm :: EraVMError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
550 pub use crate::core_eravm_generic_error as generic_error;
551 pub fn to_generic<T: core::fmt::Display>(err: T) -> EraVMError {
552 GenericError {
553 message: format!("{}", err),
554 }
555 }
556 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CoreError {
557 super::CoreError::EraVM(GenericError {
558 message: format!("{}", err),
559 })
560 }
561 }
562 #[doc = "# ExecutionPlatform"]
563 #[doc = " - GenericError"]
564 pub mod exec {
565 pub use crate::error::definitions::ExecutionPlatform as ExecutionPlatformError;
566 pub type ExecutionPlatformResult<T> = core::result::Result<T, ExecutionPlatformError>;
567 pub use crate::error::definitions::ExecutionPlatform::GenericError;
568 pub use crate::error::definitions::ExecutionPlatformCode as ErrorCode;
569 #[cfg(not(feature = "std"))]
570 use alloc::format;
571 #[macro_export]
572 macro_rules ! core_exec_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: exec :: ExecutionPlatformError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
573 pub use crate::core_exec_generic_error as generic_error;
574 pub fn to_generic<T: core::fmt::Display>(err: T) -> ExecutionPlatformError {
575 GenericError {
576 message: format!("{}", err),
577 }
578 }
579 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CoreError {
580 super::CoreError::ExecutionPlatform(GenericError {
581 message: format!("{}", err),
582 })
583 }
584 }
585 #[doc = "# Sequencer"]
586 #[doc = " - GenericSequencerError"]
587 #[doc = " - GenericError"]
588 pub mod seq {
589 pub use crate::error::definitions::Sequencer as SequencerError;
590 pub type SequencerResult<T> = core::result::Result<T, SequencerError>;
591 pub use crate::error::definitions::Sequencer::GenericError;
592 pub use crate::error::definitions::Sequencer::GenericSequencerError;
593 pub use crate::error::definitions::SequencerCode as ErrorCode;
594 #[cfg(not(feature = "std"))]
595 use alloc::format;
596 #[macro_export]
597 macro_rules ! core_seq_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: seq :: SequencerError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
598 pub use crate::core_seq_generic_error as generic_error;
599 pub fn to_generic<T: core::fmt::Display>(err: T) -> SequencerError {
600 GenericError {
601 message: format!("{}", err),
602 }
603 }
604 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::CoreError {
605 super::CoreError::Sequencer(GenericError {
606 message: format!("{}", err),
607 })
608 }
609 }
610}
611#[doc = "FoundryError"]
612#[doc = " - upstream"]
613#[doc = " - zksync"]
614pub mod foundry {
615 pub use crate::error::domains::Foundry as FoundryError;
616 pub use crate::error::domains::FoundryCode;
617 #[doc = "# FoundryUpstream"]
618 #[doc = " - GenericError"]
619 pub mod upstream {
620 pub use crate::error::definitions::FoundryUpstream as FoundryUpstreamError;
621 pub type FoundryUpstreamResult<T> = core::result::Result<T, FoundryUpstreamError>;
622 pub use crate::error::definitions::FoundryUpstream::GenericError;
623 pub use crate::error::definitions::FoundryUpstreamCode as ErrorCode;
624 #[cfg(not(feature = "std"))]
625 use alloc::format;
626 #[macro_export]
627 macro_rules ! foundry_upstream_generic_error { ($ ($ arg : tt) *) => { zksync_error :: foundry :: upstream :: FoundryUpstreamError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
628 pub use crate::foundry_upstream_generic_error as generic_error;
629 pub fn to_generic<T: core::fmt::Display>(err: T) -> FoundryUpstreamError {
630 GenericError {
631 message: format!("{}", err),
632 }
633 }
634 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::FoundryError {
635 super::FoundryError::FoundryUpstream(GenericError {
636 message: format!("{}", err),
637 })
638 }
639 }
640 #[doc = "# FoundryZksync"]
641 #[doc = " - GenericError"]
642 pub mod zksync {
643 pub use crate::error::definitions::FoundryZksync as FoundryZksyncError;
644 pub type FoundryZksyncResult<T> = core::result::Result<T, FoundryZksyncError>;
645 pub use crate::error::definitions::FoundryZksync::GenericError;
646 pub use crate::error::definitions::FoundryZksyncCode as ErrorCode;
647 #[cfg(not(feature = "std"))]
648 use alloc::format;
649 #[macro_export]
650 macro_rules ! foundry_zksync_generic_error { ($ ($ arg : tt) *) => { zksync_error :: foundry :: zksync :: FoundryZksyncError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
651 pub use crate::foundry_zksync_generic_error as generic_error;
652 pub fn to_generic<T: core::fmt::Display>(err: T) -> FoundryZksyncError {
653 GenericError {
654 message: format!("{}", err),
655 }
656 }
657 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::FoundryError {
658 super::FoundryError::FoundryZksync(GenericError {
659 message: format!("{}", err),
660 })
661 }
662 }
663}
664#[doc = "HardhatError"]
665#[doc = " - upstream"]
666#[doc = " - zksync"]
667pub mod hardhat {
668 pub use crate::error::domains::Hardhat as HardhatError;
669 pub use crate::error::domains::HardhatCode;
670 #[doc = "# HardhatUpstream"]
671 #[doc = " - GenericError"]
672 pub mod upstream {
673 pub use crate::error::definitions::HardhatUpstream as HardhatUpstreamError;
674 pub type HardhatUpstreamResult<T> = core::result::Result<T, HardhatUpstreamError>;
675 pub use crate::error::definitions::HardhatUpstream::GenericError;
676 pub use crate::error::definitions::HardhatUpstreamCode as ErrorCode;
677 #[cfg(not(feature = "std"))]
678 use alloc::format;
679 #[macro_export]
680 macro_rules ! hardhat_upstream_generic_error { ($ ($ arg : tt) *) => { zksync_error :: hardhat :: upstream :: HardhatUpstreamError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
681 pub use crate::hardhat_upstream_generic_error as generic_error;
682 pub fn to_generic<T: core::fmt::Display>(err: T) -> HardhatUpstreamError {
683 GenericError {
684 message: format!("{}", err),
685 }
686 }
687 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::HardhatError {
688 super::HardhatError::HardhatUpstream(GenericError {
689 message: format!("{}", err),
690 })
691 }
692 }
693 #[doc = "# HardhatZksync"]
694 #[doc = " - GenericError"]
695 pub mod zksync {
696 pub use crate::error::definitions::HardhatZksync as HardhatZksyncError;
697 pub type HardhatZksyncResult<T> = core::result::Result<T, HardhatZksyncError>;
698 pub use crate::error::definitions::HardhatZksync::GenericError;
699 pub use crate::error::definitions::HardhatZksyncCode as ErrorCode;
700 #[cfg(not(feature = "std"))]
701 use alloc::format;
702 #[macro_export]
703 macro_rules ! hardhat_zksync_generic_error { ($ ($ arg : tt) *) => { zksync_error :: hardhat :: zksync :: HardhatZksyncError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
704 pub use crate::hardhat_zksync_generic_error as generic_error;
705 pub fn to_generic<T: core::fmt::Display>(err: T) -> HardhatZksyncError {
706 GenericError {
707 message: format!("{}", err),
708 }
709 }
710 pub fn to_domain<T: core::fmt::Display>(err: T) -> super::HardhatError {
711 super::HardhatError::HardhatZksync(GenericError {
712 message: format!("{}", err),
713 })
714 }
715 }
716}