[][src]Function sc_executor::call_in_wasm

pub fn call_in_wasm<HF: HostFunctions>(
    function: &str,
    call_data: &[u8],
    execution_method: WasmExecutionMethod,
    ext: &mut dyn Externalities,
    code: &[u8],
    heap_pages: u64,
    allow_missing_func_imports: bool
) -> Result<Vec<u8>>

Call the given function in the given wasm code.

The signature of function needs to follow the default Substrate function signature.

  • call_data: Will be given as input parameters to function
  • execution_method: The execution method to use.
  • ext: The externalities that should be set while executing the wasm function. If None is given, no externalities will be set.
  • heap_pages: The number of heap pages to allocate.

Returns the Vec<u8> that contains the return value of the function.