mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-18 08:36:08 +00:00
Allow capping the amount of work performed when deleting a child trie (#7671)
* Allow Backend::for_keys_in_child_storage to be aborted by the closure * Ext::kill_child_storage now takes an upper limit for backend deletion * Add Storage::storage_kill_limited() runtime interface * review: Use a new version of kill_storage instead of a new interface * review: Simplify boolean expression Co-authored-by: cheme <emericchevalier.pro@gmail.com> * review: Rename for_keys_in_child_storage Co-authored-by: cheme <emericchevalier.pro@gmail.com>
This commit is contained in:
1 parent
4689c21069
commit
9ce24fe1f4
19 files changed
+219
-34
No files matched your search
@@ -350,13 +350,13 @@ impl<B: BlockT> StateBackend<HashFor<B>> for BenchmarkingState<B> {
|
||||
}
|
||||
}
|
||||
|
||||
fn for_keys_in_child_storage<F: FnMut(&[u8])>(
|
||||
fn apply_to_child_keys_while<F: FnMut(&[u8]) -> bool>(
|
||||
&self,
|
||||
child_info: &ChildInfo,
|
||||
f: F,
|
||||
) {
|
||||
if let Some(ref state) = *self.state.borrow() {
|
||||
state.for_keys_in_child_storage(child_info, f)
|
||||
state.apply_to_child_keys_while(child_info, f)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user