From eba03961828dfa22460c0ac4322efef826ceb910 Mon Sep 17 00:00:00 2001 From: Zhenghao Lu <54395432+EmisonLu@users.noreply.github.com> Date: Sun, 19 Jun 2022 07:56:48 +0800 Subject: [PATCH] Simplified code using existing APIs (#11702) Signed-off-by: Emison Lu --- substrate/client/executor/wasmtime/src/host.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/substrate/client/executor/wasmtime/src/host.rs b/substrate/client/executor/wasmtime/src/host.rs index 0cb64820fa..b494795ae9 100644 --- a/substrate/client/executor/wasmtime/src/host.rs +++ b/substrate/client/executor/wasmtime/src/host.rs @@ -145,11 +145,7 @@ impl<'a> sp_wasm_interface::FunctionContext for HostContext<'a> { } fn register_panic_error_message(&mut self, message: &str) { - self.caller - .data_mut() - .host_state_mut() - .expect("host state is not empty when calling a function in wasm; qed") - .panic_message = Some(message.to_owned()); + self.host_state_mut().panic_message = Some(message.to_owned()); } }