Skip to content

Commit

Permalink
Merge branch 'main' into rkrasiuk/gitattributes
Browse files Browse the repository at this point in the history
  • Loading branch information
rakita committed Sep 4, 2024
2 parents a86534b + bc0017a commit ff5d40a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
assets/** linguist-vendored
documentation/** linguist-vendored
tests/** linguist-vendored
29 changes: 19 additions & 10 deletions crates/revm/src/inspector/handler_register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,25 @@ pub fn inspector_handle_register<DB: Database, EXT: GetInspector<DB>>(
// execute selfdestruct
prev(interpreter, host);
// check if selfdestruct was successful and if journal entry is made.
if let Some(JournalEntry::AccountDestroyed {
address,
target,
had_balance,
..
}) = host.evm.journaled_state.journal.last().unwrap().last()
{
host.external
.get_inspector()
.selfdestruct(*address, *target, *had_balance);
match host.evm.journaled_state.journal.last().unwrap().last() {
Some(JournalEntry::AccountDestroyed {
address,
target,
had_balance,
..
}) => {
host.external
.get_inspector()
.selfdestruct(*address, *target, *had_balance);
}
Some(JournalEntry::BalanceTransfer {
from, to, balance, ..
}) => {
host.external
.get_inspector()
.selfdestruct(*from, *to, *balance);
}
_ => {}
}
});

Expand Down

0 comments on commit ff5d40a

Please sign in to comment.