Skip to content

Commit 53de160

Browse files
Rename remove_account to on_account_self_destruct at AccountProvider interface (#155)
1 parent df44931 commit 53de160

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

frame/evm/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ impl<T: Config> Pallet<T> {
794794
pub fn remove_account(address: &H160) {
795795
if <AccountCodes<T>>::contains_key(address) {
796796
let account_id = T::AddressMapping::into_account_id(*address);
797-
T::AccountProvider::remove_account(&account_id);
797+
T::AccountProvider::on_account_self_destruct(&account_id);
798798
}
799799

800800
<AccountCodes<T>>::remove(address);
@@ -1069,7 +1069,7 @@ impl<T: frame_system::Config> AccountProvider for NativeSystemAccountProvider<T>
10691069
fn create_account(who: &Self::AccountId) {
10701070
let _ = frame_system::Pallet::<T>::inc_sufficients(&who);
10711071
}
1072-
fn remove_account(who: &Self::AccountId) {
1072+
fn on_account_self_destruct(who: &Self::AccountId) {
10731073
let _ = frame_system::Pallet::<T>::dec_sufficients(&who);
10741074
}
10751075
}

primitives/evm/src/account_provider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ pub trait AccountProvider {
2626
///
2727
/// The account associated with new created address EVM.
2828
fn create_account(who: &Self::AccountId);
29-
/// Removes an account from accounts records.
29+
/// A hook on account affected by executing selfdestruct opcode.
3030
///
31-
/// The account associated with removed address from EVM.
32-
fn remove_account(who: &Self::AccountId);
31+
/// The account associated with affected address in EVM.
32+
fn on_account_self_destruct(who: &Self::AccountId);
3333
/// Return current account nonce value.
3434
///
3535
/// Used to represent account basic information in EVM format.

0 commit comments

Comments
 (0)