Skip to content

Commit

Permalink
Feature/plmc 398 add treasury pallet to base runtime should like the …
Browse files Browse the repository at this point in the history
…one in (#154)

* add treasury and elections-phragmen

* move to holds and freezes for election pallet

* fix test

* add pallets to base

* add democracy pallet

* set correct Governance config items

* remove migrations

* add test + default fast-gov

* change fast-gov to fast-mode

* add instant-mode

* add gov tests

* fmt

* license changes + readme mentions

* updated config items

* fix integration tests

* add locking period to elections phragmen

* add default members cargo config and fix benchmark tests

* add test + remove try-runtime + benchmarks from integration tests

* fix cargo test

* cargo fmt

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>

* fix technical committee assignment

* fix tc assignment correctly and add tests

* comments

* add initialization migrations and update custom_migrations

* update cancellation origin

* change GrowthTreasury back to Treasury and add comments to tests

* zepter

* fix migrations logging

* ignore and fix build spec test

* update pallet reference

* fmt

---------

Signed-off-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
Co-authored-by: Juan Ignacio Rios <juani.rios.99@gmail.com>
  • Loading branch information
vstam1 and JuaniRios committed Feb 1, 2024
1 parent 7bdadfe commit d8262d4
Show file tree
Hide file tree
Showing 64 changed files with 11,532 additions and 264 deletions.
96 changes: 82 additions & 14 deletions Cargo.lock

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

10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
"macros/tests",
"polimec-common",
]

default-members = ["nodes/*", "pallets/*"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -56,6 +56,8 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran

# Internal pallets (with default disabled)
pallet-funding = { path = "pallets/funding", default-features = false }
pallet-democracy = { path = "pallets/democracy", default-features = false }
pallet-elections-phragmen = { path = "pallets/elections-phragmen", default-features = false }
pallet-oracle-ocw = { path = "pallets/oracle-ocw", default-features = false }
pallet-sandbox = { path = "pallets/sandbox", default-features = false }
pallet-parachain-staking = { path = "pallets/parachain-staking", default-features = false }
Expand Down Expand Up @@ -121,6 +123,8 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", default
sp-trie = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-version = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-npos-elections = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
sp-tracing = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
pallet-im-online = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
sp-authority-discovery = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
Expand All @@ -138,7 +142,6 @@ pallet-session = { git = "https://github.com/paritytech/substrate", default-feat
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
pallet-asset-tx-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
pallet-collective = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
pallet-democracy = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
pallet-scheduler = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" }
Expand Down Expand Up @@ -224,10 +227,11 @@ sc-transaction_pool-api = { git = "https://github.com/paritytech/substrate", bra
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }
substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" }

# Benchmarking (with default disabled)
cumulus-pallet-session-benchmarking = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "release-v1.0.0" }

# Runtimes
polimec-parachain-runtime = { path = "runtimes/testnet" }
polimec-parachain-runtime = { path = "runtimes/testnet"}
polimec-base-runtime = { path = "runtimes/base" }
79 changes: 15 additions & 64 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ pallet-assets.workspace = true
polkadot-core-primitives.workspace = true
polkadot-runtime-parachains.workspace = true
polkadot-parachain.workspace = true
pallet-collective.workspace = true
pallet-elections-phragmen.workspace = true

cumulus-primitives-core.workspace = true
cumulus-pallet-xcm.workspace = true
Expand All @@ -61,6 +63,9 @@ orml-oracle.workspace = true
pallet-parachain-staking.workspace = true
pallet-vesting.workspace = true
itertools.workspace = true
pallet-democracy.workspace = true
pallet-scheduler.workspace = true
pallet-treasury.workspace = true

# Runtimes
polkadot-runtime.workspace = true
Expand All @@ -70,8 +75,11 @@ polimec-base-runtime.workspace = true
penpal-runtime = { path = "./penpal", default-features = false }

[features]
default = [ "std" ]

default = [ "instant-mode", "std" ]
instant-mode = [
"polimec-base-runtime/instant-mode",
"polimec-parachain-runtime/instant-mode",
]
std = [
"asset-hub-polkadot-runtime/std",
"cumulus-pallet-xcm/std",
Expand All @@ -83,13 +91,18 @@ std = [
"orml-oracle/std",
"pallet-assets/std",
"pallet-balances/std",
"pallet-collective/std",
"pallet-democracy/std",
"pallet-elections-phragmen/std",
"pallet-funding/std",
"pallet-im-online/std",
"pallet-linear-release/std",
"pallet-membership/std",
"pallet-message-queue/std",
"pallet-parachain-staking/std",
"pallet-scheduler/std",
"pallet-staking/std",
"pallet-treasury/std",
"pallet-vesting/std",
"pallet-xcm/std",
"parachain-info/std",
Expand Down Expand Up @@ -118,65 +131,3 @@ std = [
"xcm/std",
]

runtime-benchmarks = [
"asset-hub-polkadot-runtime/runtime-benchmarks",
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"itertools/use_alloc",
"pallet-assets/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-funding/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-linear-release/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-parachain-staking/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
"pallet-vesting/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"penpal-runtime/runtime-benchmarks",
"polimec-base-runtime/runtime-benchmarks",
"polimec-common/runtime-benchmarks",
"polimec-parachain-runtime/runtime-benchmarks",
"polimec-receiver/runtime-benchmarks",
"polkadot-parachain/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-runtime-parachains/runtime-benchmarks",
"polkadot-runtime/runtime-benchmarks",
"polkadot-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]
try-runtime = [
"asset-hub-polkadot-runtime/try-runtime",
"cumulus-pallet-xcm/try-runtime",
"cumulus-pallet-xcmp-queue/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"orml-oracle/try-runtime",
"pallet-assets/try-runtime",
"pallet-balances/try-runtime",
"pallet-funding/try-runtime",
"pallet-im-online/try-runtime",
"pallet-linear-release/try-runtime",
"pallet-membership/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-parachain-staking/try-runtime",
"pallet-staking/try-runtime",
"pallet-vesting/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"penpal-runtime/try-runtime",
"polimec-base-runtime/try-runtime",
"polimec-common/try-runtime",
"polimec-parachain-runtime/try-runtime",
"polimec-receiver/try-runtime",
"polkadot-runtime-parachains/try-runtime",
"polkadot-runtime/try-runtime",
"polkadot-service/try-runtime",
"sp-runtime/try-runtime",
]
fast-gov = [ "polimec-parachain-runtime/fast-gov" ]

2 changes: 1 addition & 1 deletion integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ with the latest chain specs to provide a realistic testing environment.

```bash
$ cd polimec-node/integration-tests/
$ cargo test --features std,fast-gov
$ cargo test
```
2 changes: 1 addition & 1 deletion integration-tests/penpal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ try-runtime = [
"pallet-vesting/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"polimec-common/try-runtime",
"polimec-receiver/try-runtime",
"polkadot-runtime-common/try-runtime",
"polkadot-runtime-parachains/try-runtime",
"sp-runtime/try-runtime",
"polimec-common/try-runtime"
]

0 comments on commit d8262d4

Please sign in to comment.