From 56dcf1da82b3530ce93e6e1c9b0a0672d4a2d027 Mon Sep 17 00:00:00 2001 From: bgallois <benjamin@gallois.cc> Date: Mon, 8 Jan 2024 16:17:26 +0100 Subject: [PATCH] add const documentation --- resources/weight_analyzer/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/weight_analyzer/src/lib.rs b/resources/weight_analyzer/src/lib.rs index afc087928..5403efab3 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 { -- GitLab