wasmi interpreter (#7796)

This commit is contained in:
Nikolay Volf
2018-02-05 22:59:27 +03:00
committed by Afri Schoedon
parent ebda6d3916
commit fb4582a90e
13 changed files with 960 additions and 1335 deletions

View File

@@ -154,11 +154,7 @@ impl TransactOptions<trace::NoopTracer, trace::NoopVMTracer> {
pub fn executor(machine: &Machine, vm_factory: &Factory, params: &ActionParams) -> Box<vm::Vm> {
if machine.supports_wasm() && params.code.as_ref().map_or(false, |code| code.len() > 4 && &code[0..4] == WASM_MAGIC_NUMBER) {
Box::new(
wasm::WasmInterpreter::new()
// prefer to fail fast
.expect("Failed to create wasm runtime")
)
Box::new(wasm::WasmInterpreter)
} else {
vm_factory.create(params.gas)
}