Skip to content

Commit

Permalink
fix script verification stop error
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Jan 18, 2024
1 parent 54c36ec commit 246363a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions script/src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1451,10 +1451,7 @@ async fn run_vms_child(
let _ = child_rx.changed().await;
match *child_rx.borrow() {
ChunkCommand::Stop => {
let exit = (
Err(ckb_vm::Error::Unexpected("stopped".to_string())),
cycles,
);
let exit = (Err(ckb_vm::Error::External("stopped".into())), cycles);
let _ = finish_tx.send(exit);
return;
}
Expand Down Expand Up @@ -1517,9 +1514,7 @@ async fn run_vms_child(
_ => {
// other error happened here, for example CyclesExceeded,
// we need to return as verification failed
finish_tx
.send((res, machine.cycles()))
.expect("send finished");
finish_tx.send((res, machine.cycles())).expect("send error");
return;
}
};
Expand Down
2 changes: 1 addition & 1 deletion script/src/verify/tests/ckb_latest/features_since_v2023.rs
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ async fn check_spawn_suspend_shutdown() {
.await;
assert!(res.is_err());
let err = res.unwrap_err().to_string();
assert!(err.contains("VM Internal Error: Unexpected(\"stopped\")"));
assert!(err.contains("VM Internal Error: External(\"stopped\")"));
}

#[test]
Expand Down

0 comments on commit 246363a

Please sign in to comment.