Skip to content

Commit

Permalink
[chore] Set properties when starting a local testnet (#317)
Browse files Browse the repository at this point in the history
Co-authored-by: Akilesh Tangella <[email protected]>
  • Loading branch information
Nutomic and akileshtangella authored Mar 28, 2023
1 parent a855323 commit 0f31564
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[submodule "substrate-fixtures"]
path = substrate-fixtures
url = https://github.com/webb-tools/substrate-fixtures
branch = main

[submodule "solidity-fixtures"]
path = solidity-fixtures
url = https://github.com/webb-tools/solidity-fixtures

branch = main
2 changes: 1 addition & 1 deletion solidity-fixtures
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

0 comments on commit 0f31564

Please sign in to comment.