Skip to content

Commit

Permalink
feat: add OpenGov to Centrifuge chain
Browse files Browse the repository at this point in the history
fix: centrifuge toml

chore: minor centrifuge chain improvements

refactor: Centrifuge OpenGov
  • Loading branch information
wischli committed May 3, 2024
1 parent b205a17 commit a80d106
Show file tree
Hide file tree
Showing 17 changed files with 1,890 additions and 302 deletions.
5 changes: 5 additions & 0 deletions Cargo.lock

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

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", default-feat
pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
Expand All @@ -205,6 +207,7 @@ pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", default-
pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-vesting = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", default-features = false, branch = "release-polkadot-v1.1.0" }
Expand Down
4 changes: 4 additions & 0 deletions libs/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ sp-std = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }
pallet-collective = { workspace = true }
pallet-membership = { workspace = true }

# cumulus primitives dependencies
cumulus-primitives-core = { workspace = true }
Expand All @@ -45,6 +46,7 @@ std = [
"frame-support/std",
"frame-system/std",
"pallet-collective/std",
"pallet-membership/std",
"scale-info/std",
"serde/std",
"sp-arithmetic/std",
Expand All @@ -60,12 +62,14 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"staging-xcm-executor/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-collective/try-runtime",
"pallet-membership/try-runtime",
"sp-runtime/try-runtime",
]
8 changes: 8 additions & 0 deletions libs/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ pub mod types {
// Ensure that origin is either Root or fallback to use EnsureOrigin `O`
pub type EnsureRootOr<O> = EitherOfDiverse<EnsureRoot<AccountId>, O>;

/// The technical fellowship collective which can whitelist proposal for the
/// WhitelistedCaller track
pub type TechnicalCollective = pallet_collective::Instance2;

/// The technical membership which handles membership of the
/// TechnicalCollective. It is not linked to the WhitelistedCaller track.
pub type TechnicalMembership = pallet_membership::Instance1;

/// The council
pub type CouncilCollective = pallet_collective::Instance1;

Expand Down
12 changes: 10 additions & 2 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use serde::{Deserialize, Serialize};
use sp_core::{crypto::UncheckedInto, sr25519, Encode, Pair, Public, H160};
use sp_runtime::{
traits::{IdentifyAccount, Verify},
FixedPointNumber,
BoundedVec, FixedPointNumber,
};
use staging_xcm::{
latest::{MultiLocation, NetworkId},
Expand Down Expand Up @@ -373,7 +373,7 @@ fn centrifuge_genesis(
orml_tokens: centrifuge_runtime::OrmlTokensConfig { balances: vec![] },
elections: centrifuge_runtime::ElectionsConfig { members: vec![] },
council: centrifuge_runtime::CouncilConfig {
members: council_members,
members: council_members.clone(),
phantom: Default::default(),
},
fees: centrifuge_runtime::FeesConfig {
Expand Down Expand Up @@ -468,6 +468,14 @@ fn centrifuge_genesis(
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
},
technical_committee: centrifuge_runtime::TechnicalCommitteeConfig {
members: council_members.clone(),
phantom: Default::default(),
},
technical_committee_membership: centrifuge_runtime::TechnicalCommitteeMembershipConfig {
members: BoundedVec::truncate_from(council_members),
phantom: Default::default(),
},
}
}

Expand Down
23 changes: 14 additions & 9 deletions runtime/centrifuge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ serde = { workspace = true, optional = true }
static_assertions = { workspace = true }

sp-api = { workspace = true }
sp-arithmetic = { workspace = true }
sp-block-builder = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
Expand Down Expand Up @@ -90,6 +91,7 @@ pallet-bridge = { workspace = true }
pallet-collator-allowlist = { workspace = true }
pallet-collator-selection = { workspace = true }
pallet-collective = { workspace = true }
pallet-conviction-voting = { workspace = true }
pallet-crowdloan-claim = { workspace = true }
pallet-crowdloan-reward = { workspace = true }
pallet-democracy = { workspace = true }
Expand Down Expand Up @@ -119,6 +121,7 @@ pallet-pool-registry = { workspace = true }
pallet-pool-system = { workspace = true }
pallet-preimage = { workspace = true }
pallet-proxy = { workspace = true }
pallet-referenda = { workspace = true }
pallet-remarks = { workspace = true }
pallet-restricted-tokens = { workspace = true }
pallet-restricted-xtokens = { workspace = true }
Expand All @@ -135,6 +138,7 @@ pallet-treasury = { workspace = true }
pallet-uniques = { workspace = true }
pallet-utility = { workspace = true }
pallet-vesting = { workspace = true }
pallet-whitelist = { workspace = true }
pallet-xcm = { workspace = true }
pallet-xcm-transactor = { workspace = true }
parachain-info = { workspace = true }
Expand All @@ -152,9 +156,9 @@ std = [
"scale-info/std",
"serde/std",
"log/std",

# Substrate related
"sp-api/std",
"sp-arithmetic/std",
"sp-runtime/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
Expand Down Expand Up @@ -189,14 +193,12 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"polkadot-runtime-common/std",
"polkadot-parachain-primitives/std",

# Locals
"cfg-primitives/std",
"cfg-traits/std",
"cfg-types/std",
"runtime-common/std",
"liquidity-pools-gateway-routers/std",

# Pallet list
"axelar-gateway-precompile/std",
"chainbridge/std",
Expand All @@ -219,6 +221,7 @@ std = [
"pallet-collator-allowlist/std",
"pallet-collator-selection/std",
"pallet-collective/std",
"pallet-conviction-voting/std",
"pallet-crowdloan-claim/std",
"pallet-crowdloan-reward/std",
"pallet-democracy/std",
Expand Down Expand Up @@ -248,6 +251,7 @@ std = [
"pallet-pool-system/std",
"pallet-preimage/std",
"pallet-proxy/std",
"pallet-referenda/std",
"pallet-remarks/std",
"pallet-restricted-tokens/std",
"pallet-restricted-xtokens/std",
Expand All @@ -264,6 +268,7 @@ std = [
"pallet-uniques/std",
"pallet-utility/std",
"pallet-vesting/std",
"pallet-whitelist/std",
"pallet-xcm/std",
"pallet-xcm-transactor/std",
"parachain-info/std",
Expand All @@ -274,7 +279,6 @@ runtime-benchmarks = [
"frame-system-benchmarking/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",

# Substrate related
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
Expand All @@ -285,14 +289,12 @@ runtime-benchmarks = [
"xcm-primitives/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",

# Locals
"cfg-primitives/runtime-benchmarks",
"cfg-traits/runtime-benchmarks",
"cfg-types/runtime-benchmarks",
"runtime-common/runtime-benchmarks",
"liquidity-pools-gateway-routers/runtime-benchmarks",

# Pallet list
"axelar-gateway-precompile/runtime-benchmarks",
"chainbridge/runtime-benchmarks",
Expand All @@ -308,6 +310,7 @@ runtime-benchmarks = [
"pallet-collator-allowlist/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-conviction-voting/runtime-benchmarks",
"pallet-crowdloan-claim/runtime-benchmarks",
"pallet-crowdloan-reward/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
Expand Down Expand Up @@ -336,6 +339,7 @@ runtime-benchmarks = [
"pallet-pool-system/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-referenda/runtime-benchmarks",
"pallet-remarks/runtime-benchmarks",
"pallet-restricted-tokens/runtime-benchmarks",
"pallet-restricted-xtokens/runtime-benchmarks",
Expand All @@ -350,29 +354,27 @@ runtime-benchmarks = [
"pallet-uniques/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-whitelist/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"pallet-xcm-transactor/runtime-benchmarks",
]

try-runtime = [
# Enabling optional
"frame-try-runtime/try-runtime",

# Substrate related
"sp-runtime/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"frame-executive/try-runtime",
"fp-self-contained/try-runtime",
"polkadot-runtime-common/try-runtime",

# Locals
"cfg-primitives/try-runtime",
"cfg-traits/try-runtime",
"cfg-types/try-runtime",
"runtime-common/try-runtime",
"liquidity-pools-gateway-routers/try-runtime",

# Pallet list
"axelar-gateway-precompile/try-runtime",
"chainbridge/try-runtime",
Expand All @@ -395,6 +397,7 @@ try-runtime = [
"pallet-collator-allowlist/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-collective/try-runtime",
"pallet-conviction-voting/try-runtime",
"pallet-crowdloan-claim/try-runtime",
"pallet-crowdloan-reward/try-runtime",
"pallet-democracy/try-runtime",
Expand Down Expand Up @@ -424,6 +427,7 @@ try-runtime = [
"pallet-pool-system/try-runtime",
"pallet-preimage/try-runtime",
"pallet-proxy/try-runtime",
"pallet-referenda/try-runtime",
"pallet-remarks/try-runtime",
"pallet-restricted-tokens/try-runtime",
"pallet-restricted-xtokens/try-runtime",
Expand All @@ -440,6 +444,7 @@ try-runtime = [
"pallet-uniques/try-runtime",
"pallet-utility/try-runtime",
"pallet-vesting/try-runtime",
"pallet-whitelist/try-runtime",
"pallet-xcm/try-runtime",
"pallet-xcm-transactor/try-runtime",
"parachain-info/try-runtime",
Expand Down
Loading

0 comments on commit a80d106

Please sign in to comment.