3 votes
Accepted

How to check if a `StorageMap` changed after the last access?

Storage Map does not have a fingerprint of the data inside it, and it would be very expensive to create this. It seems you may want to use a child-trie, which has a very similar API to a Storage Map, ...
Shawn Tabrizi's user avatar
  • 16k
1 vote

Concerns about returning all elements from a `StorageDoubleMap`

There are two functions called iter_prefix and iter_prefix_from in the StorageDoubleMap that can be used for this. The iter_prefix_from takes a previous key and resume iteration at that spot. So each ...
Oliver Tale-Yazdi's user avatar
1 vote

How to select n random keys from a `StorageMap`?

Maybe you need a StorageValue<Vec<(Index, AccountId)>>. let v = StorageValue::get(); let index = v[random % v.len()]; let account_id = v[i]; Or StorageMap<Index, AccountId> + ...
AurevoirXavier's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible