Conversation
|
Few things I need help improving here:
|
|
about raised issue, the whole thing is that we would want to get rid of the generator (which were only useful for decl_storage), in order to implement the traits StorageMap directly. some idea were given in another context here #8605 (comment) |
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
| } | ||
|
|
||
| /// Remove all value of the storage. | ||
| pub fn remove_all() { |
There was a problem hiding this comment.
if we want to support limit, then we need sp-io to return the number of deleted key in the overlay, once merged I will open an issue, and we can work on it when we need it.
There was a problem hiding this comment.
Is this not already covered here?
There was a problem hiding this comment.
the new API doesn't say about how many value are removed from the overlay, without this information it is not possible to update the counter efficiently
|
superseeded by #9125 for proper review approvals |
This PR introduces a new Storage abstraction:
CountedStorageMapThe
CountedStorageMapis a simple wrapper around aStorageMapandStorageValue<u32>which keeps count of the number of items in the map by using the value as a counter.