Trait frame_support::traits::OnRuntimeUpgrade
source · pub trait OnRuntimeUpgrade {
fn on_runtime_upgrade() -> Weight { ... }
fn pre_upgrade() -> Result<(), &'static str> { ... }
fn post_upgrade() -> Result<(), &'static str> { ... }
}
Expand description
The runtime upgrade trait.
Implementing this lets you express what should happen when the runtime upgrades, and changes may need to occur to your module.
Provided Methods§
sourcefn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Perform a module upgrade.
Warning
This function will be called before we initialized any runtime state, aka on_initialize
wasn’t called yet. So, information like the block number and any other
block local data are not accessible.
Return the non-negotiable weight consumed for runtime upgrade.
sourcefn pre_upgrade() -> Result<(), &'static str>
fn pre_upgrade() -> Result<(), &'static str>
Execute some pre-checks prior to a runtime upgrade.
This hook is never meant to be executed on-chain but is meant to be used by testing tools.
sourcefn post_upgrade() -> Result<(), &'static str>
fn post_upgrade() -> Result<(), &'static str>
Execute some post-checks after a runtime upgrade.
This hook is never meant to be executed on-chain but is meant to be used by testing tools.