diff --git a/frame/system/src/lib.rs b/frame/system/src/lib.rs index a77d1ca31b50f..c790d33adddd7 100644 --- a/frame/system/src/lib.rs +++ b/frame/system/src/lib.rs @@ -360,8 +360,11 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { + #[cfg(feature = "std")] 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."); + }); } }