Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Set properties when starting a local testnet #317

Merged
merged 2 commits into from
Mar 28, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions standalone/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use arkworks_setups::{common::setup_params, Curve};
use webb_primitives::{types::runtime::BabeId, AccountId, Balance, Signature};

use itertools::Itertools;
use sc_chain_spec::ChainSpecExtension;
use sc_chain_spec::{ChainSpecExtension, Properties};
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
use sp_core::{sr25519, Pair, Public};
Expand Down Expand Up @@ -84,11 +84,15 @@ fn webb_session_keys(
webb_runtime::SessionKeys { grandpa, babe, im_online, authority_discovery }
}

pub fn webb_development_config() -> Result<ChainSpec, String> {
let mut properties = sc_chain_spec::Properties::new();
fn properties() -> Properties {
let mut properties = Properties::new();
properties.insert("tokenSymbol".into(), "Unit".into());
properties.insert("tokenDecimals".into(), 18u32.into());
properties.insert("ss58Format".into(), 42.into());
properties
}

pub fn webb_development_config() -> Result<ChainSpec, String> {
Ok(ChainSpec::from_genesis(
// Name
"Development",
Expand Down Expand Up @@ -130,7 +134,7 @@ pub fn webb_development_config() -> Result<ChainSpec, String> {
// Fork ID
None,
// Properties
Some(properties),
Some(properties()),
Default::default(),
))
}
Expand Down Expand Up @@ -177,7 +181,7 @@ pub fn webb_local_testnet_config() -> Result<ChainSpec, String> {
// Fork ID
None,
// Properties
None,
Some(properties()),
// Extensions
Default::default(),
))
Expand Down