Skip to content
Snippets Groups Projects
Commit 4db9ff03 authored by girazoki's avatar girazoki Committed by GitHub
Browse files

Implement set_block_number for runtime-bencmarks in RelayBlockNumberProiver (#1187)

parent ae7a5776
No related merge requests found
......@@ -73,3 +73,7 @@ std = [
"sp-trie/std",
"xcm/std"
]
runtime-benchmarks = [
"sp-runtime/runtime-benchmarks"
]
\ No newline at end of file
......@@ -1047,4 +1047,11 @@ impl<T: Config> BlockNumberProvider for RelaychainBlockNumberProvider<T> {
.map(|d| d.relay_parent_number)
.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)
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment