Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 5cab601

Browse files
authored
Merge pull request paritytech#150 from subspace/simplify-properties
Simplify the properties generation in ChainSpec
2 parents e0814b5 + 893a569 commit 5cab601

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

crates/subspace-node/src/chain_spec.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ pub fn get_account_id_from_seed(seed: &str) -> AccountId {
7373
}
7474

7575
pub fn testnet_config() -> Result<ChainSpec, String> {
76+
let mut properties = Properties::new();
77+
properties.insert("ss58Format".into(), SS58Prefix::get().into());
78+
properties.insert("tokenDecimals".into(), DECIMAL_PLACES.into());
79+
properties.insert("tokenSymbol".into(), "tSSC".into());
80+
7681
Ok(ChainSpec::from_genesis(
7782
// Name
7883
"Subspace testnet",
@@ -144,20 +149,7 @@ pub fn testnet_config() -> Result<ChainSpec, String> {
144149
// Protocol ID
145150
Some("subspace"),
146151
// Properties
147-
Some(Properties::from_iter([
148-
(
149-
"ss58Format".to_string(),
150-
serde_json::to_value(SS58Prefix::get()).expect("u16 is always serializable; qed"),
151-
),
152-
(
153-
"tokenDecimals".to_string(),
154-
serde_json::to_value(DECIMAL_PLACES).expect("u8 is always serializable; qed"),
155-
),
156-
(
157-
"tokenSymbol".to_string(),
158-
serde_json::to_value("tSSC").expect("&str is always serializable; qed"),
159-
),
160-
])),
152+
Some(properties),
161153
// Extensions
162154
None,
163155
))

0 commit comments

Comments
 (0)