mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 11:21:07 +00:00
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:
@@ -615,7 +615,17 @@ impl ExtBuilder {
|
||||
}
|
||||
|
||||
pub fn build_and_execute(self, test: impl FnOnce() -> ()) {
|
||||
self.build().execute_with(test)
|
||||
sp_tracing::try_init_simple();
|
||||
|
||||
let mut ext = self.build();
|
||||
ext.execute_with(test);
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
ext.execute_with(|| {
|
||||
assert_ok!(<MultiPhase as frame_support::traits::Hooks<u64>>::try_state(
|
||||
System::block_number()
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user