allow config NextFreeParaId in genesis (#3781)

* allow config NextFreeParaId in genesis

* update westend chain spec
This commit is contained in:
Xiliang Chen authored and GitHub committed 2021-09-06 14:42:34 -05:00
1 parent 4b928b0f22
commit 4d2e94f7ce
4 files changed
+33 -2

No files matched your search

@@ -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> {}