mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 08:01:09 +00:00
fix try-on-runtime-upgrade return weight (#14793)
This commit is contained in:
@@ -164,13 +164,13 @@ impl OnRuntimeUpgrade for Tuple {
|
|||||||
/// that occur.
|
/// that occur.
|
||||||
#[cfg(feature = "try-runtime")]
|
#[cfg(feature = "try-runtime")]
|
||||||
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, TryRuntimeError> {
|
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, TryRuntimeError> {
|
||||||
let mut weight = Weight::zero();
|
let mut cumulative_weight = Weight::zero();
|
||||||
|
|
||||||
let mut errors = Vec::new();
|
let mut errors = Vec::new();
|
||||||
|
|
||||||
for_tuples!(#(
|
for_tuples!(#(
|
||||||
match Tuple::try_on_runtime_upgrade(checks) {
|
match Tuple::try_on_runtime_upgrade(checks) {
|
||||||
Ok(weight) => { weight.saturating_add(weight); },
|
Ok(weight) => { cumulative_weight.saturating_accrue(weight); },
|
||||||
Err(err) => { errors.push(err); },
|
Err(err) => { errors.push(err); },
|
||||||
}
|
}
|
||||||
)*);
|
)*);
|
||||||
@@ -194,7 +194,7 @@ impl OnRuntimeUpgrade for Tuple {
|
|||||||
return Err("Detected multiple errors while executing `try_on_runtime_upgrade`, check the logs!".into())
|
return Err("Detected multiple errors while executing `try_on_runtime_upgrade`, check the logs!".into())
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(weight)
|
Ok(cumulative_weight)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [`OnRuntimeUpgrade::pre_upgrade`] should not be used on a tuple.
|
/// [`OnRuntimeUpgrade::pre_upgrade`] should not be used on a tuple.
|
||||||
|
|||||||
Reference in New Issue
Block a user