Skip to content

Commit

Permalink
Reject TD TX failing EVM execution (#2441)
Browse files Browse the repository at this point in the history
* Reject TD TX failing VM validation

* Wording

* Fix lint
  • Loading branch information
Jouzo authored Sep 12, 2023
1 parent 638d314 commit 6b8b0a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/ain-evm/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ impl<'backend> AinExecutor<'backend> {
}

let (tx_response, receipt) = self.exec(&signed_tx, U256::zero());

if !tx_response.exit_reason.is_succeed() {
return Err(format_err!(
"[apply_queue_tx] Transfer domain failed VM execution {:?}",
tx_response.exit_reason
)
.into());
}
self.commit();

debug!(
Expand Down Expand Up @@ -310,6 +316,13 @@ impl<'backend> AinExecutor<'backend> {
}

let (tx_response, receipt) = self.exec(&signed_tx, U256::zero());
if !tx_response.exit_reason.is_succeed() {
return Err(format_err!(
"[apply_queue_tx] DST20 bridge failed VM execution {:?}",
tx_response.exit_reason
)
.into());
}

self.commit();

Expand Down

0 comments on commit 6b8b0a3

Please sign in to comment.