mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 14:41:02 +00:00
Make BlockNumberProvider::set_block_number available in tests / std (#3974)
This function is currently only exposed to runtime-benchmarks, where it should be available in all tests. Also made it available in `std` because this is how `set_block_number` works in FRAME System, however, not sure if it is needed in the latest std/no_std paradigm. --------- Co-authored-by: Bastian Köcher <git@kchr.de> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -2322,12 +2322,12 @@ 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,
|
/// Utility function only to be used in benchmarking scenarios or tests, to be implemented
|
||||||
/// else a noop.
|
/// optionally, else a noop.
|
||||||
///
|
///
|
||||||
/// It allows for setting the block number that will later be fetched
|
/// 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
|
/// 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) {}
|
fn set_block_number(_block: Self::BlockNumber) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user