Skip to content

Commit

Permalink
OpenGov
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Lau <xavier@inv.cafe>
  • Loading branch information
aurexav committed Oct 10, 2023
1 parent b910655 commit 61d1410
Show file tree
Hide file tree
Showing 33 changed files with 545 additions and 1,356 deletions.
60 changes: 43 additions & 17 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 @@ -27,6 +27,7 @@ libsecp256k1 = { version = "0.7", default-features = false }
scale-info = { version = "2.9", default-features = false }
sha3 = { version = "0.10" }
static_assertions = { version = "1.1" }
strum = { version = "0.25", default-features = false }

# cumulus
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.43" }
Expand Down
2 changes: 0 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ fast-runtime = [
# darwinia
"crab-runtime?/fast-runtime",
"darwinia-runtime?/fast-runtime",
"pangolin-runtime?/fast-runtime",
"pangoro-runtime?/fast-runtime",
]

evm-tracing = [
Expand Down
14 changes: 8 additions & 6 deletions node/src/chain_spec/crab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ fn session_keys(keys: AuraId) -> SessionKeys {

pub fn development_config() -> ChainSpec {
ChainSpec::from_genesis(
"Crab2 Development",
"crab2-development",
ChainType::Development,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Crab2 D",
"crab2-d",
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down Expand Up @@ -90,9 +91,10 @@ pub fn development_config() -> ChainSpec {

pub fn local_config() -> ChainSpec {
ChainSpec::from_genesis(
"Crab2 Local",
"crab2-local",
ChainType::Local,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Crab2 L",
"crab2-l",
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down
14 changes: 8 additions & 6 deletions node/src/chain_spec/darwinia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ fn session_keys(keys: AuraId) -> SessionKeys {

pub fn development_config() -> ChainSpec {
ChainSpec::from_genesis(
"Darwinia2 Development",
"darwinia2-development",
ChainType::Development,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Darwinia2 D",
"darwinia2-d",
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down Expand Up @@ -90,9 +91,10 @@ pub fn development_config() -> ChainSpec {

pub fn local_config() -> ChainSpec {
ChainSpec::from_genesis(
"Darwinia2 Local",
"darwinia2-local",
ChainType::Local,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Darwinia2 L",
"darwinia2-l",
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down
37 changes: 23 additions & 14 deletions node/src/chain_spec/pangolin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ fn session_keys(keys: AuraId) -> SessionKeys {

pub fn development_config() -> ChainSpec {
ChainSpec::from_genesis(
"Pangolin2 Development",
"pangolin2-development",
ChainType::Development,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Pangolin2 D",
"pangolin2-d",
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down Expand Up @@ -90,9 +91,11 @@ pub fn development_config() -> ChainSpec {

pub fn local_config() -> ChainSpec {
ChainSpec::from_genesis(
"Pangolin2 Local",
"pangolin2-local",
ChainType::Local,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Pangolin2 L",
"pangolin2-l",
// Fulfill Polkadot.JS metadata upgrade requirements.
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down Expand Up @@ -209,11 +212,8 @@ pub fn genesis_config() -> ChainSpec {
ecdsa_authority: Default::default(),

// Governance stuff.
democracy: Default::default(),
council: Default::default(),
technical_committee: Default::default(),
phragmen_election: Default::default(),
technical_membership: Default::default(),
treasury: Default::default(),

// Utility stuff.
Expand Down Expand Up @@ -319,11 +319,20 @@ fn testnet_genesis(
ecdsa_authority: Default::default(),

// Governance stuff.
democracy: Default::default(),
council: Default::default(),
technical_committee: Default::default(),
phragmen_election: Default::default(),
technical_membership: Default::default(),
council: CouncilConfig {
members: vec![
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked(BALTATHAR),
],
..Default::default()
},
technical_committee: TechnicalCommitteeConfig {
members: vec![
array_bytes::hex_n_into_unchecked(ALITH),
array_bytes::hex_n_into_unchecked(BALTATHAR),
],
..Default::default()
},
treasury: Default::default(),

// Utility stuff.
Expand Down
14 changes: 8 additions & 6 deletions node/src/chain_spec/pangoro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ fn session_keys(keys: AuraId) -> SessionKeys {

pub fn development_config() -> ChainSpec {
ChainSpec::from_genesis(
"Pangoro2 Development",
"pangoro2-development",
ChainType::Development,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Pangoro2 D",
"pangoro2-d",
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down Expand Up @@ -90,9 +91,10 @@ pub fn development_config() -> ChainSpec {

pub fn local_config() -> ChainSpec {
ChainSpec::from_genesis(
"Pangoro2 Local",
"pangoro2-local",
ChainType::Local,
// Fulfill Polkadot.JS metadata upgrade requirements.
"Pangoro2 L",
"pangoro2-l",
ChainType::Live,
move || {
testnet_genesis(
vec![
Expand Down
3 changes: 2 additions & 1 deletion node/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ pub trait IdentifyVariant {

/// Returns true if this configuration is for a development network.
fn is_dev(&self) -> bool {
self.id().ends_with("development")
// Fulfill Polkadot.JS metadata upgrade requirements.
self.id().ends_with("-d")
}
}
impl IdentifyVariant for Box<dyn sc_service::ChainSpec> {
Expand Down
Loading

0 comments on commit 61d1410

Please sign in to comment.