Trait precompile_utils::evm::handle::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§
sourcefn record_db_read<Runtime: Config>(
&mut self,
data_max_encoded_len: usize
) -> Result<(), ExitError>
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.
sourcefn record_log_costs_manual(
&mut self,
topics: usize,
data_len: usize
) -> EvmResult
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.
sourcefn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult
fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult
Record cost of logs.
sourcefn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert
fn check_function_modifier(&self, modifier: FunctionModifier) -> MayRevert
Check that a function call is compatible with the context it is called into.
sourcefn read_u32_selector(&self) -> MayRevert<u32>
fn read_u32_selector(&self) -> MayRevert<u32>
Read the selector from the input data.
sourcefn read_after_selector(&self) -> MayRevert<Reader<'_>>
fn read_after_selector(&self) -> MayRevert<Reader<'_>>
Returns a reader of the input, skipping the selector.
Object Safety§
This trait is not object safe.