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:
authored and GitHub committed 2023-04-27 18:45:43 +00:00
1 parent b5201fa0ec
commit 82aa16315d
4 files changed
+223 -45

No files matched your search

@@ -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();
})
}