Skip to content

Commit

Permalink
feat: impl blocknumber check
Browse files Browse the repository at this point in the history
  • Loading branch information
weichweich committed May 24, 2023
1 parent 2200888 commit 126ef38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pallets/configuration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ log.workspace = true
parity-scale-codec = {workspace = true, features = ["derive"]}
scale-info = {workspace = true, features = ["derive"]}
frame-support.workspace = true
cumulus-pallet-parachain-system.workspace = true
frame-system.workspace = true
sp-runtime.workspace = true
sp-std.workspace = true
Expand All @@ -42,6 +43,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks"
]
std = [
"cumulus-pallet-parachain-system/std",
"parity-scale-codec/std",
"frame-benchmarking?/std",
"frame-support/std",
Expand Down
9 changes: 9 additions & 0 deletions pallets/configuration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub use crate::{configuration::Configuration, default_weights::WeightInfo, palle
pub mod pallet {
use super::*;

use cumulus_pallet_parachain_system::{CheckAssociatedRelayNumber, RelayNumberStrictlyIncreases};
use frame_support::{
pallet_prelude::*,
traits::{EnsureOrigin, StorageVersion},
Expand Down Expand Up @@ -97,4 +98,12 @@ pub mod pallet {
Ok(())
}
}

impl<T: Config> CheckAssociatedRelayNumber for Pallet<T> {
fn check_associated_relay_number(a: u32, b: u32) {
if ConfigurationStore::<T>::get().relay_block_strictly_increasing {
RelayNumberStrictlyIncreases::check_associated_relay_number(a, b);
}
}
}
}

0 comments on commit 126ef38

Please sign in to comment.