Frame remove_all with size limit. (#9106)

* remove prefixed content with limit.

* test match

* factor comment and factor ext limit removal.

* fix benchmark

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
cheme
2021-06-15 15:23:58 +02:00
committed by GitHub
parent 5f0257f3b3
commit 693b39f43b
36 changed files with 312 additions and 239 deletions
+3 -3
View File
@@ -871,7 +871,7 @@ decl_module! {
Founder::<T, I>::kill();
Rules::<T, I>::kill();
Candidates::<T, I>::kill();
SuspendedCandidates::<T, I>::remove_all();
SuspendedCandidates::<T, I>::remove_all(None);
Self::deposit_event(RawEvent::Unfounded(founder));
}
@@ -1402,7 +1402,7 @@ impl<T: Config<I>, I: Instance> Module<T, I> {
}).collect::<Vec<_>>();
// Clean up all votes.
<Votes<T, I>>::remove_all();
<Votes<T, I>>::remove_all(None);
// Reward one of the voters who voted the right way.
if !total_slash.is_zero() {
@@ -1570,7 +1570,7 @@ impl<T: Config<I>, I: Instance> Module<T, I> {
}
// Clean up all votes.
<DefenderVotes<T, I>>::remove_all();
<DefenderVotes<T, I>>::remove_all(None);
}
// Avoid challenging if there's only two members since we never challenge the Head or