zksync_error/
lib.rs

1//
2// AUTOGENERATED BASED ON A SET OF JSON FILES, DO NOT EDIT MANUALLY
3//
4#![allow(non_camel_case_types)]
5#![allow(unused)]
6pub mod documentation;
7pub(crate) mod error;
8pub use error::CustomErrorMessage;
9pub use error::ICustomError;
10pub use error::IError;
11pub use error::IUnifiedError;
12pub use error::NamedError;
13pub(crate) mod identifier;
14pub use identifier::Identifier;
15pub use identifier::Identifying;
16pub use identifier::StructuredErrorCode;
17pub(crate) mod kind;
18pub use kind::Kind;
19pub mod packed;
20pub mod serialized;
21pub mod untyped;
22pub use crate::error::domains::ZksyncError;
23pub mod anvil_zksync {
24    pub use crate::error::domains::AnvilZksync as AnvilZksyncError;
25    pub use crate::error::domains::AnvilZksyncCode;
26    pub mod env {
27        pub use crate::error::definitions::AnvilEnvironment as AnvilEnvironmentError;
28        pub type AnvilEnvironmentResult<T> = core::result::Result<T, AnvilEnvironmentError>;
29        pub use crate::error::definitions::AnvilEnvironment::GenericError;
30        pub use crate::error::definitions::AnvilEnvironment::InvalidArguments;
31        pub use crate::error::definitions::AnvilEnvironment::LogFileAccessFailed;
32        pub use crate::error::definitions::AnvilEnvironment::LogFileWriteFailed;
33        pub use crate::error::definitions::AnvilEnvironment::ServerStartupFailed;
34        pub use crate::error::definitions::AnvilEnvironmentCode as ErrorCode;
35        #[macro_export]
36        macro_rules ! anvil_zksync_env_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: env :: AnvilEnvironmentError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
37        pub use crate::anvil_zksync_env_generic_error as generic_error;
38        pub fn to_generic<T: std::fmt::Display>(err: T) -> AnvilEnvironmentError {
39            GenericError {
40                message: err.to_string(),
41            }
42        }
43        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::AnvilZksyncError {
44            super::AnvilZksyncError::AnvilEnvironment(GenericError {
45                message: err.to_string(),
46            })
47        }
48    }
49    pub mod gen {
50        pub use crate::error::definitions::AnvilGeneric as AnvilGenericError;
51        pub type AnvilGenericResult<T> = core::result::Result<T, AnvilGenericError>;
52        pub use crate::error::definitions::AnvilGeneric::GenericError;
53        pub use crate::error::definitions::AnvilGenericCode as ErrorCode;
54        #[macro_export]
55        macro_rules ! anvil_zksync_gen_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: gen :: AnvilGenericError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
56        pub use crate::anvil_zksync_gen_generic_error as generic_error;
57        pub fn to_generic<T: std::fmt::Display>(err: T) -> AnvilGenericError {
58            GenericError {
59                message: err.to_string(),
60            }
61        }
62        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::AnvilZksyncError {
63            super::AnvilZksyncError::AnvilGeneric(GenericError {
64                message: err.to_string(),
65            })
66        }
67    }
68    pub mod node {
69        pub use crate::error::definitions::AnvilNode as AnvilNodeError;
70        pub type AnvilNodeResult<T> = core::result::Result<T, AnvilNodeError>;
71        pub use crate::error::definitions::AnvilNode::GenericError;
72        pub use crate::error::definitions::AnvilNode::TimestampBackwardsError;
73        pub use crate::error::definitions::AnvilNode::TransactionHalt;
74        pub use crate::error::definitions::AnvilNode::TransactionValidationFailed;
75        pub use crate::error::definitions::AnvilNodeCode as ErrorCode;
76        #[macro_export]
77        macro_rules ! anvil_zksync_node_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: node :: AnvilNodeError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
78        pub use crate::anvil_zksync_node_generic_error as generic_error;
79        pub fn to_generic<T: std::fmt::Display>(err: T) -> AnvilNodeError {
80            GenericError {
81                message: err.to_string(),
82            }
83        }
84        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::AnvilZksyncError {
85            super::AnvilZksyncError::AnvilNode(GenericError {
86                message: err.to_string(),
87            })
88        }
89    }
90    pub mod halt {
91        pub use crate::error::definitions::Halt as HaltError;
92        pub type HaltResult<T> = core::result::Result<T, HaltError>;
93        pub use crate::error::definitions::Halt::BootloaderOutOfGas;
94        pub use crate::error::definitions::Halt::FailedBlockTimestampAssertion;
95        pub use crate::error::definitions::Halt::FailedToAppendTransactionToL2Block;
96        pub use crate::error::definitions::Halt::FailedToChargeFee;
97        pub use crate::error::definitions::Halt::FailedToMarkFactoryDependencies;
98        pub use crate::error::definitions::Halt::FailedToPublishCompressedBytecodes;
99        pub use crate::error::definitions::Halt::FailedToSetL2Block;
100        pub use crate::error::definitions::Halt::FromIsNotAnAccount;
101        pub use crate::error::definitions::Halt::GenericError;
102        pub use crate::error::definitions::Halt::InnerTxError;
103        pub use crate::error::definitions::Halt::MissingInvocationLimitReached;
104        pub use crate::error::definitions::Halt::NotEnoughGasProvided;
105        pub use crate::error::definitions::Halt::PayForTxFailed;
106        pub use crate::error::definitions::Halt::PaymasterValidationFailed;
107        pub use crate::error::definitions::Halt::PrePaymasterPreparationFailed;
108        pub use crate::error::definitions::Halt::TooBigGasLimit;
109        pub use crate::error::definitions::Halt::TracerCustom;
110        pub use crate::error::definitions::Halt::UnexpectedVMBehavior;
111        pub use crate::error::definitions::Halt::Unknown;
112        pub use crate::error::definitions::Halt::VMPanic;
113        pub use crate::error::definitions::Halt::ValidationFailed;
114        pub use crate::error::definitions::Halt::ValidationOutOfGas;
115        pub use crate::error::definitions::HaltCode as ErrorCode;
116        #[macro_export]
117        macro_rules ! anvil_zksync_halt_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: halt :: HaltError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
118        pub use crate::anvil_zksync_halt_generic_error as generic_error;
119        pub fn to_generic<T: std::fmt::Display>(err: T) -> HaltError {
120            GenericError {
121                message: err.to_string(),
122            }
123        }
124        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::AnvilZksyncError {
125            super::AnvilZksyncError::Halt(GenericError {
126                message: err.to_string(),
127            })
128        }
129    }
130    pub mod revert {
131        pub use crate::error::definitions::Revert as RevertError;
132        pub type RevertResult<T> = core::result::Result<T, RevertError>;
133        pub use crate::error::definitions::Revert::General;
134        pub use crate::error::definitions::Revert::GenericError;
135        pub use crate::error::definitions::Revert::InnerTxError;
136        pub use crate::error::definitions::Revert::Unknown;
137        pub use crate::error::definitions::Revert::VmError;
138        pub use crate::error::definitions::RevertCode as ErrorCode;
139        #[macro_export]
140        macro_rules ! anvil_zksync_revert_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: revert :: RevertError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
141        pub use crate::anvil_zksync_revert_generic_error as generic_error;
142        pub fn to_generic<T: std::fmt::Display>(err: T) -> RevertError {
143            GenericError {
144                message: err.to_string(),
145            }
146        }
147        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::AnvilZksyncError {
148            super::AnvilZksyncError::Revert(GenericError {
149                message: err.to_string(),
150            })
151        }
152    }
153    pub mod state {
154        pub use crate::error::definitions::StateLoader as StateLoaderError;
155        pub type StateLoaderResult<T> = core::result::Result<T, StateLoaderError>;
156        pub use crate::error::definitions::StateLoader::GenericError;
157        pub use crate::error::definitions::StateLoader::LoadEmptyState;
158        pub use crate::error::definitions::StateLoader::LoadingStateOverExistingState;
159        pub use crate::error::definitions::StateLoader::StateDecompression;
160        pub use crate::error::definitions::StateLoader::StateDeserialization;
161        pub use crate::error::definitions::StateLoader::StateFileAccess;
162        pub use crate::error::definitions::StateLoader::UnknownStateVersion;
163        pub use crate::error::definitions::StateLoaderCode as ErrorCode;
164        #[macro_export]
165        macro_rules ! anvil_zksync_state_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: state :: StateLoaderError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
166        pub use crate::anvil_zksync_state_generic_error as generic_error;
167        pub fn to_generic<T: std::fmt::Display>(err: T) -> StateLoaderError {
168            GenericError {
169                message: err.to_string(),
170            }
171        }
172        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::AnvilZksyncError {
173            super::AnvilZksyncError::StateLoader(GenericError {
174                message: err.to_string(),
175            })
176        }
177    }
178    pub mod tx_invalid {
179        pub use crate::error::definitions::TransactionValidation as TransactionValidationError;
180        pub type TransactionValidationResult<T> =
181            core::result::Result<T, TransactionValidationError>;
182        pub use crate::error::definitions::TransactionValidation::GasPerPubdataLimit;
183        pub use crate::error::definitions::TransactionValidation::GenericError;
184        pub use crate::error::definitions::TransactionValidation::InvalidGasLimit;
185        pub use crate::error::definitions::TransactionValidation::MaxFeePerGasTooLow;
186        pub use crate::error::definitions::TransactionValidation::MaxPriorityFeeGreaterThanMaxFee;
187        pub use crate::error::definitions::TransactionValidationCode as ErrorCode;
188        #[macro_export]
189        macro_rules ! anvil_zksync_tx_invalid_generic_error { ($ ($ arg : tt) *) => { zksync_error :: anvil_zksync :: tx_invalid :: TransactionValidationError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
190        pub use crate::anvil_zksync_tx_invalid_generic_error as generic_error;
191        pub fn to_generic<T: std::fmt::Display>(err: T) -> TransactionValidationError {
192            GenericError {
193                message: err.to_string(),
194            }
195        }
196        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::AnvilZksyncError {
197            super::AnvilZksyncError::TransactionValidation(GenericError {
198                message: err.to_string(),
199            })
200        }
201    }
202}
203pub mod compiler {
204    pub use crate::error::domains::Compiler as CompilerError;
205    pub use crate::error::domains::CompilerCode;
206    pub mod llvm_evm {
207        pub use crate::error::definitions::LLVM_EVM as LLVM_EVMError;
208        pub type LLVM_EVMResult<T> = core::result::Result<T, LLVM_EVMError>;
209        pub use crate::error::definitions::LLVM_EVMCode as ErrorCode;
210        pub use crate::error::definitions::LLVM_EVM::GenericError;
211        #[macro_export]
212        macro_rules ! compiler_llvm_evm_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: llvm_evm :: LLVM_EVMError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
213        pub use crate::compiler_llvm_evm_generic_error as generic_error;
214        pub fn to_generic<T: std::fmt::Display>(err: T) -> LLVM_EVMError {
215            GenericError {
216                message: err.to_string(),
217            }
218        }
219        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CompilerError {
220            super::CompilerError::LLVM_EVM(GenericError {
221                message: err.to_string(),
222            })
223        }
224    }
225    pub mod llvm_era {
226        pub use crate::error::definitions::LLVM_Era as LLVM_EraError;
227        pub type LLVM_EraResult<T> = core::result::Result<T, LLVM_EraError>;
228        pub use crate::error::definitions::LLVM_Era::GenericError;
229        pub use crate::error::definitions::LLVM_EraCode as ErrorCode;
230        #[macro_export]
231        macro_rules ! compiler_llvm_era_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: llvm_era :: LLVM_EraError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
232        pub use crate::compiler_llvm_era_generic_error as generic_error;
233        pub fn to_generic<T: std::fmt::Display>(err: T) -> LLVM_EraError {
234            GenericError {
235                message: err.to_string(),
236            }
237        }
238        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CompilerError {
239            super::CompilerError::LLVM_Era(GenericError {
240                message: err.to_string(),
241            })
242        }
243    }
244    pub mod solc {
245        pub use crate::error::definitions::Solc as SolcError;
246        pub type SolcResult<T> = core::result::Result<T, SolcError>;
247        pub use crate::error::definitions::Solc::GenericError;
248        pub use crate::error::definitions::SolcCode as ErrorCode;
249        #[macro_export]
250        macro_rules ! compiler_solc_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: solc :: SolcError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
251        pub use crate::compiler_solc_generic_error as generic_error;
252        pub fn to_generic<T: std::fmt::Display>(err: T) -> SolcError {
253            GenericError {
254                message: err.to_string(),
255            }
256        }
257        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CompilerError {
258            super::CompilerError::Solc(GenericError {
259                message: err.to_string(),
260            })
261        }
262    }
263    pub mod solc_fork {
264        pub use crate::error::definitions::SolcFork as SolcForkError;
265        pub type SolcForkResult<T> = core::result::Result<T, SolcForkError>;
266        pub use crate::error::definitions::SolcFork::GenericError;
267        pub use crate::error::definitions::SolcForkCode as ErrorCode;
268        #[macro_export]
269        macro_rules ! compiler_solc_fork_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: solc_fork :: SolcForkError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
270        pub use crate::compiler_solc_fork_generic_error as generic_error;
271        pub fn to_generic<T: std::fmt::Display>(err: T) -> SolcForkError {
272            GenericError {
273                message: err.to_string(),
274            }
275        }
276        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CompilerError {
277            super::CompilerError::SolcFork(GenericError {
278                message: err.to_string(),
279            })
280        }
281    }
282    pub mod zksolc {
283        pub use crate::error::definitions::Zksolc as ZksolcError;
284        pub type ZksolcResult<T> = core::result::Result<T, ZksolcError>;
285        pub use crate::error::definitions::Zksolc::GenericError;
286        pub use crate::error::definitions::ZksolcCode as ErrorCode;
287        #[macro_export]
288        macro_rules ! compiler_zksolc_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: zksolc :: ZksolcError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
289        pub use crate::compiler_zksolc_generic_error as generic_error;
290        pub fn to_generic<T: std::fmt::Display>(err: T) -> ZksolcError {
291            GenericError {
292                message: err.to_string(),
293            }
294        }
295        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CompilerError {
296            super::CompilerError::Zksolc(GenericError {
297                message: err.to_string(),
298            })
299        }
300    }
301    pub mod zkvyper {
302        pub use crate::error::definitions::Zkvyper as ZkvyperError;
303        pub type ZkvyperResult<T> = core::result::Result<T, ZkvyperError>;
304        pub use crate::error::definitions::Zkvyper::GenericError;
305        pub use crate::error::definitions::ZkvyperCode as ErrorCode;
306        #[macro_export]
307        macro_rules ! compiler_zkvyper_generic_error { ($ ($ arg : tt) *) => { zksync_error :: compiler :: zkvyper :: ZkvyperError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
308        pub use crate::compiler_zkvyper_generic_error as generic_error;
309        pub fn to_generic<T: std::fmt::Display>(err: T) -> ZkvyperError {
310            GenericError {
311                message: err.to_string(),
312            }
313        }
314        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CompilerError {
315            super::CompilerError::Zkvyper(GenericError {
316                message: err.to_string(),
317            })
318        }
319    }
320}
321pub mod core {
322    pub use crate::error::domains::Core as CoreError;
323    pub use crate::error::domains::CoreCode;
324    pub mod api {
325        pub use crate::error::definitions::API as APIError;
326        pub type APIResult<T> = core::result::Result<T, APIError>;
327        pub use crate::error::definitions::APICode as ErrorCode;
328        pub use crate::error::definitions::API::GenericError;
329        #[macro_export]
330        macro_rules ! core_api_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: api :: APIError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
331        pub use crate::core_api_generic_error as generic_error;
332        pub fn to_generic<T: std::fmt::Display>(err: T) -> APIError {
333            GenericError {
334                message: err.to_string(),
335            }
336        }
337        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CoreError {
338            super::CoreError::API(GenericError {
339                message: err.to_string(),
340            })
341        }
342    }
343    pub mod eravm {
344        pub use crate::error::definitions::EraVM as EraVMError;
345        pub type EraVMResult<T> = core::result::Result<T, EraVMError>;
346        pub use crate::error::definitions::EraVM::GenericError;
347        pub use crate::error::definitions::EraVMCode as ErrorCode;
348        #[macro_export]
349        macro_rules ! core_eravm_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: eravm :: EraVMError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
350        pub use crate::core_eravm_generic_error as generic_error;
351        pub fn to_generic<T: std::fmt::Display>(err: T) -> EraVMError {
352            GenericError {
353                message: err.to_string(),
354            }
355        }
356        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CoreError {
357            super::CoreError::EraVM(GenericError {
358                message: err.to_string(),
359            })
360        }
361    }
362    pub mod exec {
363        pub use crate::error::definitions::ExecutionPlatform as ExecutionPlatformError;
364        pub type ExecutionPlatformResult<T> = core::result::Result<T, ExecutionPlatformError>;
365        pub use crate::error::definitions::ExecutionPlatform::GenericError;
366        pub use crate::error::definitions::ExecutionPlatformCode as ErrorCode;
367        #[macro_export]
368        macro_rules ! core_exec_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: exec :: ExecutionPlatformError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
369        pub use crate::core_exec_generic_error as generic_error;
370        pub fn to_generic<T: std::fmt::Display>(err: T) -> ExecutionPlatformError {
371            GenericError {
372                message: err.to_string(),
373            }
374        }
375        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CoreError {
376            super::CoreError::ExecutionPlatform(GenericError {
377                message: err.to_string(),
378            })
379        }
380    }
381    pub mod seq {
382        pub use crate::error::definitions::Sequencer as SequencerError;
383        pub type SequencerResult<T> = core::result::Result<T, SequencerError>;
384        pub use crate::error::definitions::Sequencer::GenericError;
385        pub use crate::error::definitions::Sequencer::GenericSequencerError;
386        pub use crate::error::definitions::SequencerCode as ErrorCode;
387        #[macro_export]
388        macro_rules ! core_seq_generic_error { ($ ($ arg : tt) *) => { zksync_error :: core :: seq :: SequencerError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
389        pub use crate::core_seq_generic_error as generic_error;
390        pub fn to_generic<T: std::fmt::Display>(err: T) -> SequencerError {
391            GenericError {
392                message: err.to_string(),
393            }
394        }
395        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::CoreError {
396            super::CoreError::Sequencer(GenericError {
397                message: err.to_string(),
398            })
399        }
400    }
401}
402pub mod foundry {
403    pub use crate::error::domains::Foundry as FoundryError;
404    pub use crate::error::domains::FoundryCode;
405    pub mod upstream {
406        pub use crate::error::definitions::FoundryUpstream as FoundryUpstreamError;
407        pub type FoundryUpstreamResult<T> = core::result::Result<T, FoundryUpstreamError>;
408        pub use crate::error::definitions::FoundryUpstream::GenericError;
409        pub use crate::error::definitions::FoundryUpstreamCode as ErrorCode;
410        #[macro_export]
411        macro_rules ! foundry_upstream_generic_error { ($ ($ arg : tt) *) => { zksync_error :: foundry :: upstream :: FoundryUpstreamError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
412        pub use crate::foundry_upstream_generic_error as generic_error;
413        pub fn to_generic<T: std::fmt::Display>(err: T) -> FoundryUpstreamError {
414            GenericError {
415                message: err.to_string(),
416            }
417        }
418        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::FoundryError {
419            super::FoundryError::FoundryUpstream(GenericError {
420                message: err.to_string(),
421            })
422        }
423    }
424    pub mod zksync {
425        pub use crate::error::definitions::FoundryZksync as FoundryZksyncError;
426        pub type FoundryZksyncResult<T> = core::result::Result<T, FoundryZksyncError>;
427        pub use crate::error::definitions::FoundryZksync::GenericError;
428        pub use crate::error::definitions::FoundryZksyncCode as ErrorCode;
429        #[macro_export]
430        macro_rules ! foundry_zksync_generic_error { ($ ($ arg : tt) *) => { zksync_error :: foundry :: zksync :: FoundryZksyncError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
431        pub use crate::foundry_zksync_generic_error as generic_error;
432        pub fn to_generic<T: std::fmt::Display>(err: T) -> FoundryZksyncError {
433            GenericError {
434                message: err.to_string(),
435            }
436        }
437        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::FoundryError {
438            super::FoundryError::FoundryZksync(GenericError {
439                message: err.to_string(),
440            })
441        }
442    }
443}
444pub mod hardhat {
445    pub use crate::error::domains::Hardhat as HardhatError;
446    pub use crate::error::domains::HardhatCode;
447    pub mod upstream {
448        pub use crate::error::definitions::HardhatUpstream as HardhatUpstreamError;
449        pub type HardhatUpstreamResult<T> = core::result::Result<T, HardhatUpstreamError>;
450        pub use crate::error::definitions::HardhatUpstream::GenericError;
451        pub use crate::error::definitions::HardhatUpstreamCode as ErrorCode;
452        #[macro_export]
453        macro_rules ! hardhat_upstream_generic_error { ($ ($ arg : tt) *) => { zksync_error :: hardhat :: upstream :: HardhatUpstreamError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
454        pub use crate::hardhat_upstream_generic_error as generic_error;
455        pub fn to_generic<T: std::fmt::Display>(err: T) -> HardhatUpstreamError {
456            GenericError {
457                message: err.to_string(),
458            }
459        }
460        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::HardhatError {
461            super::HardhatError::HardhatUpstream(GenericError {
462                message: err.to_string(),
463            })
464        }
465    }
466    pub mod zksync {
467        pub use crate::error::definitions::HardhatZksync as HardhatZksyncError;
468        pub type HardhatZksyncResult<T> = core::result::Result<T, HardhatZksyncError>;
469        pub use crate::error::definitions::HardhatZksync::GenericError;
470        pub use crate::error::definitions::HardhatZksyncCode as ErrorCode;
471        #[macro_export]
472        macro_rules ! hardhat_zksync_generic_error { ($ ($ arg : tt) *) => { zksync_error :: hardhat :: zksync :: HardhatZksyncError :: GenericError { message : format ! ($ ($ arg) *) } } ; }
473        pub use crate::hardhat_zksync_generic_error as generic_error;
474        pub fn to_generic<T: std::fmt::Display>(err: T) -> HardhatZksyncError {
475            GenericError {
476                message: err.to_string(),
477            }
478        }
479        pub fn to_domain<T: std::fmt::Display>(err: T) -> super::HardhatError {
480            super::HardhatError::HardhatZksync(GenericError {
481                message: err.to_string(),
482            })
483        }
484    }
485}