Trait PrecompileHandleExt

Source
pub trait PrecompileHandleExt: PrecompileHandle {
    // Required methods
    fn record_db_read<Runtime: Config>(
        &mut self,
        data_max_encoded_len: usize,
    ) -> Result<(), ExitError>;
    fn record_log_costs_manual(
        &mut self,
        topics: usize,
        data_len: usize,
    ) -> EvmResult;
    fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult;
    fn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert;
    fn read_u32_selector(&self) -> MayRevert<u32>;
    fn read_after_selector(&self) -> MayRevert<Reader<'_>>;
}

Required Methods§

Source

fn record_db_read<Runtime: Config>( &mut self, data_max_encoded_len: usize, ) -> Result<(), ExitError>

Record cost of one DB read manually. The max encoded length of the data that will be read should be provided.

Source

fn record_log_costs_manual( &mut self, topics: usize, data_len: usize, ) -> EvmResult

Record cost of a log manually. This can be useful to record log costs early when their content have static size.

Source

fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult

Record cost of logs.

Source

fn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert

Check that a function call is compatible with the context it is called into.

Source

fn read_u32_selector(&self) -> MayRevert<u32>

Read the selector from the input data.

Source

fn read_after_selector(&self) -> MayRevert<Reader<'_>>

Returns a reader of the input, skipping the selector.

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§