Skip to content

Commit f6dd782

Browse files
committed
add calltrace for terminate
1 parent 04da5f5 commit f6dd782

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

substrate/frame/revive/src/exec.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,16 @@ where
17441744
// we do this last as we cannot roll this back
17451745
transaction_meter.terminate(contract_account.clone(), refund);
17461746

1747+
// emit selfdestruct trace
1748+
if_tracing(|t| {
1749+
t.terminate(
1750+
contract_address,
1751+
T::AddressMapper::to_address(&args.beneficiary),
1752+
0, // gas is tracked separately; termination happens at end of call stack
1753+
balance,
1754+
);
1755+
});
1756+
17471757
Ok(())
17481758
};
17491759

@@ -1753,7 +1763,6 @@ where
17531763
with_transaction(|| -> TransactionOutcome<Result<_, DispatchError>> {
17541764
match delete_contract(&args.trie_id, &args.code_hash) {
17551765
Ok(()) => {
1756-
// TODO: emit sucicide trace
17571766
log::trace!(target: LOG_TARGET, "Terminated {contract_address:?}");
17581767
TransactionOutcome::Commit(Ok(()))
17591768
},

0 commit comments

Comments
 (0)