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 lenght 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.

Object Safety§

This trait is not object safe.

Implementors§