You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Currently Externalities only provides way to clear_prefix and clear_child_prefix which allows to clear all keys with prefix in main trie or a child trie.
In order to do so the current backend does iterate over keys with such prefix and removes them. It would be great to expose a function for_keys_with_prefix(prefix, callback) which would allow to iterate on all keys with prefix in main trie and in child tries.
The main interest is for childtrie, if you could isolate some storage into its child trie you could then iterate on all values in this child trie which can be usefull
Cons
the function fn for_keys_with_prefix(prefix, callback) would need to pass a callback from wasm to native. Which might be unsuitable.
the wasm callback will have to be executed on each value found.
as the only intereset for me is to iterate on all value of a childtrie maybe the solution is actually to have a new externality which is fn all_value which returns all values in vec.