Compile polkadot-runtime both for Wasm ad native, allowing for testing and direct usage.

This commit is contained in:
Gav
2018-01-09 13:47:28 +01:00
parent 5ab59bb171
commit b104f5e6e4
68 changed files with 98 additions and 23 deletions
+5 -5
View File
@@ -136,7 +136,7 @@ impl_function_executor!(this: FunctionExecutor<'e, E>,
} else { 0 }
} else { 0 }
},
ext_deposit_log(_log_data: *const u8, _log_len: u32) {
ext_deposit_log(_log_data: *const u8, _log_len: u32) => {
unimplemented!()
}
=> <'e, E: Externalities + 'e>
@@ -175,8 +175,8 @@ impl CodeExecutor for WasmExecutor {
let returned = program
.params_with_external("env", &mut fec)
.map(|p| p
.add_argument(I32(offset as u32))
.add_argument(I32(size as u32)))
.add_argument(I32(offset as i32))
.add_argument(I32(size as i32)))
.and_then(|p| module.execute_export(method, p))
.map_err(|_| -> Error { ErrorKind::Runtime.into() })?;
@@ -233,8 +233,8 @@ mod tests {
let returned = program
.params_with_external("env", &mut fec)
.map(|p| p
.add_argument(I32(offset as u32))
.add_argument(I32(size as u32)))
.add_argument(I32(offset as i32))
.add_argument(I32(size as i32)))
.and_then(|p| module.execute_export("test_data_in", p))
.map_err(|_| -> Error { ErrorKind::Runtime.into() }).expect("function should be callable");