Trait pallet_contracts::migration::MigrationStep
source · pub trait MigrationStep: Codec + MaxEncodedLen + Default {
const VERSION: u16;
// Required methods
fn max_step_weight() -> Weight;
fn step(&mut self) -> (IsFinished, Weight);
// Provided method
fn integrity_test(max_block_weight: Weight) { ... }
}
Expand description
A trait that allows to migrate storage from one version to another.
The migration is done in steps. The migration is finished when
step()
returns IsFinished::Yes
.
Required Associated Constants§
Required Methods§
sourcefn max_step_weight() -> Weight
fn max_step_weight() -> Weight
Returns the maximum weight that can be consumed in a single step.
sourcefn step(&mut self) -> (IsFinished, Weight)
fn step(&mut self) -> (IsFinished, Weight)
Process one step of the migration.
Returns whether the migration is finished and the weight consumed.
Provided Methods§
sourcefn integrity_test(max_block_weight: Weight)
fn integrity_test(max_block_weight: Weight)
Verify that the migration step fits into Cursor
, and that max_step_weight
is not greater
than max_block_weight
.