Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frame/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ impl<T: Config> Pallet<T> {
pub fn remove_account(address: &H160) {
if <AccountCodes<T>>::contains_key(address) {
let account_id = T::AddressMapping::into_account_id(*address);
T::AccountProvider::remove_account(&account_id);
T::AccountProvider::on_account_self_destruct(&account_id);
}

<AccountCodes<T>>::remove(address);
Expand Down Expand Up @@ -1069,7 +1069,7 @@ impl<T: frame_system::Config> AccountProvider for NativeSystemAccountProvider<T>
fn create_account(who: &Self::AccountId) {
let _ = frame_system::Pallet::<T>::inc_sufficients(&who);
}
fn remove_account(who: &Self::AccountId) {
fn on_account_self_destruct(who: &Self::AccountId) {
let _ = frame_system::Pallet::<T>::dec_sufficients(&who);
}
}
Expand Down
6 changes: 3 additions & 3 deletions primitives/evm/src/account_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ pub trait AccountProvider {
///
/// The account associated with new created address EVM.
fn create_account(who: &Self::AccountId);
/// Removes an account from accounts records.
/// A hook on account affected by executing selfdestruct opcode.
///
/// The account associated with removed address from EVM.
fn remove_account(who: &Self::AccountId);
/// The account associated with affected address in EVM.
fn on_account_self_destruct(who: &Self::AccountId);
/// Return current account nonce value.
///
/// Used to represent account basic information in EVM format.
Expand Down