mirror of
https://git.ghostchain.io/proxmio/ghost-node.git
synced 2025-12-27 03:09:56 +00:00
inital commit, which is clearly not initial
Signed-off-by: Uncle Stretch <uncle.stretch@ghostchain.io>
This commit is contained in:
27
runtime/common/src/weights/block_weights.rs
Executable file
27
runtime/common/src/weights/block_weights.rs
Executable file
@@ -0,0 +1,27 @@
|
||||
use sp_core::parameter_types;
|
||||
use sp_weights::{constants::WEIGHT_PER_TIME_PER_NANOS, Weight};
|
||||
|
||||
parameter_types! {
|
||||
pub const BlockExecutionWeight: Weight =
|
||||
Weight::from_ref_time(WEIGHT_PER_TIME_PER_NANOS.saturating_mul(7_955_558));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_weights {
|
||||
use sp_weights::constants;
|
||||
|
||||
#[test]
|
||||
fn sane() {
|
||||
let w = super::BlockExecutionWeight::get();
|
||||
|
||||
assert!(
|
||||
w.ref_time() >= 100u64 * constants::WEIGHT_PER_TIME_PER_MICROS,
|
||||
"Weight should be at least 100 µs."
|
||||
);
|
||||
|
||||
assert!(
|
||||
w.ref_time() <= 50u64 * constants::WEIGHT_REF_TIME_PER_MILLIS,
|
||||
"Weight should be at most 50 ms."
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user