common_runtime/weights/
cumulus_pallet_weight_reclaim.rs1#![cfg_attr(rustfmt, rustfmt_skip)]
26#![allow(unused_parens)]
27#![allow(unused_imports)]
28#![allow(missing_docs)]
29
30use frame_support::{traits::Get, weights::Weight};
31use core::marker::PhantomData;
32
33pub struct SubstrateWeight<T>(PhantomData<T>);
35impl<T: frame_system::Config> cumulus_pallet_weight_reclaim::WeightInfo for SubstrateWeight<T> {
36 fn storage_weight_reclaim() -> Weight {
37 Weight::from_parts(5_048_000, 0)
42 }
43}
44
45
46#[cfg(test)]
47mod tests {
48 use frame_support::{traits::Get, weights::Weight, dispatch::DispatchClass};
49 use crate::constants::{MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO};
50 use crate::weights::extrinsic_weights::ExtrinsicBaseWeight;
51
52 #[allow(dead_code)]
53 struct BlockWeights;
54 impl Get<frame_system::limits::BlockWeights> for BlockWeights {
55 fn get() -> frame_system::limits::BlockWeights {
56 frame_system::limits::BlockWeights::builder()
57 .base_block(Weight::zero())
58 .for_class(DispatchClass::all(), |weights| {
59 weights.base_extrinsic = ExtrinsicBaseWeight::get();
60 })
61 .for_class(DispatchClass::non_mandatory(), |weights| {
62 weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
63 })
64 .build_or_panic()
65 }
66 }
67
68}