Skip to content
This repository was 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 1 commit
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
4 changes: 3 additions & 1 deletion frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ pub mod pallet {
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
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