From 9ae301201d41c173df127086bb9a5f1232df5252 Mon Sep 17 00:00:00 2001 From: Nikolaos Dymitriadis Date: Fri, 13 Dec 2024 18:44:42 +0100 Subject: [PATCH] remove native token cofniguration for staging --- node/src/staging.rs | 2 +- node/src/template_chain_spec.rs | 2 +- node/src/testnet.rs | 2 +- pallets/native-token-management/src/lib.rs | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) 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); + } } }