[][src]Trait sp_core::traits::CallInWasm

pub trait CallInWasm: Send + Sync {
    fn call_in_wasm(
        &self,
        wasm_code: &[u8],
        code_hash: Option<Vec<u8>>,
        method: &str,
        call_data: &[u8],
        ext: &mut dyn Externalities,
        missing_host_functions: MissingHostFunctions
    ) -> Result<Vec<u8>, String>; }

Something that can call a method in a WASM blob.

Required methods

fn call_in_wasm(
    &self,
    wasm_code: &[u8],
    code_hash: Option<Vec<u8>>,
    method: &str,
    call_data: &[u8],
    ext: &mut dyn Externalities,
    missing_host_functions: MissingHostFunctions
) -> Result<Vec<u8>, String>

Call the given method in the given wasm_blob using call_data (SCALE encoded arguments) to decode the arguments for the method.

Returns the SCALE encoded return value of the method.

Note

If code_hash is Some(_) the wasm_code module and instance will be cached internally, otherwise it is thrown away after the call.

Loading content...

Implementors

Loading content...