Skip to main content

InvalidTxError

Trait InvalidTxError 

pub trait InvalidTxError:
    Error
    + Send
    + Sync
    + Any
    + 'static {
    // Required method
    fn as_invalid_tx_err(&self) -> Option<&InvalidTransaction>;

    // Provided methods
    fn is_nonce_too_low(&self) -> bool { ... }
    fn is_gas_limit_too_high(&self) -> bool { ... }
    fn is_gas_limit_too_low(&self) -> bool { ... }
}
Available on crate feature evm only.
Expand description

Abstraction over transaction validation error.

Required Methods§

fn as_invalid_tx_err(&self) -> Option<&InvalidTransaction>

Returns the underlying InvalidTransaction if any.

This is primarily used for error conversions, e.g. for rpc responses.

Provided Methods§

fn is_nonce_too_low(&self) -> bool

Returns whether the error cause by transaction having a nonce lower than expected.

fn is_gas_limit_too_high(&self) -> bool

Returns whether the error is due to the transaction gas limit being higher than allowed.

fn is_gas_limit_too_low(&self) -> bool

Returns whether the error is due to the transaction gas limit being lower than required.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§