diff --git a/node/src/staging.rs b/node/src/staging.rs index d6e3b390c..30b3d5d56 100644 --- a/node/src/staging.rs +++ b/node/src/staging.rs @@ -149,7 +149,7 @@ pub fn staging_genesis( main_chain_scripts: sp_session_validator_management::MainChainScripts::read_from_env()?, }, native_token_management: NativeTokenManagementConfig { - main_chain_scripts: sp_native_token_management::MainChainScripts::read_from_env()?, + main_chain_scripts: None, ..Default::default() }, }; diff --git a/node/src/template_chain_spec.rs b/node/src/template_chain_spec.rs index 6440dff10..67916c8fc 100644 --- a/node/src/template_chain_spec.rs +++ b/node/src/template_chain_spec.rs @@ -39,7 +39,7 @@ pub fn chain_spec() -> Result { main_chain_scripts: sp_session_validator_management::MainChainScripts::read_from_env()?, }, native_token_management: NativeTokenManagementConfig { - main_chain_scripts: sp_native_token_management::MainChainScripts::read_from_env()?, + main_chain_scripts: Some(sp_native_token_management::MainChainScripts::read_from_env()?), ..Default::default() }, }; diff --git a/node/src/testnet.rs b/node/src/testnet.rs index ed4684113..2e437b1fa 100644 --- a/node/src/testnet.rs +++ b/node/src/testnet.rs @@ -201,7 +201,7 @@ pub fn testnet_genesis( main_chain_scripts: sp_session_validator_management::MainChainScripts::read_from_env()?, }, native_token_management: NativeTokenManagementConfig { - main_chain_scripts: sp_native_token_management::MainChainScripts::read_from_env()?, + main_chain_scripts: Some(sp_native_token_management::MainChainScripts::read_from_env()?), ..Default::default() }, }; diff --git a/pallets/native-token-management/src/lib.rs b/pallets/native-token-management/src/lib.rs index 84a1e4a2c..c37752f57 100644 --- a/pallets/native-token-management/src/lib.rs +++ b/pallets/native-token-management/src/lib.rs @@ -66,14 +66,16 @@ pub mod pallet { #[pallet::genesis_config] #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig { - pub main_chain_scripts: sp_native_token_management::MainChainScripts, + pub main_chain_scripts: Option, pub _marker: PhantomData, } #[pallet::genesis_build] impl BuildGenesisConfig for GenesisConfig { fn build(&self) { - MainChainScriptsConfiguration::::put(self.main_chain_scripts.clone()); + if let Some(main_chain_scripts) = self.main_chain_scripts.clone() { + MainChainScriptsConfiguration::::put(main_chain_scripts); + } } }