From 518a7b78b30531a90293f680cba40190e7b1c48d Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Thu, 26 Aug 2021 13:46:09 +1200 Subject: [PATCH 1/3] Add migration to karura. --- runtime/karura/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 4412dbcefd..735a561e25 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -1619,6 +1619,15 @@ impl orml_xcm::Config for Runtime { type SovereignOrigin = EnsureRootOrHalfGeneralCouncil; } +pub struct OnRuntimeUpgrade; +impl frame_support::traits::OnRuntimeUpgrade for OnRuntimeUpgrade { + fn on_runtime_upgrade() -> u64 { + frame_support::migrations::migrate_from_pallet_version_to_storage_version::( + &RocksDbWeight::get(), + ) + } +} + #[allow(clippy::large_enum_variant)] construct_runtime!( pub enum Runtime where From df32e78eb071a11d505adb9253375b11b3fce8cd Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Thu, 26 Aug 2021 16:55:57 +1200 Subject: [PATCH 2/3] Add runtime upgrade to executor. --- runtime/karura/src/lib.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index 735a561e25..69b1c3ab50 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -1763,8 +1763,14 @@ pub type SignedPayload = generic::SignedPayload; /// Extrinsic type that has already been checked. pub type CheckedExtrinsic = generic::CheckedExtrinsic; /// Executive: handles dispatch to the various modules. -pub type Executive = - frame_executive::Executive, Runtime, AllPallets, ()>; +pub type Executive = frame_executive::Executive< + Runtime, + Block, + frame_system::ChainContext, + Runtime, + AllPallets, + OnRuntimeUpgrade, +>; #[cfg(not(feature = "disable-runtime-api"))] impl_runtime_apis! { From 3d47e5990c8e91e60a85f27a82cd52b96861a00d Mon Sep 17 00:00:00 2001 From: Shaun Wang Date: Thu, 26 Aug 2021 17:09:47 +1200 Subject: [PATCH 3/3] Add try-runtime to CI. --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c59e922915..6f45f2979b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,3 +60,5 @@ jobs: run: make test-benchmarking - name: Check benchmarks run: make check-benchmarks + - name: Check try-runtime + run: make check-try-runtime