From 3ed164ec5dc80628b934b8709b5e8c4459aa79b3 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Tue, 29 Oct 2024 16:03:14 +0800 Subject: [PATCH] let ckb_vm::Error::External("stopped") return ErrorKind::Internal instead of ErrorKind::Script --- script/src/error.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/src/error.rs b/script/src/error.rs index cac50b738d..633843196b 100644 --- a/script/src/error.rs +++ b/script/src/error.rs @@ -182,7 +182,13 @@ impl ScriptError { impl From for Error { fn from(error: TransactionScriptError) -> Self { - ErrorKind::Script.because(error) + // check error.cause is ScriptError::Other("stopped")? + match error.cause { + ScriptError::Other(ref reason) if reason == "stopped" => { + ErrorKind::Internal.because(error) + } + _ => ErrorKind::Script.because(error), + } } }