mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 03:27:58 +00:00
Do not use Option to wrap GenesisConfig fields (#8275)
Currently we wrap every `GenesisConfig` field in an `Option`, while we require `Default` being implemented for all pallet genesisconfigs. Passing `None` also results in the genesis not being initialized, which is a bug as seen from the perspective of a pallet developer? This pr changes the fields of the `GenesisConfig` to non `Option` types.
This commit is contained in:
@@ -82,7 +82,7 @@ macro_rules! impl_outer_config {
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct $main {
|
||||
$(
|
||||
pub [< $snake $(_ $instance )? >]: Option<$config>,
|
||||
pub [< $snake $(_ $instance )? >]: $config,
|
||||
)*
|
||||
}
|
||||
#[cfg(any(feature = "std", test))]
|
||||
@@ -92,15 +92,13 @@ macro_rules! impl_outer_config {
|
||||
storage: &mut $crate::sp_runtime::Storage,
|
||||
) -> std::result::Result<(), String> {
|
||||
$(
|
||||
if let Some(ref extra) = self.[< $snake $(_ $instance )? >] {
|
||||
$crate::impl_outer_config! {
|
||||
@CALL_FN
|
||||
$concrete;
|
||||
$snake;
|
||||
$( $instance )?;
|
||||
extra;
|
||||
storage;
|
||||
}
|
||||
$crate::impl_outer_config! {
|
||||
@CALL_FN
|
||||
$concrete;
|
||||
$snake;
|
||||
$( $instance )?;
|
||||
&self.[< $snake $(_ $instance )? >];
|
||||
storage;
|
||||
}
|
||||
)*
|
||||
|
||||
@@ -117,7 +115,7 @@ macro_rules! impl_outer_config {
|
||||
$runtime:ident;
|
||||
$module:ident;
|
||||
$instance:ident;
|
||||
$extra:ident;
|
||||
$extra:expr;
|
||||
$storage:ident;
|
||||
) => {
|
||||
$crate::sp_runtime::BuildModuleGenesisStorage::<$runtime, $module::$instance>::build_module_genesis_storage(
|
||||
@@ -129,7 +127,7 @@ macro_rules! impl_outer_config {
|
||||
$runtime:ident;
|
||||
$module:ident;
|
||||
;
|
||||
$extra:ident;
|
||||
$extra:expr;
|
||||
$storage:ident;
|
||||
) => {
|
||||
$crate::sp_runtime::BuildModuleGenesisStorage::
|
||||
|
||||
Reference in New Issue
Block a user