mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 03:05:44 +00:00
Add setter configurable only for benchmarking or tests (#9668)
* Add setter configurable only fior benchmarking or tests * Update primitives/runtime/src/traits.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -1585,6 +1585,14 @@ pub trait BlockNumberProvider {
|
|||||||
/// ```
|
/// ```
|
||||||
/// .
|
/// .
|
||||||
fn current_block_number() -> Self::BlockNumber;
|
fn current_block_number() -> Self::BlockNumber;
|
||||||
|
|
||||||
|
/// Utility function only to be used in benchmarking scenarios, 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")]
|
||||||
|
fn set_block_number(_block: Self::BlockNumber) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user