[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
+9 -1
View File
@@ -274,6 +274,13 @@ pub mod pallet {
}
}
#[cfg(any(test, feature = "try-runtime", feature = "fuzz"))]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
pub fn do_try_state() -> Result<(), &'static str> {
List::<T, I>::do_try_state()
}
}
impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Move an account from one bag to another, depositing an event on success.
///
@@ -348,8 +355,9 @@ impl<T: Config<I>, I: 'static> SortedListProvider<T::AccountId> for Pallet<T, I>
List::<T, I>::unsafe_regenerate(all, score_of)
}
#[cfg(feature = "try-runtime")]
fn try_state() -> Result<(), &'static str> {
List::<T, I>::try_state()
Self::do_try_state()
}
fn unsafe_clear() {