diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 054048222..10a90b214 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,4 +1,4 @@ -use sidechain_domain::PolicyId; +use sidechain_domain::{AssetName, MainchainAddress, PolicyId}; use sidechain_runtime::CrossChainPublic; use sidechain_runtime::{opaque::SessionKeys, AccountId, Signature, WASM_BINARY}; use sp_core::{Pair, Public}; @@ -82,3 +82,12 @@ pub fn read_mainchain_scripts_from_env() -> Result Result { + Ok(sp_native_token_management::MainChainScripts { + native_token_policy: from_var::("NATIVE_TOKEN_POLICY_ID")?, + native_token_asset_name: from_var::("NATIVE_TOKEN_ASSET_NAME")?, + illiquid_supply_address: from_var::("ILLIQUID_SUPPLY_VALIDATOR_ADDRESS")?, + }) +} diff --git a/node/src/staging.rs b/node/src/staging.rs index 3419c5753..091c032e6 100644 --- a/node/src/staging.rs +++ b/node/src/staging.rs @@ -166,13 +166,7 @@ pub fn staging_genesis( main_chain_scripts: read_mainchain_scripts_from_env()?, }, native_token_management: NativeTokenManagementConfig { - main_chain_scripts: sp_native_token_management::MainChainScripts { - native_token_policy: from_var::("NATIVE_TOKEN_POLICY_ID")?, - native_token_asset_name: from_var::("NATIVE_TOKEN_ASSET_NAME")?, - illiquid_supply_address: from_var::( - "ILLIQUID_SUPPLY_VALIDATOR_ADDRESS", - )?, - }, + main_chain_scripts: read_native_token_main_chain_scripts_from_env()?, ..Default::default() }, }; diff --git a/node/src/template_chain_spec.rs b/node/src/template_chain_spec.rs index f7047d681..8e9e64bda 100644 --- a/node/src/template_chain_spec.rs +++ b/node/src/template_chain_spec.rs @@ -1,7 +1,7 @@ use crate::chain_spec::*; use chain_params::SidechainParams; use sc_service::ChainType; -use sidechain_domain::{AssetName, MainchainAddress, MainchainAddressHash, PolicyId, UtxoId}; +use sidechain_domain::{MainchainAddressHash, UtxoId}; use sidechain_runtime::{ AuraConfig, BalancesConfig, GrandpaConfig, NativeTokenManagementConfig, RuntimeGenesisConfig, SessionCommitteeManagementConfig, SessionConfig, SidechainConfig, SudoConfig, SystemConfig, @@ -45,13 +45,7 @@ pub fn chain_spec() -> Result { main_chain_scripts: read_mainchain_scripts_from_env()?, }, native_token_management: NativeTokenManagementConfig { - main_chain_scripts: sp_native_token_management::MainChainScripts { - native_token_policy: from_var::("NATIVE_TOKEN_POLICY_ID")?, - native_token_asset_name: from_var::("NATIVE_TOKEN_ASSET_NAME")?, - illiquid_supply_address: from_var::( - "ILLIQUID_SUPPLY_VALIDATOR_ADDRESS", - )?, - }, + main_chain_scripts: read_native_token_main_chain_scripts_from_env()?, ..Default::default() }, }; diff --git a/node/src/testnet.rs b/node/src/testnet.rs index 2d549f244..98ff38e6f 100644 --- a/node/src/testnet.rs +++ b/node/src/testnet.rs @@ -206,13 +206,7 @@ pub fn testnet_genesis( main_chain_scripts: read_mainchain_scripts_from_env()?, }, native_token_management: NativeTokenManagementConfig { - main_chain_scripts: sp_native_token_management::MainChainScripts { - native_token_policy: from_var::("NATIVE_TOKEN_POLICY_ID")?, - native_token_asset_name: from_var::("NATIVE_TOKEN_ASSET_NAME")?, - illiquid_supply_address: from_var::( - "ILLIQUID_SUPPLY_VALIDATOR_ADDRESS", - )?, - }, + main_chain_scripts: read_native_token_main_chain_scripts_from_env()?, ..Default::default() }, };