revm_handler_interface::precompile_provider

Trait PrecompileProvider

Source
pub trait PrecompileProvider: Clone {
    type Context;
    type Error;

    // Required methods
    fn new(context: &mut Self::Context) -> Self;
    fn run(
        &mut self,
        context: &mut Self::Context,
        address: &Address,
        bytes: &Bytes,
        gas_limit: u64,
    ) -> Result<Option<InterpreterResult>, Self::Error>;
    fn warm_addresses(&self) -> impl Iterator<Item = Address>;
    fn contains(&self, address: &Address) -> bool;
}

Required Associated Types§

Required Methods§

Source

fn new(context: &mut Self::Context) -> Self

Create a new precompile.

Source

fn run( &mut self, context: &mut Self::Context, address: &Address, bytes: &Bytes, gas_limit: u64, ) -> Result<Option<InterpreterResult>, Self::Error>

Run the precompile.

Source

fn warm_addresses(&self) -> impl Iterator<Item = Address>

Get the warm addresses.

Source

fn contains(&self, address: &Address) -> bool

Check if the address is a precompile.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§