mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Add properties to Chain Spec (#917)
* Add properties to chainspec. * Update bin/millau/node/src/chain_spec.rs Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
978de95938
commit
fd44cab992
@@ -12,6 +12,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
jsonrpc-core = "15.1.0"
|
jsonrpc-core = "15.1.0"
|
||||||
structopt = "0.3.21"
|
structopt = "0.3.21"
|
||||||
|
serde_json = "1.0.59"
|
||||||
|
|
||||||
# Bridge dependencies
|
# Bridge dependencies
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,15 @@ pub fn get_authority_keys_from_seed(s: &str) -> (AccountId, AuraId, GrandpaId) {
|
|||||||
impl Alternative {
|
impl Alternative {
|
||||||
/// Get an actual chain config from one of the alternatives.
|
/// Get an actual chain config from one of the alternatives.
|
||||||
pub(crate) fn load(self) -> ChainSpec {
|
pub(crate) fn load(self) -> ChainSpec {
|
||||||
|
let properties = Some(
|
||||||
|
serde_json::json!({
|
||||||
|
"tokenDecimals": 9,
|
||||||
|
"tokenSymbol": "MLAU",
|
||||||
|
})
|
||||||
|
.as_object()
|
||||||
|
.expect("Map given; qed")
|
||||||
|
.clone(),
|
||||||
|
);
|
||||||
match self {
|
match self {
|
||||||
Alternative::Development => ChainSpec::from_genesis(
|
Alternative::Development => ChainSpec::from_genesis(
|
||||||
"Development",
|
"Development",
|
||||||
@@ -88,7 +97,7 @@ impl Alternative {
|
|||||||
vec![],
|
vec![],
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
properties,
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
Alternative::LocalTestnet => ChainSpec::from_genesis(
|
Alternative::LocalTestnet => ChainSpec::from_genesis(
|
||||||
@@ -136,7 +145,7 @@ impl Alternative {
|
|||||||
vec![],
|
vec![],
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
properties,
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
jsonrpc-core = "15.1.0"
|
jsonrpc-core = "15.1.0"
|
||||||
structopt = "0.3.21"
|
structopt = "0.3.21"
|
||||||
|
serde_json = "1.0.59"
|
||||||
|
|
||||||
# Bridge dependencies
|
# Bridge dependencies
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ use rialto_runtime::{
|
|||||||
AccountId, AuraConfig, BalancesConfig, BridgeKovanConfig, BridgeRialtoPoAConfig, GenesisConfig, GrandpaConfig,
|
AccountId, AuraConfig, BalancesConfig, BridgeKovanConfig, BridgeRialtoPoAConfig, GenesisConfig, GrandpaConfig,
|
||||||
SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig, WASM_BINARY,
|
SessionConfig, SessionKeys, Signature, SudoConfig, SystemConfig, WASM_BINARY,
|
||||||
};
|
};
|
||||||
|
use serde_json::json;
|
||||||
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
|
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
|
||||||
use sp_core::{sr25519, Pair, Public};
|
use sp_core::{sr25519, Pair, Public};
|
||||||
use sp_finality_grandpa::AuthorityId as GrandpaId;
|
use sp_finality_grandpa::AuthorityId as GrandpaId;
|
||||||
@@ -67,6 +68,15 @@ pub fn get_authority_keys_from_seed(s: &str) -> (AccountId, AuraId, GrandpaId) {
|
|||||||
impl Alternative {
|
impl Alternative {
|
||||||
/// Get an actual chain config from one of the alternatives.
|
/// Get an actual chain config from one of the alternatives.
|
||||||
pub(crate) fn load(self) -> ChainSpec {
|
pub(crate) fn load(self) -> ChainSpec {
|
||||||
|
let properties = Some(
|
||||||
|
json!({
|
||||||
|
"tokenDecimals": 9,
|
||||||
|
"tokenSymbol": "RLT",
|
||||||
|
})
|
||||||
|
.as_object()
|
||||||
|
.expect("Map given; qed")
|
||||||
|
.clone(),
|
||||||
|
);
|
||||||
match self {
|
match self {
|
||||||
Alternative::Development => ChainSpec::from_genesis(
|
Alternative::Development => ChainSpec::from_genesis(
|
||||||
"Development",
|
"Development",
|
||||||
@@ -88,7 +98,7 @@ impl Alternative {
|
|||||||
vec![],
|
vec![],
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
properties,
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
Alternative::LocalTestnet => ChainSpec::from_genesis(
|
Alternative::LocalTestnet => ChainSpec::from_genesis(
|
||||||
@@ -136,7 +146,7 @@ impl Alternative {
|
|||||||
vec![],
|
vec![],
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
None,
|
properties,
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user