Skip to content
Snippets Groups Projects
Unverified Commit 56dcf1da authored by bgallois's avatar bgallois
Browse files

add const documentation

parent d6fd10b6
No related branches found
No related tags found
No related merge requests found
Pipeline #35199 passed
...@@ -11,10 +11,15 @@ use subweight_core::parse::storage::Weights; ...@@ -11,10 +11,15 @@ use subweight_core::parse::storage::Weights;
use subweight_core::scope::Scope; use subweight_core::scope::Scope;
use subweight_core::term::Term; 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); pub struct MaxBlockWeight(f64);
impl Default for MaxBlockWeight { impl Default for MaxBlockWeight {
fn default() -> Self { fn default() -> Self {
MaxBlockWeight(2_000_000_000_000.) MaxBlockWeight(MAX_BLOCK_WEIGHT_NS)
} }
} }
impl Div<&MaxBlockWeight> for f64 { impl Div<&MaxBlockWeight> for f64 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment