mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
BREAKING - Try-runtime: Use proper error types (#13993)
* Try-state: DispatchResult as return type * try_state for the rest of the pallets * pre_upgrade * post_upgrade * try_runtime_upgrade * fixes * bags-list fix * fix * update test * warning fix * ... * final fixes 🤞 * warning.. * frame-support * warnings * Update frame/staking/src/migrations.rs Co-authored-by: Liam Aharon <liam.aharon@hotmail.com> * fix * fix warning * nit fix * merge fixes * small fix * should be good now * missed these ones * introduce TryRuntimeError and TryRuntimeResult * fixes * fix * removed TryRuntimeResult & made some fixes * fix testsg * tests passing * unnecessary imports * Update frame/assets/src/migration.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> --------- Co-authored-by: Liam Aharon <liam.aharon@hotmail.com> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -137,6 +137,9 @@ use sp_runtime::{
|
||||
};
|
||||
use sp_std::{marker::PhantomData, prelude::*};
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use sp_runtime::TryRuntimeError;
|
||||
|
||||
#[allow(dead_code)]
|
||||
const LOG_TARGET: &str = "runtime::executive";
|
||||
|
||||
@@ -338,7 +341,7 @@ where
|
||||
/// `true`. Also, if set to `true`, it runs the `pre_upgrade` and `post_upgrade` hooks.
|
||||
pub fn try_runtime_upgrade(
|
||||
checks: frame_try_runtime::UpgradeCheckSelect,
|
||||
) -> Result<Weight, &'static str> {
|
||||
) -> Result<Weight, TryRuntimeError> {
|
||||
if checks.try_state() {
|
||||
let _guard = frame_support::StorageNoopGuard::default();
|
||||
<AllPalletsWithSystem as frame_support::traits::TryState<System::BlockNumber>>::try_state(
|
||||
|
||||
Reference in New Issue
Block a user