Skip to main content

call_eth_precompile

Function call_eth_precompile 

pub fn call_eth_precompile(
    f: fn(&[u8], u64) -> Result<EthPrecompileOutput, PrecompileHalt>,
    input: &[u8],
    gas_limit: u64,
    reservoir: u64,
) -> PrecompileOutput
Expand description

Calls a PrecompileEthFn and wraps the result into a PrecompileOutput.

Use this in wrapper functions to adapt an eth precompile to the PrecompileFn signature:

fn my_precompile(input: &[u8], gas_limit: u64, reservoir: u64) -> PrecompileOutput {
    call_eth_precompile(my_eth_fn, input, gas_limit, reservoir)
}