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§

source

const VERSION: u16

Returns the version of the migration.

Required Methods§

source

fn max_step_weight() -> Weight

Returns the maximum weight that can be consumed in a single step.

source

fn step(&mut self) -> (IsFinished, Weight)

Process one step of the migration.

Returns whether the migration is finished and the weight consumed.

Provided Methods§

source

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.

Implementors§

source§

impl<T: Config> MigrationStep for pallet_contracts::migration::v9::Migration<T>

source§

const VERSION: u16 = 9u16

source§

impl<T: Config> MigrationStep for pallet_contracts::migration::v10::Migration<T>

source§

const VERSION: u16 = 10u16

source§

impl<T: Config> MigrationStep for pallet_contracts::migration::v11::Migration<T>

source§

const VERSION: u16 = 11u16

source§

impl<T: Config> MigrationStep for pallet_contracts::migration::v12::Migration<T>

source§

const VERSION: u16 = 12u16