Skip to content

Commit

Permalink
remove native token cofniguration for staging
Browse files Browse the repository at this point in the history
  • Loading branch information
AmbientTea committed Dec 13, 2024
1 parent 1fc4cb2 commit 9ae3012
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion node/src/staging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
};
Expand Down
2 changes: 1 addition & 1 deletion node/src/template_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn chain_spec() -> Result<ChainSpec, envy::Error> {
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()
},
};
Expand Down
2 changes: 1 addition & 1 deletion node/src/testnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
};
Expand Down
6 changes: 4 additions & 2 deletions pallets/native-token-management/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ pub mod pallet {
#[pallet::genesis_config]
#[derive(frame_support::DefaultNoBound)]
pub struct GenesisConfig<T: Config> {
pub main_chain_scripts: sp_native_token_management::MainChainScripts,
pub main_chain_scripts: Option<sp_native_token_management::MainChainScripts>,
pub _marker: PhantomData<T>,
}

#[pallet::genesis_build]
impl<T: Config> BuildGenesisConfig for GenesisConfig<T> {
fn build(&self) {
MainChainScriptsConfiguration::<T>::put(self.main_chain_scripts.clone());
if let Some(main_chain_scripts) = self.main_chain_scripts.clone() {
MainChainScriptsConfiguration::<T>::put(main_chain_scripts);
}
}
}

Expand Down

0 comments on commit 9ae3012

Please sign in to comment.