Deprecate Weight::from_{ref_time, proof_size} (#13475)

* Deprecate Weight::from_{ref_time, proof_size}

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update templates

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use from_parts

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use from_parts

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Dont revert comment 🤦

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* ".git/.scripts/commands/bench/bench.sh" pallet dev pallet_balances

* Update weight files

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* More fixes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Adapt to Master changes

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
This commit is contained in:
Oliver Tale-Yazdi
2023-03-02 22:28:17 +01:00
committed by GitHub
parent 7981d4aa59
commit 9e56e1acdd
101 changed files with 2695 additions and 2857 deletions
+10 -10
View File
@@ -199,8 +199,8 @@ mod multiplier_tests {
let fm = Multiplier::saturating_from_rational(1, 2);
let test_set = vec![
(Weight::zero(), fm),
(Weight::from_ref_time(100), fm),
(Weight::from_ref_time(1000), fm),
(Weight::from_parts(100, 0), fm),
(Weight::from_parts(1000, 0), fm),
(target(), fm),
(max_normal() / 2, fm),
(max_normal(), fm),
@@ -285,7 +285,7 @@ mod multiplier_tests {
// almost full. The entire quota of normal transactions is taken.
let block_weight = BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap() -
Weight::from_ref_time(100);
Weight::from_parts(100, 0);
// Default substrate weight.
let tx_weight = frame_support::weights::constants::ExtrinsicBaseWeight::get();
@@ -409,23 +409,23 @@ mod multiplier_tests {
#[test]
fn weight_to_fee_should_not_overflow_on_large_weights() {
let kb = Weight::from_ref_time(1024);
let kb = Weight::from_parts(1024, 0);
let mb = 1024u64 * kb;
let max_fm = Multiplier::saturating_from_integer(i128::MAX);
// check that for all values it can compute, correctly.
vec![
Weight::zero(),
Weight::from_ref_time(1),
Weight::from_ref_time(10),
Weight::from_ref_time(1000),
Weight::from_parts(1, 0),
Weight::from_parts(10, 0),
Weight::from_parts(1000, 0),
kb,
10u64 * kb,
100u64 * kb,
mb,
10u64 * mb,
Weight::from_ref_time(2147483647),
Weight::from_ref_time(4294967295),
Weight::from_parts(2147483647, 0),
Weight::from_parts(4294967295, 0),
BlockWeights::get().max_block / 2,
BlockWeights::get().max_block,
Weight::MAX / 2,
@@ -442,7 +442,7 @@ mod multiplier_tests {
// Some values that are all above the target and will cause an increase.
let t = target();
vec![t + Weight::from_ref_time(100), t * 2, t * 4].into_iter().for_each(|i| {
vec![t + Weight::from_parts(100, 0), t * 2, t * 4].into_iter().for_each(|i| {
run_with_system_weight(i, || {
let fm = runtime_multiplier_update(max_fm);
// won't grow. The convert saturates everything.