diff --git a/substrate/primitives/runtime/src/traits.rs b/substrate/primitives/runtime/src/traits.rs index 5a6c306dd2a1..d023aa045dbe 100644 --- a/substrate/primitives/runtime/src/traits.rs +++ b/substrate/primitives/runtime/src/traits.rs @@ -2322,12 +2322,12 @@ pub trait BlockNumberProvider { /// . fn current_block_number() -> Self::BlockNumber; - /// Utility function only to be used in benchmarking scenarios, to be implemented optionally, - /// else a noop. + /// Utility function only to be used in benchmarking scenarios or tests, to be implemented + /// optionally, else a noop. /// /// It allows for setting the block number that will later be fetched /// This is useful in case the block number provider is different than System - #[cfg(feature = "runtime-benchmarks")] + #[cfg(any(feature = "std", feature = "runtime-benchmarks"))] fn set_block_number(_block: Self::BlockNumber) {} }