Skip to content

Commit

Permalink
Run frame_system integrity tests in Externalities (paritytech#13092)
Browse files Browse the repository at this point in the history
* Run frame_system integrity tests in Externalities

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use feature = 'std'

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored and ark0f committed Feb 27, 2023
1 parent 88cd0c9 commit 59e1ba6
Showing 1 changed file with 4 additions and 1 deletion.
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(|| {
T::BlockWeights::get().validate().expect("The weights are invalid.");
});
}
}

Expand Down

0 comments on commit 59e1ba6

Please sign in to comment.