mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Execute try-state at end of each test to ensure pallet data integrity (#12453)
* execute try-state at end of tests * run post condition only with try runtime * Revert "run post condition only with try runtime" This reverts commit 7db0ecf7eaa2ee5afa5a995487b73d023ba3bcd9. * voterlist contains validators as well * fmt * simplify * fmt Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -1552,11 +1552,12 @@ impl<T: Config> StakingInterface for Pallet<T> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
#[cfg(any(test, feature = "try-runtime"))]
|
||||
impl<T: Config> Pallet<T> {
|
||||
pub(crate) fn do_try_state(_: BlockNumberFor<T>) -> Result<(), &'static str> {
|
||||
ensure!(
|
||||
T::VoterList::iter().all(|x| <Nominators<T>>::contains_key(&x)),
|
||||
T::VoterList::iter()
|
||||
.all(|x| <Nominators<T>>::contains_key(&x) || <Validators<T>>::contains_key(&x)),
|
||||
"VoterList contains non-nominators"
|
||||
);
|
||||
T::VoterList::try_state()?;
|
||||
|
||||
Reference in New Issue
Block a user