Function common::weights::check_accrue_n
source · pub fn check_accrue_n(meter: &mut WeightMeter, w: Weight, max_n: u64) -> u64
Expand description
Try to consume the given weight max_n
times. If weight is only
enough to consume n <= max_n
times, it consumes it n
times
and returns n
.