1
// Copyright (C) Moondance Labs Ltd.
2
// This file is part of Tanssi.
3

            
4
// Tanssi is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8

            
9
// Tanssi is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13

            
14
// You should have received a copy of the GNU General Public License
15
// along with Tanssi.  If not, see <http://www.gnu.org/licenses/>
16

            
17
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
18
//! DATE: 2023-05-26 (Y/M/D)
19
//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
20
//!
21
//! SHORT-NAME: `block`, LONG-NAME: `BlockExecution`, RUNTIME: `Development`
22
//! WARMUPS: `10`, REPEAT: `100`
23
//! WEIGHT-PATH: `runtime/dancelight/constants/src/weights/`
24
//! WEIGHT-METRIC: `Average`, WEIGHT-MUL: `1.0`, WEIGHT-ADD: `0`
25

            
26
// Executed Command:
27
//   ./target/production/polkadot
28
//   benchmark
29
//   overhead
30
//   --chain=dancelight-dev
31
//   --execution=wasm
32
//   --wasm-execution=compiled
33
//   --weight-path=runtime/dancelight/constants/src/weights/
34
//   --warmup=10
35
//   --repeat=100
36
//   --header=./file_header.txt
37

            
38
use {
39
    sp_core::parameter_types,
40
    sp_weights::{constants::WEIGHT_REF_TIME_PER_NANOS, Weight},
41
};
42

            
43
parameter_types! {
44
    /// Time to execute an empty block.
45
    /// Calculated by multiplying the *Average* with `1.0` and adding `0`.
46
    ///
47
    /// Stats nanoseconds:
48
    ///   Min, Max: 408_659, 450_716
49
    ///   Average:  417_412
50
    ///   Median:   411_177
51
    ///   Std-Dev:  12242.31
52
    ///
53
    /// Percentiles nanoseconds:
54
    ///   99th: 445_142
55
    ///   95th: 442_275
56
    ///   75th: 414_217
57
    pub const BlockExecutionWeight: Weight =
58
        Weight::from_parts(WEIGHT_REF_TIME_PER_NANOS.saturating_mul(417_412), 0);
59
}
60

            
61
#[cfg(test)]
62
mod test_weights {
63
    use sp_weights::constants;
64

            
65
    /// Checks that the weight exists and is sane.
66
    // NOTE: If this test fails but you are sure that the generated values are fine,
67
    // you can delete it.
68
    #[test]
69
1
    fn sane() {
70
1
        let w = super::BlockExecutionWeight::get();
71
1

            
72
1
        // At least 100 µs.
73
1
        assert!(
74
1
            w.ref_time() >= 100u64 * constants::WEIGHT_REF_TIME_PER_MICROS,
75
            "Weight should be at least 100 µs."
76
        );
77
        // At most 50 ms.
78
1
        assert!(
79
1
            w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
80
            "Weight should be at most 50 ms."
81
        );
82
1
    }
83
}