Implements try_state hook in elections and EPM pallets (#13979)

* Adds try_state hook to elections pallets

* Addresses PR review comments

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>

* remove unecessary println

* ensures try-runtime does not mutate storage

* Addresses PR comments

* Fixes snapshot invariant checks; simplifies test infra

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: parity-processbot <>
This commit is contained in:
Gonçalo Pestana
2023-04-27 19:45:43 +01:00
committed by GitHub
parent b5201fa0ec
commit 82aa16315d
4 changed files with 223 additions and 45 deletions
@@ -554,6 +554,11 @@ mod tests {
MultiPhase::submit(RuntimeOrigin::signed(10), Box::new(solution)),
Error::<Runtime>::PreDispatchEarlySubmission,
);
// make sure invariants hold true and post-test try state checks to pass.
<crate::Snapshot<Runtime>>::kill();
<crate::SnapshotMetadata<Runtime>>::kill();
<crate::DesiredTargets<Runtime>>::kill();
})
}