Skip to content
Snippets Groups Projects
Commit a13382f1 authored by Liam Aharon's avatar Liam Aharon Committed by GitHub
Browse files

fix try-on-runtime-upgrade return weight (#14793)

parent 9c531596
Branches
No related merge requests found
......@@ -164,13 +164,13 @@ impl OnRuntimeUpgrade for Tuple {
/// that occur.
#[cfg(feature = "try-runtime")]
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();
for_tuples!(#(
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); },
}
)*);
......@@ -194,7 +194,7 @@ impl OnRuntimeUpgrade for Tuple {
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.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment