Skip to content

Commit

Permalink
[vm] log the location when prologue error
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar committed Jul 29, 2022
1 parent 6f695fd commit f410bec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions sync/src/block_connector/test_illegal_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ async fn test_verify_consensus_failed() {
}
}

#[stest::test]
#[stest::test(timeout = 120)]
async fn test_verify_new_epoch_block_uncle_should_none_failed() {
let apply_failed = test_verify_uncles_in_old_epoch(true).await;
assert!(apply_failed.is_err());
Expand Down Expand Up @@ -727,7 +727,7 @@ async fn test_verify_uncles_in_old_epoch(begin_epoch: bool) -> Result<Block> {
)
}

#[stest::test]
#[stest::test(timeout = 120)]
async fn test_verify_uncles_in_old_epoch_failed() {
let apply_failed = test_verify_uncles_in_old_epoch(false).await;
assert!(apply_failed.is_err());
Expand All @@ -736,7 +736,7 @@ async fn test_verify_uncles_in_old_epoch_failed() {
}
}

#[stest::test]
#[stest::test(timeout = 120)]
async fn test_verify_uncles_uncle_exist_failed() {
let count = 5;
let (uncle_header, mut writeable_block_chain_service, node_config, storage) =
Expand Down Expand Up @@ -860,7 +860,7 @@ async fn test_verify_uncle_and_parent_number_failed() {
}
}

#[stest::test]
#[stest::test(timeout = 120)]
async fn test_verify_uncle_which_parent_is_end_block_in_last_epoch() {
let count = G_TEST_CONFIG.consensus_config.epoch_block_count;
let (uncle_header, mut writeable_block_chain_service, node_config, storage) =
Expand Down
6 changes: 3 additions & 3 deletions vm/vm-runtime/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn convert_prologue_runtime_error(error: VMError) -> Result<(), VMStatus> {
let status = error.into_vm_status();
Err(match status {
VMStatus::Executed => VMStatus::Executed,
VMStatus::MoveAbort(_location, code) => {
VMStatus::MoveAbort(location, code) => {
let (category, reason) = error_split(code);
let new_major_status = match (category, reason) {
(REQUIRES_ADDRESS, PROLOGUE_ACCOUNT_DOES_NOT_EXIST) => {
Expand Down Expand Up @@ -88,8 +88,8 @@ pub fn convert_prologue_runtime_error(error: VMError) -> Result<(), VMStatus> {
}
(category, reason) => {
warn!(
"prologue runtime unknown: category({}), reason:({})",
category, reason
"prologue runtime unknown: category({}), reason:({}), location:({})",
category, reason, location
);
StatusCode::UNEXPECTED_ERROR_FROM_KNOWN_MOVE_FUNCTION
}
Expand Down

0 comments on commit f410bec

Please sign in to comment.