Move type Migrations to Config (#14309)

* move migrate sequence to config

* remove commented out code

* Update frame/contracts/src/lib.rs

Co-authored-by: PG Herveou <pgherveou@gmail.com>

* remove Migrations generic

* make runtime use noop migrations

* restrict is_upgrade_supported

* undo is_upgrade_supported change

* Update bin/node/runtime/src/lib.rs

Co-authored-by: PG Herveou <pgherveou@gmail.com>

* add rust doc example for `Migrations`

* feature gate NoopMigration

* fix example code

* improve example

---------

Co-authored-by: PG Herveou <pgherveou@gmail.com>
This commit is contained in:
Juan
2023-06-09 13:04:31 +02:00
committed by GitHub
parent 8d51961704
commit 112a0e7352
4 changed files with 81 additions and 76 deletions
+11 -1
View File
@@ -87,12 +87,12 @@ mod address;
mod benchmarking;
mod exec;
mod gas;
mod migration;
mod schedule;
mod storage;
mod wasm;
pub mod chain_extension;
pub mod migration;
pub mod weights;
#[cfg(test)]
@@ -319,6 +319,16 @@ pub mod pallet {
/// The maximum length of the debug buffer in bytes.
#[pallet::constant]
type MaxDebugBufferLen: Get<u32>;
/// The sequence of migration steps that will be applied during a migration.
///
/// # Examples
/// ```
/// use pallet_contracts::migration::{v9, v10, v11};
/// # struct Runtime {};
/// type Migrations = (v9::Migration<Runtime>, v10::Migration<Runtime>, v11::Migration<Runtime>);
/// ```
type Migrations: MigrateSequence;
}
#[pallet::hooks]