Introduce sensible weight constants (#12868)

* Introduce sensible weight constants

* cargo fmt

* Remove unused import

* Add missing import

* ".git/.scripts/bench-bot.sh" pallet dev pallet_lottery

Co-authored-by: command-bot <>
This commit is contained in:
Keith Yeung
2022-12-09 01:18:51 +09:00
committed by GitHub
parent 200f49d66d
commit 51db8c77a7
26 changed files with 140 additions and 113 deletions
+6 -5
View File
@@ -47,12 +47,13 @@ pub use weight_meter::*;
pub use weight_v2::*;
pub mod constants {
use super::Weight;
pub const WEIGHT_REF_TIME_PER_SECOND: u64 = 1_000_000_000_000;
pub const WEIGHT_REF_TIME_PER_MILLIS: u64 = 1_000_000_000;
pub const WEIGHT_REF_TIME_PER_MICROS: u64 = 1_000_000;
pub const WEIGHT_REF_TIME_PER_NANOS: u64 = 1_000;
pub const WEIGHT_PER_SECOND: Weight = Weight::from_ref_time(1_000_000_000_000);
pub const WEIGHT_PER_MILLIS: Weight = Weight::from_ref_time(1_000_000_000);
pub const WEIGHT_PER_MICROS: Weight = Weight::from_ref_time(1_000_000);
pub const WEIGHT_PER_NANOS: Weight = Weight::from_ref_time(1_000);
pub const WEIGHT_PROOF_SIZE_PER_MB: u64 = 1024 * 1024;
pub const WEIGHT_PROOF_SIZE_PER_KB: u64 = 1024;
}
/// The old weight type.