Skip to content

Commit 02571dd

Browse files
Rename remove_account to on_account_self_destruct at AccountProvider interface (#155)
1 parent 7fdbc1b commit 02571dd

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
@@ -802,7 +802,7 @@ impl<T: Config> Pallet<T> {
802802
pub fn remove_account(address: &H160) {
803803
if <AccountCodes<T>>::contains_key(address) {
804804
let account_id = T::AddressMapping::into_account_id(*address);
805-
T::AccountProvider::remove_account(&account_id);
805+
T::AccountProvider::on_account_self_destruct(&account_id);
806806
}
807807

808808
<AccountCodes<T>>::remove(address);
@@ -1079,7 +1079,7 @@ impl<T: frame_system::Config> AccountProvider for NativeSystemAccountProvider<T>
10791079
fn create_account(who: &Self::AccountId) {
10801080
let _ = frame_system::Pallet::<T>::inc_sufficients(&who);
10811081
}
1082-
fn remove_account(who: &Self::AccountId) {
1082+
fn on_account_self_destruct(who: &Self::AccountId) {
10831083
let _ = frame_system::Pallet::<T>::dec_sufficients(&who);
10841084
}
10851085
}

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)