Skip to main content

Questions tagged [btreemap]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
46 views

can't use BTreeMap with custom key struct for offchain Local Storage

I'm trying to use sp_std::collections::btree_map::BTreeMap for offchain worker Local Storage. While let foo = StorageValueRef::persistent(b"bar::foo"); foo.get::<BTreeMap<u32, u32>&...
Yury Yukhananov's user avatar
1 vote
1 answer
71 views

How to store a bounded map inside `StorageValue`?

I need to query a specific account id associated with a Balance in a pool of 10_000 account ids. But I also need to iterate over all account ids in a reasonable amount of computation time. So my ...
Chralt's user avatar
  • 543
1 vote
1 answer
53 views

Decode Map keys in call to Struct.toHuman()

I have the following struct, where Characters is the newtype idiom around Vec<u8>. #[derive(Encode, Decode, Clone, PartialEq, Eq, RuntimeDebug)] pub struct OperationData { config: BTreeMap<...
digital illusion's user avatar
4 votes
1 answer
137 views

BTreeMap storage type

I would like to store a large amount of sorted integers, they should be traversable with efficient get and insert. If I can iterate over a storage map, could you let me know how? Or is there a ...
Saman H. Pasha's user avatar