mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
allow config NextFreeParaId in genesis (#3781)
* allow config NextFreeParaId in genesis * update westend chain spec
This commit is contained in:
@@ -175,6 +175,25 @@ pub mod pallet {
|
||||
#[pallet::storage]
|
||||
pub type NextFreeParaId<T> = StorageValue<_, ParaId, ValueQuery>;
|
||||
|
||||
#[pallet::genesis_config]
|
||||
pub struct GenesisConfig {
|
||||
pub next_free_para_id: ParaId,
|
||||
}
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
impl Default for GenesisConfig {
|
||||
fn default() -> Self {
|
||||
GenesisConfig { next_free_para_id: LOWEST_PUBLIC_ID }
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::genesis_build]
|
||||
impl<T: Config> GenesisBuild<T> for GenesisConfig {
|
||||
fn build(&self) {
|
||||
NextFreeParaId::<T>::put(self.next_free_para_id);
|
||||
}
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user