Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGov experiment #1292

Merged
merged 8 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 43 additions & 19 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
39 changes: 25 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,12 +212,10 @@ 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(),
democracy: Default::default(),

// Utility stuff.
sudo: SudoConfig { key: Some(array_bytes::hex_n_into_unchecked(SUDO)) },
Expand Down Expand Up @@ -319,12 +320,22 @@ 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(),
democracy: Default::default(),

// Utility stuff.
sudo: SudoConfig { key: Some(array_bytes::hex_n_into_unchecked(ALITH)) },
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