This commit is contained in:
4meta5
2023-11-27 19:15:48 -05:00
parent 57f9353fd0
commit a3cd8e00d2
4 changed files with 42 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// ExtBuilder impl for all runtime integration tests
use frame_support::weights::Weight;
use parachain_template_runtime::{BuildStorage, Runtime, System};
pub fn run_with_system_weight<F>(w: Weight, mut assertions: F)
where
F: FnMut() -> (),
{
let mut t: sp_io::TestExternalities =
frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap().into();
t.execute_with(|| {
System::set_block_consumed_resources(w, 0);
assertions()
});
}