mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +00:00
@@ -188,7 +188,7 @@ pub mod pallet {
|
||||
}
|
||||
|
||||
fn on_idle(_: BlockNumberFor<T>, remaining_weight: Weight) -> Weight {
|
||||
let mut meter = WeightMeter::from_limit(remaining_weight);
|
||||
let mut meter = WeightMeter::with_limit(remaining_weight);
|
||||
if meter.try_consume(T::WeightInfo::empty_on_idle()).is_err() {
|
||||
return T::WeightInfo::empty_on_idle()
|
||||
}
|
||||
@@ -197,7 +197,7 @@ pub mod pallet {
|
||||
Storage::<T>::get().saturating_mul_int(meter.remaining().proof_size());
|
||||
let computation_weight_limit =
|
||||
Compute::<T>::get().saturating_mul_int(meter.remaining().ref_time());
|
||||
let mut meter = WeightMeter::from_limit(Weight::from_parts(
|
||||
let mut meter = WeightMeter::with_limit(Weight::from_parts(
|
||||
computation_weight_limit,
|
||||
proof_size_limit,
|
||||
));
|
||||
|
||||
@@ -252,7 +252,7 @@ fn on_idle_weight_over_unity_is_close_enough_works() {
|
||||
fn waste_at_most_ref_time_weight_close_enough() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let mut meter =
|
||||
WeightMeter::from_limit(Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX));
|
||||
WeightMeter::with_limit(Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, u64::MAX));
|
||||
// Over-spending fails defensively.
|
||||
Glutton::waste_at_most_ref_time(&mut meter);
|
||||
|
||||
@@ -269,7 +269,7 @@ fn waste_at_most_ref_time_weight_close_enough() {
|
||||
fn waste_at_most_proof_size_weight_close_enough() {
|
||||
new_test_ext().execute_with(|| {
|
||||
let mut meter =
|
||||
WeightMeter::from_limit(Weight::from_parts(u64::MAX, WEIGHT_PROOF_SIZE_PER_MB * 5));
|
||||
WeightMeter::with_limit(Weight::from_parts(u64::MAX, WEIGHT_PROOF_SIZE_PER_MB * 5));
|
||||
// Over-spending fails defensively.
|
||||
Glutton::waste_at_most_proof_size(&mut meter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user