pub enum VMError {
Internal(InternalError),
TxValidation(TxValidationError),
ExceptionalHalt(ExceptionalHalt),
RevertOpcode,
}Variants§
Internal(InternalError)
Errors that break execution, they shouldn’t ever happen. Contains subcategory DatabaseError.
TxValidation(TxValidationError)
Returned when a transaction doesn’t pass all validations before executing.
ExceptionalHalt(ExceptionalHalt)
Errors contemplated by the EVM, they revert and consume all gas of the current context.
RevertOpcode
Revert Opcode called. It behaves like ExceptionalHalt, except it doesn’t consume all gas left.
Implementations§
Source§impl VMError
impl VMError
Sourcepub fn should_propagate(&self) -> bool
pub fn should_propagate(&self) -> bool
These errors are unexpected and indicate critical issues. They should not cause a transaction to revert silently but instead fail loudly, propagating the error.
Sourcepub fn is_revert_opcode(&self) -> bool
pub fn is_revert_opcode(&self) -> bool
Error triggered by revert opcode. This error doesn’t consume all gas left in context.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for VMError
impl<'de> Deserialize<'de> for VMError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for VMError
Source§impl Error for VMError
impl Error for VMError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DatabaseError> for VMError
impl From<DatabaseError> for VMError
Source§fn from(err: DatabaseError) -> Self
fn from(err: DatabaseError) -> Self
Source§impl From<ExceptionalHalt> for VMError
impl From<ExceptionalHalt> for VMError
Source§fn from(source: ExceptionalHalt) -> Self
fn from(source: ExceptionalHalt) -> Self
Source§impl From<InternalError> for VMError
impl From<InternalError> for VMError
Source§fn from(source: InternalError) -> Self
fn from(source: InternalError) -> Self
Source§impl From<PrecompileError> for VMError
impl From<PrecompileError> for VMError
Source§fn from(err: PrecompileError) -> Self
fn from(err: PrecompileError) -> Self
Source§impl From<TryFromSliceError> for VMError
Useful to use ? in try_into, specially when slicing with known bounds to fixed size arrays,
which is a error that never really happens.
impl From<TryFromSliceError> for VMError
Useful to use ? in try_into, specially when slicing with known bounds to fixed size arrays, which is a error that never really happens.
Source§fn from(_: TryFromSliceError) -> Self
fn from(_: TryFromSliceError) -> Self
Source§impl From<TxValidationError> for VMError
impl From<TxValidationError> for VMError
Source§fn from(source: TxValidationError) -> Self
fn from(source: TxValidationError) -> Self
impl StructuralPartialEq for VMError
Auto Trait Implementations§
impl Freeze for VMError
impl RefUnwindSafe for VMError
impl Send for VMError
impl Sync for VMError
impl Unpin for VMError
impl UnsafeUnpin for VMError
impl UnwindSafe for VMError
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.