-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
WeightMeter
: more consistent namingWeightMeter
: more consistent naming
WeightMeter
: more consistent namingWeightMeter
: more consistent naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just a few nits
|
||
/// Consume some weight and defensively fail if it is over the limit. Saturate in any case. | ||
/// | ||
/// This is provided as a less noisy version of `defensive_saturating_accrue`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The meaning of a "less noisy version" is not clear to me. I mean, defensive_saturating_accrue
is just an alias now. Maybe we can just remove this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I copied if from the Gist from Gav - but agreed; it is unnecessary to mention now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new naming is soo much better. ❤️
Co-authored-by: Juan <juangirini@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <git@kchr.de>
bot merge |
* Rename WeightMeter functions * Fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixup and doc + tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * One more test Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixup pallets Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use correct function 🤦 Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Apply suggestions from code review Co-authored-by: Juan <juangirini@gmail.com> * Update primitives/weights/src/weight_meter.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update primitives/weights/src/weight_meter.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update primitives/weights/src/weight_meter.rs --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Juan <juangirini@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de>
* Rename WeightMeter functions * Fixes Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixup and doc + tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * One more test Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Fixup pallets Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use correct function 🤦 Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Apply suggestions from code review Co-authored-by: Juan <juangirini@gmail.com> * Update primitives/weights/src/weight_meter.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update primitives/weights/src/weight_meter.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update primitives/weights/src/weight_meter.rs --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: Juan <juangirini@gmail.com> Co-authored-by: Bastian Köcher <git@kchr.de>
@gavofyork recommended some more consistent naming for the
WeightMeter
. Breaking changes are prefixed with 🚨Changes:
defensive_saturating_accrue
and introduceconsume
instead.check_accrue
and introducetry_consume
instead.can_accrue
and introducecan_consume
instead.consumed
andlimit
and addconsumed()
andlimit()
getters instead.Polkadot Companion: paritytech/polkadot#7507