Add ChildTriePrefixIterator and methods (#8478)

* Make use of PrefixIterator underneath Storage[Key]Iterator

* Add ChildTriePrefixIterator and methods

* Add documentation on ChilTriePrefixIterator fields

* Deprecate Storage[Key]Iterator API instead of removing them

* Allow fetching for the prefix as an option for ChildTriePrefixIterator

* Rename prefix_fetch to fetch_previous_key

* fix implementation + test

* make gitdiff better

* Add test for storage_iter and storage_key_iter

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Keith Yeung
2021-04-01 07:20:43 -07:00
committed by GitHub
parent 643d2b669f
commit 1fdc8fa1c1
3 changed files with 307 additions and 5 deletions
+3 -3
View File
@@ -550,13 +550,13 @@ impl<T: Config> Module<T> {
tips: Vec<(AccountId, Balance)>,
}
use frame_support::{Twox64Concat, migration::StorageKeyIterator};
use frame_support::{Twox64Concat, migration::storage_key_iter};
for (hash, old_tip) in StorageKeyIterator::<
for (hash, old_tip) in storage_key_iter::<
T::Hash,
OldOpenTip<T::AccountId, BalanceOf<T>, T::BlockNumber, T::Hash>,
Twox64Concat,
>::new(b"Treasury", b"Tips").drain()
>(b"Treasury", b"Tips").drain()
{
let (finder, deposit, finders_fee) = match old_tip.finder {