Function sp_io::default_child_storage::storage_kill
source · [−]Expand description
Clear a child storage key.
Deletes all keys from the overlay and up to limit
keys from the backend if
it is set to Some
. No limit is applied when limit
is set to None
.
The limit can be used to partially delete a child trie in case it is too large to delete in one go (block).
It returns false iff some keys are remaining in the child trie after the functions returns.
Note
Please note that keys that are residing in the overlay for that child trie when
issuing this call are all deleted without counting towards the limit
. Only keys
written during the current block are part of the overlay. Deleting with a limit
mostly makes sense with an empty overlay for that child trie.
Calling this function multiple times per block for the same storage_key
does
not make much sense because it is not cumulative when called inside the same block.
Use this function to distribute the deletion of a single child trie across multiple
blocks.