spaces to tabs.
This commit is contained in:
parent
9798e3c45a
commit
3e4e00fc6a
@ -627,30 +627,30 @@ impl<'a, 'b> Runtime<'a, 'b> {
|
|||||||
fn user_panic(&mut self, context: InterpreterCallerContext)
|
fn user_panic(&mut self, context: InterpreterCallerContext)
|
||||||
-> Result<Option<interpreter::RuntimeValue>, InterpreterError>
|
-> Result<Option<interpreter::RuntimeValue>, InterpreterError>
|
||||||
{
|
{
|
||||||
let payload_len = context.value_stack.pop_as::<i32>()? as u32;
|
let payload_len = context.value_stack.pop_as::<i32>()? as u32;
|
||||||
let payload_ptr = context.value_stack.pop_as::<i32>()? as u32;
|
let payload_ptr = context.value_stack.pop_as::<i32>()? as u32;
|
||||||
|
|
||||||
let raw_payload = self.memory.get(payload_ptr, payload_len as usize)?;
|
let raw_payload = self.memory.get(payload_ptr, payload_len as usize)?;
|
||||||
let payload = panic_payload::decode(&raw_payload);
|
let payload = panic_payload::decode(&raw_payload);
|
||||||
let msg = format!(
|
let msg = format!(
|
||||||
"{msg}, {file}:{line}:{col}",
|
"{msg}, {file}:{line}:{col}",
|
||||||
msg = payload
|
msg = payload
|
||||||
.msg
|
.msg
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(String::as_ref)
|
.map(String::as_ref)
|
||||||
.unwrap_or("<msg was stripped>"),
|
.unwrap_or("<msg was stripped>"),
|
||||||
file = payload
|
file = payload
|
||||||
.file
|
.file
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(String::as_ref)
|
.map(String::as_ref)
|
||||||
.unwrap_or("<unknown>"),
|
.unwrap_or("<unknown>"),
|
||||||
line = payload.line.unwrap_or(0),
|
line = payload.line.unwrap_or(0),
|
||||||
col = payload.col.unwrap_or(0)
|
col = payload.col.unwrap_or(0)
|
||||||
);
|
);
|
||||||
trace!(target: "wasm", "Contract custom panic message: {}", msg);
|
trace!(target: "wasm", "Contract custom panic message: {}", msg);
|
||||||
|
|
||||||
Err(UserTrap::Panic(msg).into())
|
Err(UserTrap::Panic(msg).into())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn block_hash(&mut self, context: InterpreterCallerContext)
|
fn block_hash(&mut self, context: InterpreterCallerContext)
|
||||||
-> Result<Option<interpreter::RuntimeValue>, InterpreterError>
|
-> Result<Option<interpreter::RuntimeValue>, InterpreterError>
|
||||||
|
Loading…
Reference in New Issue
Block a user