Trait fp_evm::PrecompileHandle
pub trait PrecompileHandle {
// Required methods
fn call(
&mut self,
to: H160,
transfer: Option<Transfer>,
input: Vec<u8>,
gas_limit: Option<u64>,
is_static: bool,
context: &Context
) -> (ExitReason, Vec<u8>);
fn record_cost(&mut self, cost: u64) -> Result<(), ExitError>;
fn record_external_cost(
&mut self,
ref_time: Option<u64>,
proof_size: Option<u64>,
storage_growth: Option<u64>
) -> Result<(), ExitError>;
fn refund_external_cost(
&mut self,
ref_time: Option<u64>,
proof_size: Option<u64>
);
fn remaining_gas(&self) -> u64;
fn log(
&mut self,
address: H160,
topics: Vec<H256>,
data: Vec<u8>
) -> Result<(), ExitError>;
fn code_address(&self) -> H160;
fn input(&self) -> &[u8] ⓘ;
fn context(&self) -> &Context;
fn is_static(&self) -> bool;
fn gas_limit(&self) -> Option<u64>;
}
Expand description
Handle provided to a precompile to interact with the EVM.
Required Methods§
fn call(
&mut self,
to: H160,
transfer: Option<Transfer>,
input: Vec<u8>,
gas_limit: Option<u64>,
is_static: bool,
context: &Context
) -> (ExitReason, Vec<u8>)
fn call( &mut self, to: H160, transfer: Option<Transfer>, input: Vec<u8>, gas_limit: Option<u64>, is_static: bool, context: &Context ) -> (ExitReason, Vec<u8>)
Perform subcall in provided context. Precompile specifies in which context the subcall is executed.
fn record_cost(&mut self, cost: u64) -> Result<(), ExitError>
fn record_cost(&mut self, cost: u64) -> Result<(), ExitError>
Record cost to the Runtime gasometer.
fn record_external_cost(
&mut self,
ref_time: Option<u64>,
proof_size: Option<u64>,
storage_growth: Option<u64>
) -> Result<(), ExitError>
fn record_external_cost( &mut self, ref_time: Option<u64>, proof_size: Option<u64>, storage_growth: Option<u64> ) -> Result<(), ExitError>
Record Substrate specific cost.
fn refund_external_cost(
&mut self,
ref_time: Option<u64>,
proof_size: Option<u64>
)
fn refund_external_cost( &mut self, ref_time: Option<u64>, proof_size: Option<u64> )
Refund Substrate specific cost.
fn remaining_gas(&self) -> u64
fn remaining_gas(&self) -> u64
Retreive the remaining gas.
fn log(
&mut self,
address: H160,
topics: Vec<H256>,
data: Vec<u8>
) -> Result<(), ExitError>
fn log( &mut self, address: H160, topics: Vec<H256>, data: Vec<u8> ) -> Result<(), ExitError>
Record a log.
fn code_address(&self) -> H160
fn code_address(&self) -> H160
Retreive the code address (what is the address of the precompile being called).