Simplified code using existing APIs (#11702)

Signed-off-by: Emison Lu <lzh1633856298@gmail.com>
This commit is contained in:
Zhenghao Lu
2022-06-19 07:56:48 +08:00
committed by GitHub
parent 440a6db939
commit eba0396182
@@ -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());
}
}