Skip to content

Commit

Permalink
added 18 decimals to chain specs (paritytech#99)
Browse files Browse the repository at this point in the history
* added 18 decimals to chain specs

* add 18 decimals to rust-specs

* typos

Co-authored-by: Joshy Orndorff <[email protected]>
  • Loading branch information
joelamouche and JoshOrndorff authored Nov 10, 2020
1 parent d01d29d commit 840ce22
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 9 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node/parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
14 changes: 12 additions & 2 deletions node/parachain/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ pub fn get_chain_spec(id: ParaId) -> Result<ChainSpec, String> {
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(),
Expand All @@ -118,7 +123,12 @@ pub fn staging_test_net(id: ParaId) -> Result<ChainSpec, String> {
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(),
Expand Down
1 change: 1 addition & 0 deletions node/standalone/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node/standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
14 changes: 12 additions & 2 deletions node/standalone/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ pub fn development_config() -> Result<ChainSpec, String> {
// Protocol ID
None,
// Properties
None,
Some(
serde_json::from_str(
"{\"tokenDecimals\": 18}"
)
.expect("Provided valid json map")
),
// Extensions
None,
))
Expand Down Expand Up @@ -137,7 +142,12 @@ pub fn local_testnet_config() -> Result<ChainSpec, String> {
// Protocol ID
None,
// Properties
None,
Some(
serde_json::from_str(
"{\"tokenDecimals\": 18}"
)
.expect("Provided valid json map")
),
// Extensions
None,
))
Expand Down
4 changes: 3 additions & 1 deletion specs/moonbase-alphanet-dev-specs-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
"properties": {
"tokenDecimals": 18
},
"relay_chain": "local_testnet",
"para_id": 1000,
"consensusEngine": null,
Expand Down
4 changes: 3 additions & 1 deletion specs/moonbase-alphanet-specs-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
"properties": {
"tokenDecimals": 18
},
"relay_chain": "local_testnet",
"para_id": 1000,
"consensusEngine": null,
Expand Down
4 changes: 3 additions & 1 deletion specs/rococo-alphanet-specs-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": "dot",
"properties": null,
"properties": {
"tokenDecimals": 18
},
"consensusEngine": null,
"genesis": {
"runtime": {
Expand Down
4 changes: 3 additions & 1 deletion tests/moonbeam-test-specs/simple-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
"properties": {
"tokenDecimals": 18
},
"consensusEngine": null,
"genesis": {
"runtime": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"bootNodes": [],
"telemetryEndpoints": null,
"protocolId": null,
"properties": null,
"properties": {
"tokenDecimals": 18
},
"consensusEngine": null,
"genesis": {
"runtime": {
Expand Down

0 comments on commit 840ce22

Please sign in to comment.