Skip to content

Commit

Permalink
chore: update local ss58 prefix (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
AtelyPham authored Jun 17, 2024
1 parent 94675c8 commit 5c81bd2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions node/src/chainspec/testnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ use sp_runtime::{
BoundedVec,
};
use std::{collections::BTreeMap, str::FromStr};
use tangle_primitives::types::{BlockNumber, Signature};
use tangle_primitives::{
types::{BlockNumber, Signature},
TESTNET_LOCAL_SS58_PREFIX,
};
use tangle_testnet_runtime::{
AccountId, BabeConfig, Balance, BalancesConfig, ClaimsConfig, CouncilConfig, EVMChainIdConfig,
EVMConfig, ImOnlineConfig, MaxVestingSchedules, Perbill, Precompiles, RoleKeyId,
Expand Down Expand Up @@ -166,7 +169,7 @@ pub fn local_testnet_config(chain_id: u64) -> Result<ChainSpec, String> {
let mut properties = sc_chain_spec::Properties::new();
properties.insert("tokenSymbol".into(), "tTNT".into());
properties.insert("tokenDecimals".into(), 18u32.into());
properties.insert("ss58Format".into(), 42.into());
properties.insert("ss58Format".into(), TESTNET_LOCAL_SS58_PREFIX.into());
#[allow(deprecated)]
Ok(ChainSpec::from_genesis(
// Name
Expand Down
2 changes: 1 addition & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl SubstrateCli for Cli {
fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"" | "dev" | "local" => Box::new(chainspec::testnet::local_testnet_config(
tangle_primitives::TESTNET_CHAIN_ID,
tangle_primitives::TESTNET_LOCAL_CHAIN_ID,
)?),
// generates the spec for benchmarking.
"benchmark" => Box::new(chainspec::testnet::local_benchmarking_config(
Expand Down
7 changes: 6 additions & 1 deletion primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,12 @@ pub use sp_consensus_babe::AuthorityId as BabeId;
pub const MAINNET_SS58_PREFIX: u16 = 5845;
pub const MAINNET_CHAIN_ID: u64 = MAINNET_SS58_PREFIX as u64;

// 3799 this would give us addresses with tt prefix for testnet like
// 3799 this would give us addresses with tt prefix for testnet like
// ttFELSU4MTyzpfsgZ9tFinrmox7pV7nF1BLbfYjsu4rfDYM74
pub const TESTNET_SS58_PREFIX: u16 = 3799;
pub const TESTNET_CHAIN_ID: u64 = TESTNET_SS58_PREFIX as u64;

// 3287 this would give us addresses with tt prefix for testnet like
// ttFELSU4MTyzpfsgZ9tFinrmox7pV7nF1BLbfYjsu4rfDYM74
pub const TESTNET_LOCAL_SS58_PREFIX: u16 = 3287;
pub const TESTNET_LOCAL_CHAIN_ID: u64 = TESTNET_LOCAL_SS58_PREFIX as u64;

0 comments on commit 5c81bd2

Please sign in to comment.