git.delta.rocks / unique-network / refs/commits / 73f8e683417f

difftreelog

Merge pull request #45 from usetech-llc/feature/chain_spec_token_vesting

str-mv2020-12-22parents: #cf6c066 #0032fbb.patch.diff
in: master
Add chain spec entries for system properties and vesting

3 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3522,6 +3522,8 @@
  "sc-rpc-api",
  "sc-service",
  "sc-transaction-pool",
+ "serde",
+ "serde_json",
  "sp-api",
  "sp-block-builder",
  "sp-blockchain",
modifiednode/Cargo.tomldiffbeforeafterboth
--- a/node/Cargo.toml
+++ b/node/Cargo.toml
@@ -58,6 +58,9 @@
 substrate-frame-rpc-system = {version = '2.0.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'}
 pallet-contracts-rpc = {version = '0.8.0', git = 'https://github.com/usetech-llc/substrate.git', branch = 'release_flexi'} 
 
+serde = { version = "1.0.102", features = ["derive"] }
+serde_json = "1.0.41"
+
 [features]
 default = []
 runtime-benchmarks = ['nft-runtime/runtime-benchmarks']
modifiednode/src/chain_spec.rsdiffbeforeafterboth
9use sp_core::{sr25519, Pair, Public};9use sp_core::{sr25519, Pair, Public};
10use sp_finality_grandpa::AuthorityId as GrandpaId;10use sp_finality_grandpa::AuthorityId as GrandpaId;
11use sp_runtime::traits::{IdentifyAccount, Verify};11use sp_runtime::traits::{IdentifyAccount, Verify};
12use serde_json::map::Map;
1213
13// Note this is the URL for the telemetry server14// Note this is the URL for the telemetry server
14//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";15//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
41pub fn development_config() -> Result<ChainSpec, String> {42pub fn development_config() -> Result<ChainSpec, String> {
42 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;43 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;
44
45 let mut properties = Map::new();
46 properties.insert("tokenSymbol".into(), "UniqueTest".into());
47 properties.insert("tokenDecimals".into(), 15.into());
48 properties.insert("ss58Format".into(), 0.into());
4349
44 Ok(ChainSpec::from_genesis(50 Ok(ChainSpec::from_genesis(
45 // Name51 // Name
71 // Protocol ID77 // Protocol ID
72 None,78 None,
73 // Properties79 // Properties
74 None,80 Some(properties),
75 // Extensions81 // Extensions
76 None,82 None,
77 ))83 ))
133 enable_println: bool,139 enable_println: bool,
134) -> GenesisConfig {140) -> GenesisConfig {
141
142 let vested_accounts = vec![
143 get_account_id_from_seed::<sr25519::Public>("Bob"),
144 ];
145
135 GenesisConfig {146 GenesisConfig {
136 system: Some(SystemConfig {147 system: Some(SystemConfig {
155 }),166 }),
156 pallet_treasury: Some(Default::default()),167 pallet_treasury: Some(Default::default()),
157 pallet_sudo: Some(SudoConfig { key: root_key }),168 pallet_sudo: Some(SudoConfig { key: root_key }),
158 pallet_vesting: Some(Default::default()),169 pallet_vesting: Some(VestingConfig {
170 vesting: vested_accounts
171 .iter()
172 .cloned()
173 .map(|k| (k, 1000, 100, 1 << 98))
174 .collect(),
175 }),
159 pallet_nft: Some(NftConfig {176 pallet_nft: Some(NftConfig {
160 collection: vec![(177 collection: vec![(
161 1,178 1,