mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
Weight v1.5 Follow Ups (#12155)
* update api * update * remove unused * remove `one` api * fix unused * fmt * add saturating accrue * remove `Weight::new()` * use some macros * div makes no sense * Update weight_v2.rs * missed some * more patch * fixes * more fixes * more fix * more fix * Update frame/support/src/weights/weight_v2.rs * not needed * fix weight file
This commit is contained in:
@@ -322,7 +322,7 @@ mod tests {
|
||||
new_test_ext().execute_with(|| {
|
||||
let max = DispatchInfo {
|
||||
weight: block_weights().get(DispatchClass::Normal).max_extrinsic.unwrap() +
|
||||
Weight::one(),
|
||||
Weight::from_ref_time(1),
|
||||
class: DispatchClass::Normal,
|
||||
..Default::default()
|
||||
};
|
||||
@@ -348,7 +348,7 @@ mod tests {
|
||||
let okay =
|
||||
DispatchInfo { weight, class: DispatchClass::Operational, ..Default::default() };
|
||||
let max = DispatchInfo {
|
||||
weight: weight + Weight::one(),
|
||||
weight: weight + Weight::from_ref_time(1),
|
||||
class: DispatchClass::Operational,
|
||||
..Default::default()
|
||||
};
|
||||
@@ -532,7 +532,7 @@ mod tests {
|
||||
let medium =
|
||||
DispatchInfo { weight: normal_limit - base_extrinsic, ..Default::default() };
|
||||
let big = DispatchInfo {
|
||||
weight: normal_limit - base_extrinsic + Weight::one(),
|
||||
weight: normal_limit - base_extrinsic + Weight::from_ref_time(1),
|
||||
..Default::default()
|
||||
};
|
||||
let len = 0_usize;
|
||||
@@ -551,7 +551,7 @@ mod tests {
|
||||
|
||||
reset_check_weight(&small, false, Weight::zero());
|
||||
reset_check_weight(&medium, false, Weight::zero());
|
||||
reset_check_weight(&big, true, Weight::one());
|
||||
reset_check_weight(&big, true, Weight::from_ref_time(1));
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ pub struct BlockWeights {
|
||||
|
||||
impl Default for BlockWeights {
|
||||
fn default() -> Self {
|
||||
Self::with_sensible_defaults(1 * constants::WEIGHT_PER_SECOND, DEFAULT_NORMAL_RATIO)
|
||||
Self::with_sensible_defaults(1u32 * constants::WEIGHT_PER_SECOND, DEFAULT_NORMAL_RATIO)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,9 +295,9 @@ impl BlockWeights {
|
||||
/// is not suitable for production deployments.
|
||||
pub fn simple_max(block_weight: Weight) -> Self {
|
||||
Self::builder()
|
||||
.base_block(Weight::new())
|
||||
.base_block(Weight::zero())
|
||||
.for_class(DispatchClass::all(), |weights| {
|
||||
weights.base_extrinsic = Weight::new();
|
||||
weights.base_extrinsic = Weight::zero();
|
||||
})
|
||||
.for_class(DispatchClass::non_mandatory(), |weights| {
|
||||
weights.max_total = block_weight.into();
|
||||
|
||||
@@ -65,7 +65,7 @@ impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
|
||||
fn remark_with_event(b: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 0
|
||||
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
|
||||
}
|
||||
// Storage: System Digest (r:1 w:1)
|
||||
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
|
||||
@@ -79,7 +79,7 @@ impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
|
||||
fn set_storage(i: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add(Weight::from_ref_time(603_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(603_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Skipped Metadata (r:0 w:0)
|
||||
@@ -87,7 +87,7 @@ impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
|
||||
fn kill_storage(i: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add(Weight::from_ref_time(513_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(513_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Skipped Metadata (r:0 w:0)
|
||||
@@ -95,7 +95,7 @@ impl<T: crate::Config> WeightInfo for SubstrateWeight<T> {
|
||||
fn kill_prefix(p: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add(Weight::from_ref_time(1_026_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(1_026_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
|
||||
.saturating_add(T::DbWeight::get().writes((1 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
|
||||
}
|
||||
}
|
||||
@@ -110,7 +110,7 @@ impl WeightInfo for () {
|
||||
fn remark_with_event(b: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 0
|
||||
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).scalar_saturating_mul(b as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(1_000 as RefTimeWeight).saturating_mul(b as RefTimeWeight))
|
||||
}
|
||||
// Storage: System Digest (r:1 w:1)
|
||||
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
|
||||
@@ -124,7 +124,7 @@ impl WeightInfo for () {
|
||||
fn set_storage(i: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add(Weight::from_ref_time(603_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(603_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Skipped Metadata (r:0 w:0)
|
||||
@@ -132,7 +132,7 @@ impl WeightInfo for () {
|
||||
fn kill_storage(i: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add(Weight::from_ref_time(513_000 as RefTimeWeight).scalar_saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(513_000 as RefTimeWeight).saturating_mul(i as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as RefTimeWeight).saturating_mul(i as RefTimeWeight)))
|
||||
}
|
||||
// Storage: Skipped Metadata (r:0 w:0)
|
||||
@@ -140,7 +140,7 @@ impl WeightInfo for () {
|
||||
fn kill_prefix(p: u32, ) -> Weight {
|
||||
Weight::from_ref_time(0 as RefTimeWeight)
|
||||
// Standard Error: 1_000
|
||||
.saturating_add(Weight::from_ref_time(1_026_000 as RefTimeWeight).scalar_saturating_mul(p as RefTimeWeight))
|
||||
.saturating_add(Weight::from_ref_time(1_026_000 as RefTimeWeight).saturating_mul(p as RefTimeWeight))
|
||||
.saturating_add(RocksDbWeight::get().writes((1 as RefTimeWeight).saturating_mul(p as RefTimeWeight)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user