mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
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:
committed by
GitHub
parent
7981d4aa59
commit
9e56e1acdd
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user