[Fix] Try-state feature-gated for BagsList (#13296)

* [Fix] Try-state feature-gated for BagsList

* fix comment

* fix try_state remote-tests

* feature-gate try-state remote test for bags-list

* remove try-state from a migration

* more SortedListProvider fixes

* more fixes

* more fixes to allow do_try_state usage in other crates

* do-try-state for fuzz

* more fixes

* more fixes

* remove feature-flag

* do-try-state

* fix review comments

* Update frame/bags-list/src/mock.rs

Co-authored-by: Anton <anton.kalyaev@gmail.com>

---------

Co-authored-by: parity-processbot <>
Co-authored-by: Anton <anton.kalyaev@gmail.com>
This commit is contained in:
Roman Useinov
2023-02-09 12:47:39 +01:00
committed by GitHub
parent 214d1c0cc3
commit 03e9f43f1d
13 changed files with 46 additions and 30 deletions
@@ -386,7 +386,6 @@ pub mod v8 {
Nominators::<T>::iter().map(|(id, _)| id),
Pallet::<T>::weight_of_fn(),
);
debug_assert_eq!(T::VoterList::try_state(), Ok(()));
StorageVersion::<T>::put(ObsoleteReleases::V8_0_0);
crate::log!(
@@ -1451,9 +1451,11 @@ impl<T: Config> SortedListProvider<T::AccountId> for UseValidatorsMap<T> {
// nothing to do upon regenerate.
0
}
#[cfg(feature = "try-runtime")]
fn try_state() -> Result<(), &'static str> {
Ok(())
}
fn unsafe_clear() {
#[allow(deprecated)]
Validators::<T>::remove_all();
@@ -1525,6 +1527,8 @@ impl<T: Config> SortedListProvider<T::AccountId> for UseNominatorsAndValidatorsM
// nothing to do upon regenerate.
0
}
#[cfg(feature = "try-runtime")]
fn try_state() -> Result<(), &'static str> {
Ok(())
}