Skip to content

Commit

Permalink
Add Pangoro2 (#281)
Browse files Browse the repository at this point in the history
* Format

* Deduplicate

* Add Pangoro2

* Rename

* Fix

* Fix

* Rename

* Doc

* Set SS58 in runtime and remove from chain spec
  • Loading branch information
AurevoirXavier authored Feb 15, 2023
1 parent af75e3a commit 49a48eb
Show file tree
Hide file tree
Showing 80 changed files with 4,419 additions and 238 deletions.
106 changes: 106 additions & 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ members = [
dc-primitives = { default-features = false, path = "core/primitives" }
dc-types = { path = "core/types" }
pangolin-runtime = { path = "runtime/pangolin" }
pangoro-runtime = { path = "runtime/pangoro" }

# darwinia-messages-substrate
bp-darwinia-core = { default-features = false, git = "https://github.com/darwinia-network/darwinia-messages-substrate", branch = "polkadot-v0.9.36" }
Expand Down
12 changes: 12 additions & 0 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ crab-runtime = { optional = true, workspace = true }
darwinia-runtime = { optional = true, workspace = true }
dc-primitives = { workspace = true }
pangolin-runtime = { optional = true, workspace = true }
pangoro-runtime = { optional = true, workspace = true }

# frontier
fc-cli = { workspace = true }
Expand Down Expand Up @@ -107,13 +108,15 @@ fast-runtime = [
"crab-runtime?/fast-runtime",
"darwinia-runtime?/fast-runtime",
"pangolin-runtime?/fast-runtime",
"pangoro-runtime?/fast-runtime",
]

runtime-benchmarks = [
# darwinia
"crab-runtime?/runtime-benchmarks",
"darwinia-runtime?/runtime-benchmarks",
"pangolin-runtime?/runtime-benchmarks",
"pangoro-runtime?/runtime-benchmarks",

# polkadot
"polkadot-cli/runtime-benchmarks",
Expand All @@ -124,6 +127,7 @@ try-runtime = [
"crab-runtime?/try-runtime",
"darwinia-runtime?/try-runtime",
"pangolin-runtime?/try-runtime",
"pangoro-runtime?/try-runtime",

# substrate
"try-runtime-cli/try-runtime",
Expand All @@ -134,6 +138,7 @@ all-natives = [
"crab-native",
"darwinia-native",
"pangolin-native",
"pangoro-native",
]
crab-native = [
# darwinia
Expand All @@ -156,3 +161,10 @@ pangolin-native = [
# polkadot
"polkadot-cli/rococo-native",
]
pangoro-native = [
# darwinia
"pangoro-runtime",

# polkadot
"polkadot-cli/rococo-native",
]
2 changes: 1 addition & 1 deletion node/src/chain_spec/crab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use sp_core::H160;
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;

fn properties() -> Properties {
super::properties("CRAB", 42)
super::properties("CRAB")
}

// Generate the session keys from individual elements.
Expand Down
2 changes: 1 addition & 1 deletion node/src/chain_spec/darwinia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use sp_core::H160;
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;

fn properties() -> Properties {
super::properties("RING", 18)
super::properties("RING")
}

// Generate the session keys from individual elements.
Expand Down
14 changes: 10 additions & 4 deletions node/src/chain_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ pub use pangolin::{self as pangolin_chain_spec, ChainSpec as PangolinChainSpec};
#[cfg(not(feature = "pangolin-native"))]
pub type PangolinChainSpec = DummyChainSpec;

#[cfg(feature = "pangolin-native")]
#[cfg(feature = "pangoro-native")]
pub mod pangoro;
#[cfg(feature = "pangoro-native")]
pub use pangoro::{self as pangoro_chain_spec, ChainSpec as PangoroChainSpec};
#[cfg(not(feature = "pangoro-native"))]
pub type PangoroChainSpec = DummyChainSpec;

#[cfg(any(feature = "pangolin-native", feature = "pangoro-native"))]
mod testnet_keys {
pub const C1: &str = "0x0eef9fabb6eb6fed2ab24a842931f8950426070a";
pub const C1_AURA: &str = "0xeed007f04d568b2d3bf329945a48c21a8ed030c81ca1dce61ad41c916599f405";
Expand All @@ -49,7 +56,7 @@ mod testnet_keys {
pub const C3_AURA: &str = "0xe25d860707bd1b88b9851cf40df3af3368cd57e5e82824cabac9c75fe537600f";
pub const SUDO: &str = "0x2748def2f9c3cfbbb963002935bc6d2e1c36ce2e";
}
#[cfg(feature = "pangolin-native")]
#[cfg(any(feature = "pangolin-native", feature = "pangoro-native"))]
use testnet_keys::*;

// crates.io
Expand Down Expand Up @@ -96,12 +103,11 @@ impl Extensions {
}
}

fn properties(token_symbol: &str, ss58_format: u16) -> Properties {
fn properties(token_symbol: &str) -> Properties {
let mut properties = Properties::new();

properties.insert("tokenSymbol".into(), token_symbol.into());
properties.insert("tokenDecimals".into(), 18.into());
properties.insert("ss58Format".into(), ss58_format.into());

properties
}
Expand Down
2 changes: 1 addition & 1 deletion node/src/chain_spec/pangolin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use sp_core::{crypto::UncheckedInto, H160};
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;

fn properties() -> Properties {
super::properties("PRING", 42)
super::properties("PRING")
}

// Generate the session keys from individual elements.
Expand Down
Loading

0 comments on commit 49a48eb

Please sign in to comment.