Skip to main content

Questions tagged [iteration]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

Batch insert into StorageMap without iterations

Is there a way to do batch inset operation into a StorageMap without iteration or using a Vec[] type or best workarounds. and if its not whats the reason for not supporting this? For example there's a ...
Rehan's user avatar
  • 167
1 vote
1 answer
46 views

Concerns about returning all elements from a `StorageDoubleMap`

I defined a storage item as StorageDoubleMap, and I need to provide a method that returns the list of elements with the first key (k1). This getter method has to be provided by the pallet. I found a ...
magecnion's user avatar
  • 394
1 vote
1 answer
70 views

Iterating on a storage from Offchain Worker Concerns

I have a StorageMap named PublicKeyToMsaId which has around 300K inserted items and I want to iterate on all of those keys-values in offchain-worker to create a reverse map in offchain storage. To ...
Aramik M's user avatar
  • 161
3 votes
2 answers
37 views

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

I am currently trying to iterate over a storage map over multiple blocks. For this I need to ensure that the StorageMap was not modified. My plan is to derive a hash from the current StorageMap and ...
Chralt's user avatar
  • 543
2 votes
1 answer
57 views

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

Assume I have the following storage map: ZAccounts: StorageMap(AccountId -> AccountInfoOf<T>) Is there a simple way to draw n AccountId's randomly. I assume that I already have a secure ...
Chralt's user avatar
  • 543