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

Commit 020dab3

Browse files
authored
Fix logging (#587)
* Fix logging * Add error info
1 parent 2722c58 commit 020dab3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

substrate/executor/src/native_executor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ fn fetch_cached_runtime_version<'a, E: Externalities<KeccakHasher>>(
6565
.and_then(|v| RuntimeVersion::decode(&mut v.as_slice()));
6666
RuntimePreproc::ValidCode(module, version)
6767
}
68-
Err(_) => RuntimePreproc::InvalidCode,
68+
Err(e) => {
69+
trace!(target: "executor", "Invalid code presented to executor ({:?})", e);
70+
RuntimePreproc::InvalidCode
71+
}
6972
});
7073
match maybe_runtime_preproc {
7174
RuntimePreproc::InvalidCode => Err(ErrorKind::InvalidCode(code.into()).into()),

substrate/state-machine/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ where
370370
};
371371

372372
if (result.is_ok() && wasm_result.is_ok() && result.as_ref().unwrap() == wasm_result.as_ref().unwrap()/* && delta == wasm_delta*/)
373-
|| (result.is_err() && wasm_result.is_err() && format!("{}", result.as_ref().unwrap_err()) == format!("{}", wasm_result.as_ref().unwrap_err()))
373+
|| (result.is_err() && wasm_result.is_err())
374374
{
375375
(result, delta)
376376
} else {

0 commit comments

Comments
 (0)