fast-runtime tweak (#5201)

* These should be included in fast-runtime
This commit is contained in:
Squirrel
2022-04-25 17:23:47 +01:00
committed by GitHub
parent 5ebcf3643c
commit 35f6712c5e
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ pub use self::runtime::logger_hook;
/// Export a dummy logger hook when the `runtime-metrics` feature is not enabled. /// Export a dummy logger hook when the `runtime-metrics` feature is not enabled.
#[cfg(not(feature = "runtime-metrics"))] #[cfg(not(feature = "runtime-metrics"))]
pub fn logger_hook() -> impl FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration) -> () { pub fn logger_hook() -> impl FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration) {
|_logger_builder, _config| {} |_logger_builder, _config| {}
} }
+2 -1
View File
@@ -38,9 +38,10 @@ pub mod currency {
/// Time and blocks. /// Time and blocks.
pub mod time { pub mod time {
use primitives::v2::{BlockNumber, Moment}; use primitives::v2::{BlockNumber, Moment};
use runtime_common::prod_or_fast;
pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 1 * HOURS; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(1 * HOURS, 1 * MINUTES);
// These time units are defined in number of blocks. // These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);
@@ -40,9 +40,10 @@ pub mod currency {
/// Time and blocks. /// Time and blocks.
pub mod time { pub mod time {
use primitives::v2::{BlockNumber, Moment}; use primitives::v2::{BlockNumber, Moment};
use runtime_common::prod_or_fast;
pub const MILLISECS_PER_BLOCK: Moment = 6000; pub const MILLISECS_PER_BLOCK: Moment = 6000;
pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK; pub const SLOT_DURATION: Moment = MILLISECS_PER_BLOCK;
pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 4 * HOURS; pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = prod_or_fast!(4 * HOURS, 1 * MINUTES);
// These time units are defined in number of blocks. // These time units are defined in number of blocks.
pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber); pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);