mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 09:21:05 +00:00
[Feature] Sequential migration execution for try-runtime (#12319)
* [Feature] Sequential migration execution for try-runtime * remove unused * guards * reinstate encode/decode * proper feature gate * proper test feature gate * Update frame/support/src/traits/hooks.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * Update frame/support/src/traits/hooks.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * fix tests * redo Tuple tests * Update frame/support/src/traits/hooks.rs Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> * use parameter_types for testing * lint fix * Update frame/support/src/traits/hooks.rs Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com> * Update frame/support/src/traits/hooks.rs Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * eloquent feature gate * redo tests * more fixes * properly handle pre/post errors * remove some tests and fix the others * add format import * import fix * more import fixes Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -287,15 +287,7 @@ where
|
||||
///
|
||||
/// This should only be used for testing.
|
||||
pub fn try_runtime_upgrade() -> Result<frame_support::weights::Weight, &'static str> {
|
||||
// ensure both `pre_upgrade` and `post_upgrade` won't change the storage root
|
||||
let state = {
|
||||
let _guard = frame_support::StorageNoopGuard::default();
|
||||
<(COnRuntimeUpgrade, AllPalletsWithSystem) as OnRuntimeUpgrade>::pre_upgrade().unwrap()
|
||||
};
|
||||
let weight = Self::execute_on_runtime_upgrade();
|
||||
let _guard = frame_support::StorageNoopGuard::default();
|
||||
<(COnRuntimeUpgrade, AllPalletsWithSystem) as OnRuntimeUpgrade>::post_upgrade(state)
|
||||
.unwrap();
|
||||
Ok(weight)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user