Skip to content
Commit ef0238dd authored by Alex Pozhylenkov's avatar Alex Pozhylenkov Committed by GitHub
Browse files

CountedNMap implementation (#10621)



* add initial CountedDoubleMap implementation

* extend CountedDoubleMap functionality

* add some traits implementation for CountedStorageDoubleMap

* add basic tests for CountedStorageDoubleMap

* add mutate functions implementation

* add additional tests

* add test_option_query test

* add try_append_decode_len_works, append_decode_len_works tests

* add migrate_keys_works, translate_values tests

* add test_iter_drain_translate test

* add test_metadata test

* add remove_prefix implementation,  add test_iter_drain_prefix test

* update

* refactor PrefixIterator usage

* Fix CI build

* fix storage_ensure_span_are_ok_wrong_gen.rs storage_ensure_span_are_ok_wrong_gen_unnamed.rs

* add counted_nmap implementation

* add tests, fixes

* remove counted double map impl

* fix metadata checks

* update clear func

* fix clear, clear with prefix

* fix set function

* update

* final fix

* Update frame/support/src/storage/types/counted_nmap.rs

Co-authored-by: default avatarAnton <[email protected]>

* Update frame/support/src/storage/types/counted_nmap.rs

Co-authored-by: default avatarAnton <[email protected]>

* Update frame/support/src/storage/types/counted_nmap.rs

Co-authored-by: default avatarAnton <[email protected]>

* fix comments

* fix suggestion

* cargo update

* Relocate impl of Sealed for Ref to module root

* fix StorageEntryMetadata type

* Update frame/support/src/storage/types/nmap.rs

Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>

* removed StorageNMap and StoragePrefixedMap traits impl

* fix tests

* Update frame/support/src/storage/types/counted_nmap.rs

Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>

* extend pallet::storage macro with CountedStorageNMap usage

* fix

* add tests

* fix

* fix

* Add counter_storage_final_key(), map_storage_final_prefix() functions

* update tests

* fix

* fix

* fix

* update tests

* fix fmt

* fix fmt

---------

Co-authored-by: default avatarAnton <[email protected]>
Co-authored-by: default avatarKeith Yeung <[email protected]>
Co-authored-by: default avatarGuillaume Yu Thiolliere <[email protected]>
Co-authored-by: parity-processbot <>
parent 08f680e2
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment