mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 12:51:02 +00:00
Companion for paritytech/substrate#12868 (#6406)
* Replace WEIGHT_PER_* with WEIGHT_REF_TIME_PER_* * cargo fmt * Update substrate
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
// --header=./file_header.txt
|
||||
|
||||
use sp_core::parameter_types;
|
||||
use sp_weights::{constants::WEIGHT_PER_NANOS, Weight};
|
||||
use sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight};
|
||||
|
||||
parameter_types! {
|
||||
/// Time to execute a NO-OP extrinsic, for example `System::remark`.
|
||||
@@ -51,7 +51,8 @@ parameter_types! {
|
||||
/// 99th: 96_279
|
||||
/// 95th: 95_584
|
||||
/// 75th: 95_005
|
||||
pub const ExtrinsicBaseWeight: Weight = WEIGHT_PER_NANOS.saturating_mul(94_889);
|
||||
pub const ExtrinsicBaseWeight: Weight =
|
||||
Weight::from_ref_time(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(94_889));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -67,12 +68,12 @@ mod test_weights {
|
||||
|
||||
// At least 10 µs.
|
||||
assert!(
|
||||
w.ref_time() >= 10u64 * constants::WEIGHT_PER_MICROS.ref_time(),
|
||||
w.ref_time() >= 10u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
|
||||
"Weight should be at least 10 µs."
|
||||
);
|
||||
// At most 1 ms.
|
||||
assert!(
|
||||
w.ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
|
||||
w.ref_time() <= constants::WEIGHT_REF_TIME_PER_MILLIS,
|
||||
"Weight should be at most 1 ms."
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user