Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Poc-1 version compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
arkpar committed Jul 5, 2018
1 parent 6513705 commit 5d0fbdd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions substrate/executor/src/native_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ impl<D: NativeExecutionDispatch + Sync + Send> CodeExecutor for NativeExecutor<D
let wasm_module = WasmModule::from_buffer(code)
.expect("all modules compiled with rustc are valid wasm code; qed");

// Missing version export is allowed in Poc-2 for Poc-1 compatibility.
// TODO: return an error on missing version.
if WasmExecutor.call_in_wasm_module(ext, &wasm_module, "version", &[]).ok()
.and_then(|version| RuntimeVersion::decode(&mut version.as_slice()))
.map_or(false, |v| D::VERSION.can_call_with(&v))
Expand Down

0 comments on commit 5d0fbdd

Please sign in to comment.