-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement try_on_runtime_upgrade #13
Conversation
The version in the branch |
what? |
impl<T> OnRuntimeUpgrade for ExecutiveHooks<T>
where
T: Config,
{
fn on_runtime_upgrade() -> Weight {
if Pallet::<T>::maintenance_mode() {
T::MaintenanceExecutiveHooks::on_runtime_upgrade()
} else {
T::NormalExecutiveHooks::on_runtime_upgrade()
}
}
#[cfg(feature = "try-runtime")]
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, TryRuntimeError> {
if Pallet::<T>::maintenance_mode() {
T::MaintenanceExecutiveHooks::try_on_runtime_upgrade(checks)
} else {
T::NormalExecutiveHooks::try_on_runtime_upgrade(checks)
}
}
} |
Oh I see yes we dont need the pre and post hooks now. Why isnt this merged into master if it is in |
Because I have not been aware of this convention (merging each change to master as well). But we had a conversation about this change before. |
In general any change that is not moonbeam specific it should be merged to master |
* implement try_on_runtime_upgrade * fmt * remove pre and post upgrade hooks
Implements
try_on_runtime_upgrade
in pallet migrations. Otherwise after the 1.3.0 upgrade we see the error:panicked at 'called
Result::unwrap()on an
Errvalue: Other("Usage of
pre_upgradewith Tuples is not expected. Please use
try_on_runtime_upgradeinstead, which internally calls
pre_upgrade->
on_runtime_upgrade->
post_upgradefor each tuple member.")