Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
inner doc
  • Loading branch information
gui1117 committed Nov 10, 2021
commit c2f6366503d86b4cd59afe9dfaa23ac4397c84c6
3 changes: 3 additions & 0 deletions frame/support/src/storage/types/counted_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,9 @@ where

/// Remove all value of the storage.
pub fn remove_all() {
// NOTE: it is not possible to remove up to some limit because
// `sp_io::storage::clear_prefix` and `StorageMap::remove_all` don't give the number of
// value removed from the overlay.
CounterFor::<Prefix>::set(0u32);
<Self as MapWrapper>::Map::remove_all(None);
}
Expand Down