-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Run frame_system
integrity tests in Externalities
#13092
Run frame_system
integrity tests in Externalities
#13092
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
frame_system
integrity tests in Externalities
@@ -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(|| { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could maybe also thing of running everything in externalities.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just run all of them in an empty externalities?
Although, I wonder if anyone ever wants to use a custom on there.
This was also my first thought, but was not sure about unintended consequences and there is not really an advantage. |
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
bot merge |
* 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>
* 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>
storage
parameter types are currently not usable asBlockWeight
, since theintegrity_test
offrame_system
runs outside of externalities and therefore fails. This MR just wraps it in externalities to allow that.Having quickly adjustable block PoV weights would be useful for testing the limits on Rococo and Westmint.