From f3431b1e57276d77bbe75d6f55c3de505b9c42e4 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 6 Jan 2023 21:54:10 +0100 Subject: [PATCH 1/2] Run frame_system integrity tests in Externalities Signed-off-by: Oliver Tale-Yazdi --- frame/system/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index a77d1ca31b50f..4d62a1252c262 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -361,7 +361,9 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn integrity_test() { - T::BlockWeights::get().validate().expect("The weights are invalid."); + sp_io::TestExternalities::default().execute_with(|| { + T::BlockWeights::get().validate().expect("The weights are invalid."); + }); } } From 74983027b602f21a43b72d547e68547b2a0cd2c3 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Sun, 8 Jan 2023 16:41:13 +0100 Subject: [PATCH 2/2] Use feature = 'std' Signed-off-by: Oliver Tale-Yazdi --- frame/system/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index 4d62a1252c262..c790d33adddd7 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -360,6 +360,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { + #[cfg(feature = "std")] fn integrity_test() { sp_io::TestExternalities::default().execute_with(|| { T::BlockWeights::get().validate().expect("The weights are invalid.");