Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Run frame_system integrity tests in Externalities #13092

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,11 @@ pub mod pallet {

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
#[cfg(feature = "std")]
fn integrity_test() {
T::BlockWeights::get().validate().expect("The weights are invalid.");
sp_io::TestExternalities::default().execute_with(|| {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it tries to compile this as no-std when benchmarks are enabled.
This is only a test and should not end up in the runtime, right?
So #[cfg(feature = "std")] should be fine?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T::BlockWeights::get().validate().expect("The weights are invalid.");
});
}
}

Expand Down