From 32f357faab07d65b915dd8cade204e3f54704eab Mon Sep 17 00:00:00 2001 From: Delweng Date: Wed, 4 Sep 2024 19:30:03 +0800 Subject: [PATCH 1/2] fix(inspector): always call selfdestruct if entry is made (#1746) Signed-off-by: jsvisa --- crates/revm/src/inspector/handler_register.rs | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/crates/revm/src/inspector/handler_register.rs b/crates/revm/src/inspector/handler_register.rs index 599ab9fc6a..4f28508f61 100644 --- a/crates/revm/src/inspector/handler_register.rs +++ b/crates/revm/src/inspector/handler_register.rs @@ -67,16 +67,25 @@ pub fn inspector_handle_register>( // 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); + } + _ => {} } }); From bc0017a450cb320f9b0352827cbcfd66e83b5469 Mon Sep 17 00:00:00 2001 From: rakita Date: Wed, 4 Sep 2024 15:31:45 +0200 Subject: [PATCH 2/2] chore: add gitattributes linguist-vendored for tests (#1750) --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..52d3dd69f2 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +tests/** linguist-vendored