diff --git a/resources/weight_analyzer/src/lib.rs b/resources/weight_analyzer/src/lib.rs index afc0879280e3910806a5237f1e1a9b1d087df838..5403efab32da26a04b5e74a27b669edad409bf45 100644 --- a/resources/weight_analyzer/src/lib.rs +++ b/resources/weight_analyzer/src/lib.rs @@ -11,10 +11,15 @@ use subweight_core::parse::storage::Weights; use subweight_core::scope::Scope; use subweight_core::term::Term; +// Substrate default maximum weight of a block in nanoseconds. +// Since the maximum block weight is one-third of the execution time, +// it corresponds to a block time of 6 seconds. +const MAX_BLOCK_WEIGHT_NS: f64 = 2_000_000_000_000.; + pub struct MaxBlockWeight(f64); impl Default for MaxBlockWeight { fn default() -> Self { - MaxBlockWeight(2_000_000_000_000.) + MaxBlockWeight(MAX_BLOCK_WEIGHT_NS) } } impl Div<&MaxBlockWeight> for f64 {