Skip to content

Commit 3ac8084

Browse files
seadandabkonturgithub-actions[bot]bkchr
authored andcommitted
Allow RelaychainDataProvider set_block_number to be used in tests (#8537)
Co-authored-by: Branislav Kontur <[email protected]> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <[email protected]>
1 parent fd876e0 commit 3ac8084

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cumulus/pallets/parachain-system/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ impl<T: Config> BlockNumberProvider for RelaychainDataProvider<T> {
18471847
.unwrap_or_else(|| Pallet::<T>::last_relay_block_number())
18481848
}
18491849

1850-
#[cfg(feature = "runtime-benchmarks")]
1850+
#[cfg(any(feature = "std", feature = "runtime-benchmarks", test))]
18511851
fn set_block_number(block: Self::BlockNumber) {
18521852
let mut validation_data = ValidationData::<T>::get().unwrap_or_else(||
18531853
// PersistedValidationData does not impl default in non-std

prdoc/pr_8537.prdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Allow RelaychainDataProvider set_block_number to be used in tests
2+
doc:
3+
- audience: Runtime Dev
4+
description: "`set_block_number` in the `RelaychainDataProvider` trait can now be used in tests. Previously this was only included with the `runtime-benchmarks` feature."
5+
crates:
6+
- name: cumulus-pallet-parachain-system
7+
bump: minor

0 commit comments

Comments
 (0)