diff --git a/Cargo.lock b/Cargo.lock index bc5d0dff866ea..70ea1063fb65f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3670,6 +3670,7 @@ dependencies = [ "sc-transaction-graph", "sc-transaction-pool", "serde", + "serde_json", "sp-api", "sp-block-builder", "sp-blockchain", diff --git a/node/parachain/Cargo.toml b/node/parachain/Cargo.toml index 40e7fe7022363..5b71afcf568bb 100644 --- a/node/parachain/Cargo.toml +++ b/node/parachain/Cargo.toml @@ -23,6 +23,7 @@ codec = { package = 'parity-scale-codec', version = '1.0.0' } structopt = "0.3.3" ansi_term = "0.12.1" serde = { version = "1.0.101", features = ["derive"] } +serde_json = "1.0" jsonrpc-core = "14.0.3" jsonrpc-pubsub = "14.0.3" diff --git a/node/parachain/src/chain_spec.rs b/node/parachain/src/chain_spec.rs index 62fdfb4a70fe6..7272766c1bdad 100644 --- a/node/parachain/src/chain_spec.rs +++ b/node/parachain/src/chain_spec.rs @@ -93,7 +93,12 @@ pub fn get_chain_spec(id: ParaId) -> Result { vec![], None, None, - None, + Some( + serde_json::from_str( + "{\"tokenDecimals\": 18}" + ) + .expect("Provided valid json map") + ), Extensions { relay_chain: "local_testnet".into(), para_id: id.into(), @@ -118,7 +123,12 @@ pub fn staging_test_net(id: ParaId) -> Result { Vec::new(), None, None, - None, + Some( + serde_json::from_str( + "{\"tokenDecimals\": 18}" + ) + .expect("Provided valid json map") + ), Extensions { relay_chain: "rococo_local_testnet".into(), para_id: id.into(), diff --git a/node/standalone/Cargo.lock b/node/standalone/Cargo.lock index ef44837dd720b..d0eaef43b1deb 100644 --- a/node/standalone/Cargo.lock +++ b/node/standalone/Cargo.lock @@ -3492,6 +3492,7 @@ dependencies = [ "sc-service", "sc-transaction-graph", "sc-transaction-pool", + "serde_json", "sp-api", "sp-block-builder", "sp-blockchain", diff --git a/node/standalone/Cargo.toml b/node/standalone/Cargo.toml index 959bf8b52a389..04b6ef3643298 100644 --- a/node/standalone/Cargo.toml +++ b/node/standalone/Cargo.toml @@ -26,6 +26,7 @@ log = "0.4.8" structopt = "0.3.8" jsonrpc-core = "14.0.3" jsonrpc-pubsub = "14.0.3" +serde_json = "1.0" sp-api = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-branch" } sp-blockchain = { git = "https://github.com/paritytech/substrate.git", branch = "rococo-branch" } diff --git a/node/standalone/src/chain_spec.rs b/node/standalone/src/chain_spec.rs index 88c31c04f4868..2aa384e863de7 100644 --- a/node/standalone/src/chain_spec.rs +++ b/node/standalone/src/chain_spec.rs @@ -89,7 +89,12 @@ pub fn development_config() -> Result { // Protocol ID None, // Properties - None, + Some( + serde_json::from_str( + "{\"tokenDecimals\": 18}" + ) + .expect("Provided valid json map") + ), // Extensions None, )) @@ -137,7 +142,12 @@ pub fn local_testnet_config() -> Result { // Protocol ID None, // Properties - None, + Some( + serde_json::from_str( + "{\"tokenDecimals\": 18}" + ) + .expect("Provided valid json map") + ), // Extensions None, )) diff --git a/specs/moonbase-alphanet-dev-specs-template.json b/specs/moonbase-alphanet-dev-specs-template.json index 0e448b844b7a7..961c5f0ab9fdc 100644 --- a/specs/moonbase-alphanet-dev-specs-template.json +++ b/specs/moonbase-alphanet-dev-specs-template.json @@ -5,7 +5,9 @@ "bootNodes": [], "telemetryEndpoints": null, "protocolId": null, - "properties": null, + "properties": { + "tokenDecimals": 18 + }, "relay_chain": "local_testnet", "para_id": 1000, "consensusEngine": null, diff --git a/specs/moonbase-alphanet-specs-template.json b/specs/moonbase-alphanet-specs-template.json index 534901a4d6205..604ac4bdb0e31 100644 --- a/specs/moonbase-alphanet-specs-template.json +++ b/specs/moonbase-alphanet-specs-template.json @@ -5,7 +5,9 @@ "bootNodes": [], "telemetryEndpoints": null, "protocolId": null, - "properties": null, + "properties": { + "tokenDecimals": 18 + }, "relay_chain": "local_testnet", "para_id": 1000, "consensusEngine": null, diff --git a/specs/rococo-alphanet-specs-template.json b/specs/rococo-alphanet-specs-template.json index 998e912d87e73..a46a69d706f5e 100755 --- a/specs/rococo-alphanet-specs-template.json +++ b/specs/rococo-alphanet-specs-template.json @@ -5,7 +5,9 @@ "bootNodes": [], "telemetryEndpoints": null, "protocolId": "dot", - "properties": null, + "properties": { + "tokenDecimals": 18 + }, "consensusEngine": null, "genesis": { "runtime": { diff --git a/tests/moonbeam-test-specs/simple-specs.json b/tests/moonbeam-test-specs/simple-specs.json index 148710ecedbdb..c280cf1458047 100644 --- a/tests/moonbeam-test-specs/simple-specs.json +++ b/tests/moonbeam-test-specs/simple-specs.json @@ -5,7 +5,9 @@ "bootNodes": [], "telemetryEndpoints": null, "protocolId": null, - "properties": null, + "properties": { + "tokenDecimals": 18 + }, "consensusEngine": null, "genesis": { "runtime": { diff --git a/tests/moonbeam-test-specs/templates/simple-specs-template.json b/tests/moonbeam-test-specs/templates/simple-specs-template.json index a7cdd37ec4694..45b331a07feab 100644 --- a/tests/moonbeam-test-specs/templates/simple-specs-template.json +++ b/tests/moonbeam-test-specs/templates/simple-specs-template.json @@ -5,7 +5,9 @@ "bootNodes": [], "telemetryEndpoints": null, "protocolId": null, - "properties": null, + "properties": { + "tokenDecimals": 18 + }, "consensusEngine": null, "genesis": { "runtime": {