Contracts: Ensure latest migration match pallet_version (#14676)

* Add version check

* fix format

* simplify

* restructure imports

* add version check

* Fix benchmarking

* Rename migrations -> BenchMigrations

* doc

* add more docs

* fix format string

* Update frame/contracts/build.rs

* fix

* add cargo:rerun-if-changed

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
PG Herveou
2023-07-31 16:48:53 +02:00
committed by GitHub
parent fb39893bb3
commit 49816ff4d9
7 changed files with 139 additions and 46 deletions
+1 -6
View File
@@ -186,12 +186,7 @@ pub mod pallet {
use sp_runtime::Perbill;
/// The current storage version.
#[cfg(not(any(test, feature = "runtime-benchmarks")))]
const STORAGE_VERSION: StorageVersion = StorageVersion::new(13);
/// Hard coded storage version for running tests that depend on the current storage version.
#[cfg(any(test, feature = "runtime-benchmarks"))]
const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);
pub(crate) const STORAGE_VERSION: StorageVersion = StorageVersion::new(13);
#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]