Commit bd2166de authored by Oliver Tale-Yazdi's avatar Oliver Tale-Yazdi Committed by GitHub
Browse files

Move `WeightCounter` to `sp-weights` (#12603)



* Move WeightCounter to sp_weights

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>

* Rename to WeightMeter and test

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>

* Fix pallet-scheduler for new usage

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>

* Update primitives/weights/src/weight_meter.rs

Co-authored-by: default avatarDavid <[email protected]>

* More tests for can_accrue

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>

* Clippy

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>

* Remove defensive_accrue and fixup consumed_ratio

I dont think there is a good use-case for defensive_accrue
without saturation. Only in tests maybe, will remove for now
until we have a use-case.

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>

* Test

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>

Signed-off-by: default avatarOliver Tale-Yazdi <[email protected]>
Co-authored-by: default avatarDavid <[email protected]>
Co-authored-by: default avatarGavin Wood <[email protected]>
parent e04b0c49
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment