Refactoring Checkpoint: (WIP)

This commit is contained in:
2025-12-14 10:29:31 +03:00
parent 09735eb97a
commit c89d7cac55
1424 changed files with 6415 additions and 6064 deletions
+4 -4
View File
@@ -785,20 +785,20 @@ pub mod pallet {
/// Kill all storage items with a key that starts with the given prefix.
///
/// **NOTE:** We rely on the Root origin to provide us the number of subkeys under
/// **NOTE:** We rely on the Root origin to provide us the number of pez_subkeys under
/// the prefix we are removing to accurately calculate the weight of this function.
#[pallet::call_index(6)]
#[pallet::weight((
T::SystemWeightInfo::kill_prefix(subkeys.saturating_add(1)),
T::SystemWeightInfo::kill_prefix(pez_subkeys.saturating_add(1)),
DispatchClass::Operational,
))]
pub fn kill_prefix(
origin: OriginFor<T>,
prefix: Key,
subkeys: u32,
pez_subkeys: u32,
) -> DispatchResultWithPostInfo {
ensure_root(origin)?;
let _ = storage::unhashed::clear_prefix(&prefix, Some(subkeys), None);
let _ = storage::unhashed::clear_prefix(&prefix, Some(pez_subkeys), None);
Ok(().into())
}