Macro polkadot_runtime_common::prod_or_fast

source ·
macro_rules! prod_or_fast {
    ($prod:expr, $test:expr) => { ... };
    ($prod:expr, $test:expr, $env:expr) => { ... };
}
Expand description

Macro to set a value (e.g. when using the parameter_types macro) to either a production value or to an environment variable or testing value (in case the fast-runtime feature is selected) or one of two testing values depending on feature. Note that the environment variable is evaluated at compile time.

Usage:

parameter_types! {
	// Note that the env variable version parameter cannot be const.
	pub LaunchPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1, "KSM_LAUNCH_PERIOD");
	pub const VotingPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1 * MINUTES);
	pub const EpochDuration: BlockNumber =
		prod_or_fast!(1 * HOURS, "fast-runtime", 1 * MINUTES, "fast-runtime-10m", 10 * MINUTES);
}