mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 02:51:08 +00:00
Implement set_block_number for runtime-bencmarks in RelayBlockNumberProiver (#1187)
This commit is contained in:
@@ -73,3 +73,7 @@ std = [
|
|||||||
"sp-trie/std",
|
"sp-trie/std",
|
||||||
"xcm/std"
|
"xcm/std"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
runtime-benchmarks = [
|
||||||
|
"sp-runtime/runtime-benchmarks"
|
||||||
|
]
|
||||||
@@ -1047,4 +1047,11 @@ impl<T: Config> BlockNumberProvider for RelaychainBlockNumberProvider<T> {
|
|||||||
.map(|d| d.relay_parent_number)
|
.map(|d| d.relay_parent_number)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
}
|
}
|
||||||
|
#[cfg(feature = "runtime-benchmarks")]
|
||||||
|
fn set_block_number(block: Self::BlockNumber) {
|
||||||
|
if let Some(mut validation_data) = Pallet::<T>::validation_data() {
|
||||||
|
validation_data.relay_parent_number = block;
|
||||||
|
ValidationData::<T>::put(validation_data)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user