mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 10:31:04 +00:00
Allow ExistentialDeposit = 0 (#6185)
* Allow ExistentialDeposit = 0 * there are better ways to check is an account exists * fix StorageMapShim * test account events and fix some bugs
This commit is contained in:
@@ -742,12 +742,12 @@ decl_module! {
|
||||
/// No DB Read or Write operations because caller is already in overlay
|
||||
/// # </weight>
|
||||
#[weight = (10_000_000, DispatchClass::Operational)]
|
||||
fn suicide(origin) {
|
||||
pub fn suicide(origin) {
|
||||
let who = ensure_signed(origin)?;
|
||||
let account = Account::<T>::get(&who);
|
||||
ensure!(account.refcount == 0, Error::<T>::NonZeroRefCount);
|
||||
ensure!(account.data == T::AccountData::default(), Error::<T>::NonDefaultComposite);
|
||||
Account::<T>::remove(who);
|
||||
Self::kill_account(&who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1131,6 +1131,15 @@ impl<T: Trait> Module<T> {
|
||||
AllExtrinsicsLen::put(len as u32);
|
||||
}
|
||||
|
||||
/// Reset events. Can be used as an alternative to
|
||||
/// `initialize` for tests that don't need to bother with the other environment entries.
|
||||
#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))]
|
||||
pub fn reset_events() {
|
||||
<Events<T>>::kill();
|
||||
EventCount::kill();
|
||||
<EventTopics<T>>::remove_all();
|
||||
}
|
||||
|
||||
/// Return the chain's current runtime version.
|
||||
pub fn runtime_version() -> RuntimeVersion { T::Version::get() }
|
||||
|
||||
@@ -1222,8 +1231,8 @@ impl<T: Trait> Module<T> {
|
||||
"WARNING: Referenced account deleted. This is probably a bug."
|
||||
);
|
||||
}
|
||||
Module::<T>::on_killed_account(who.clone());
|
||||
}
|
||||
Module::<T>::on_killed_account(who.clone());
|
||||
}
|
||||
|
||||
/// Determine whether or not it is possible to update the code.
|
||||
|
||||
Reference in New Issue
Block a user