pub fn instance_and_memory(
    parity_module: Module,
    protocol_version: ProtocolVersion,
    wasm_config: &WasmConfig,
) -> Result<(ModuleRef, MemoryRef), Error> {
    let module = wasmi::Module::from_parity_wasm_module(parity_module)?;
    let resolver = create_module_resolver(protocol_version, wasm_config)?;
    let mut imports = ImportsBuilder::new();
    imports.push_resolver("env", &resolver);
    let not_started_module = ModuleInstance::new(&module, &imports)?;
    if not_started_module.has_start() {
        return Err(Error::UnsupportedWasmStart);
    }
    let instance = not_started_module.not_started_instance().clone();
    let memory = resolver.memory_ref()?;
    Ok((instance, memory))
}
/// Creates an WASM module instance and a memory instance.
///
/// This ensures that a memory instance is properly resolved into a pre-allocated memory area, and a
/// host function resolver is attached to the module.
///
/// The WASM module is also validated to not have a "start" section as we currently don't support
/// running it.
///
/// Both [`ModuleRef`] and a [`MemoryRef`] are ready to be executed.
Creates an WASM module instance and a memory instance.
This ensures that a memory instance is properly resolved into a pre-allocated memory area, and a
host function resolver is attached to the module.

The WASM module is also validated to not have a "start" section as we currently don't support
running it.

Both [`ModuleRef`] and a [`MemoryRef`] are ready to be executed.
Creates an WASM module instance and a memory instance . This ensures that a memory instance is properly resolved into a pre - allocated memory area and a host function resolver is attached to the module . The WASM module is also validated to not have a " start " section as we currently don ' t support running it . Both [ ` ModuleRef ` ] and a [ ` MemoryRef ` ] are ready to be executed .
pub fn instance_and_memory(
    parity_module: Module,
    protocol_version: ProtocolVersion,
    wasm_config: &WasmConfig,
) -> Result<(ModuleRef, MemoryRef), Error> {
    let module = wasmi::Module::from_parity_wasm_module(parity_module)?;
    let resolver = create_module_resolver(protocol_version, wasm_config)?;
    let mut imports = ImportsBuilder::new();
    imports.push_resolver("env", &resolver);
    let not_started_module = ModuleInstance::new(&module, &imports)?;
    if not_started_module.has_start() {
        return Err(Error::UnsupportedWasmStart);
    }
    let instance = not_started_module.not_started_instance().clone();
    let memory = resolver.memory_ref()?;
    Ok((instance, memory))
}
pub fn instance_and_memory ( parity_module : Module , protocol_version : ProtocolVersion , wasm_config : & WasmConfig , ) -> Result < ( ModuleRef , MemoryRef ) , Error > { let module = wasmi :: Module :: from_parity_wasm_module ( parity_module ) ? ; let resolver = create_module_resolver ( protocol_version , wasm_config ) ? ; let mut imports = ImportsBuilder :: new ( ) ; imports . push_resolver ( " " , & resolver ) ; let not_started_module = ModuleInstance :: new ( & module , & imports ) ? ; if not_started_module . has_start ( ) { return Err ( Error :: UnsupportedWasmStart ) ; } let instance = not_started_module . not_started_instance ( ) . clone ( ) ; let memory = resolver . memory_ref ( ) ? ; Ok ( ( instance , memory ) ) }
Creates an WASM module instance and a memory instance.
Creates an WASM module instance and a memory instance .
parity_module
Module
protocol_version
ProtocolVersion
wasm_config
&WasmConfig
parity_module
Module
protocol_version
ProtocolVersion
wasm_config
&WasmConfig