git.delta.rocks / unique-network / refs/commits / 0e75cd977fe9

difftreelog

Merge pull request #978 from UniqueNetwork/fix/opal-governance-timings

Yaroslav Bolyukin2023-09-04parents: #c6d53cc #a797a1d.patch.diff
in: master

14 files changed

modified.docker/docker-compose.gov.j2diffbeforeafterboth
--- a/.docker/docker-compose.gov.j2
+++ b/.docker/docker-compose.gov.j2
@@ -21,4 +21,4 @@
       options:
         max-size: "1m"
         max-file: "3"
-    command: cargo run --release --features={{ NETWORK }}-runtime,{{ WASM_NAME }}-runtime/test-env -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
+    command: cargo run --release --features={{ NETWORK }}-runtime,{{ WASM_NAME }}-runtime/gov-test-timings -- --dev -linfo --rpc-cors=all --unsafe-rpc-external
modified.github/workflows/gov.ymldiffbeforeafterboth
--- a/.github/workflows/gov.yml
+++ b/.github/workflows/gov.yml
@@ -1,4 +1,4 @@
-# Governance tests in --dev mode with test-env feature enabled to reduce gov timings
+# Governance tests in --dev mode with gov-test-timings feature enabled to reduce gov timings
 name: governance tests
 
 # Triger: only call from main workflow(re-usable workflows)
modifiedruntime/common/config/governance/council.rsdiffbeforeafterboth
--- a/runtime/common/config/governance/council.rs
+++ b/runtime/common/config/governance/council.rs
@@ -5,10 +5,10 @@
 	pub CouncilMaxMembers: u32 = 100;
 }
 
-#[cfg(not(feature = "test-env"))]
+#[cfg(not(feature = "gov-test-timings"))]
 use crate::governance_timings::council as council_timings;
 
-#[cfg(feature = "test-env")]
+#[cfg(feature = "gov-test-timings")]
 pub mod council_timings {
 	use super::*;
 
modifiedruntime/common/config/governance/democracy.rsdiffbeforeafterboth
--- a/runtime/common/config/governance/democracy.rs
+++ b/runtime/common/config/governance/democracy.rs
@@ -7,10 +7,10 @@
 	pub MaxProposals: u32 = 100;
 }
 
-#[cfg(not(feature = "test-env"))]
+#[cfg(not(feature = "gov-test-timings"))]
 use crate::governance_timings::democracy as democracy_timings;
 
-#[cfg(feature = "test-env")]
+#[cfg(feature = "gov-test-timings")]
 pub mod democracy_timings {
 	use super::*;
 
modifiedruntime/common/config/governance/fellowship.rsdiffbeforeafterboth
--- a/runtime/common/config/governance/fellowship.rs
+++ b/runtime/common/config/governance/fellowship.rs
@@ -12,10 +12,10 @@
 	pub SubmissionDeposit: Balance = 1000;
 }
 
-#[cfg(not(feature = "test-env"))]
+#[cfg(not(feature = "gov-test-timings"))]
 use crate::governance_timings::fellowship as fellowship_timings;
 
-#[cfg(feature = "test-env")]
+#[cfg(feature = "gov-test-timings")]
 pub mod fellowship_timings {
 	use super::*;
 
modifiedruntime/common/config/governance/technical_committee.rsdiffbeforeafterboth
--- a/runtime/common/config/governance/technical_committee.rs
+++ b/runtime/common/config/governance/technical_committee.rs
@@ -5,10 +5,10 @@
 	pub TechnicalMaxMembers: u32 = 100;
 }
 
-#[cfg(not(feature = "test-env"))]
+#[cfg(not(feature = "gov-test-timings"))]
 use crate::governance_timings::technical_committee as technical_committee_timings;
 
-#[cfg(feature = "test-env")]
+#[cfg(feature = "gov-test-timings")]
 pub mod technical_committee_timings {
 	use super::*;
 
modifiedruntime/common/config/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/mod.rs
+++ b/runtime/common/config/mod.rs
@@ -25,5 +25,5 @@
 #[cfg(feature = "governance")]
 pub mod governance;
 
-#[cfg(feature = "test-env")]
+#[cfg(feature = "pallet-test-utils")]
 pub mod test_pallets;
modifiedruntime/common/construct_runtime.rsdiffbeforeafterboth
--- a/runtime/common/construct_runtime.rs
+++ b/runtime/common/construct_runtime.rs
@@ -136,7 +136,7 @@
 
 				BalancesAdapter: pallet_balances_adapter = 155,
 
-				#[cfg(feature = "test-env")]
+				#[cfg(feature = "pallet-test-utils")]
 				TestUtils: pallet_test_utils = 255,
 			}
 		}
modifiedruntime/common/maintenance.rsdiffbeforeafterboth
--- a/runtime/common/maintenance.rs
+++ b/runtime/common/maintenance.rs
@@ -85,7 +85,7 @@
 				| RuntimeCall::Session(_)
 				| RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
 
-				#[cfg(feature = "test-env")]
+				#[cfg(feature = "pallet-test-utils")]
 				RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
 
 				_ => Ok(ValidTransaction::default()),
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -23,7 +23,7 @@
 	'collator-selection',
 	'foreign-assets',
 	'governance',
-	'test-env',
+	'pallet-test-utils',
 	'preimage',
 	'refungible',
 ]
@@ -156,7 +156,7 @@
 	"pallet-foreign-assets/std",
 
 	'pallet-maintenance/std',
-	'pallet-test-utils/std',
+	'pallet-test-utils?/std',
 ]
 try-runtime = [
 	"pallet-authorship/try-runtime",
@@ -212,7 +212,7 @@
 	'pallet-scheduler/try-runtime',
 	'pallet-structure/try-runtime',
 	'pallet-sudo/try-runtime',
-	'pallet-test-utils/try-runtime',
+	'pallet-test-utils?/try-runtime',
 	'pallet-timestamp/try-runtime',
 	'pallet-transaction-payment/try-runtime',
 	'pallet-treasury/try-runtime',
@@ -226,7 +226,7 @@
 collator-selection = []
 foreign-assets = []
 governance = []
-test-env = []
+gov-test-timings = []
 preimage = []
 refungible = []
 unique-scheduler = []
@@ -345,7 +345,7 @@
 ################################################################################
 # Test dependencies
 
-pallet-test-utils = { workspace = true }
+pallet-test-utils = { workspace = true, optional = true }
 
 ################################################################################
 # Other Dependencies
addedruntime/opal/src/governance_timings.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/opal/src/governance_timings.rs
@@ -0,0 +1,54 @@
+use frame_support::parameter_types;
+pub use up_common::{
+	constants::{DAYS, HOURS, MINUTES},
+	types::BlockNumber,
+};
+
+pub mod council {
+	use super::*;
+
+	parameter_types! {
+		pub CouncilMotionDuration: BlockNumber = 1 * HOURS;
+	}
+}
+
+pub mod democracy {
+	use super::*;
+
+	parameter_types! {
+		pub LaunchPeriod: BlockNumber = 1 * HOURS;
+		pub VotingPeriod: BlockNumber = 1 * HOURS;
+		pub FastTrackVotingPeriod: BlockNumber = 10 * MINUTES;
+		pub EnactmentPeriod: BlockNumber = 5 * MINUTES;
+		pub CooloffPeriod: BlockNumber = 1 * HOURS;
+	}
+}
+
+pub mod fellowship {
+	use super::*;
+
+	parameter_types! {
+		pub UndecidingTimeout: BlockNumber = 1 * HOURS;
+	}
+
+	pub mod track {
+		use super::*;
+
+		pub mod democracy_proposals {
+			use super::*;
+
+			pub const PREPARE_PERIOD: BlockNumber = 5 * MINUTES;
+			pub const DECISION_PERIOD: BlockNumber = 1 * HOURS;
+			pub const CONFIRM_PERIOD: BlockNumber = 10 * MINUTES;
+			pub const MIN_ENACTMENT_PERIOD: BlockNumber = 1 * MINUTES;
+		}
+	}
+}
+
+pub mod technical_committee {
+	use super::*;
+
+	parameter_types! {
+		pub TechnicalMotionDuration: BlockNumber = 15 * MINUTES;
+	}
+}
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -38,6 +38,7 @@
 
 mod runtime_common;
 
+pub mod governance_timings;
 pub mod xcm_barrier;
 
 pub use runtime_common::*;
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -218,7 +218,7 @@
 preimage = []
 refungible = []
 unique-scheduler = []
-test-env = []
+gov-test-timings = []
 
 ################################################################################
 # local dependencies
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
after · runtime/unique/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Unique Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'unique-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version.workspace = true1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std', 'unique-runtime']20limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']21pov-estimate = []22runtime-benchmarks = [23	"pallet-preimage/runtime-benchmarks",24	'frame-benchmarking',25	'frame-support/runtime-benchmarks',26	'frame-system-benchmarking',27	'frame-system/runtime-benchmarks',28	'pallet-app-promotion/runtime-benchmarks',29	'pallet-balances/runtime-benchmarks',30	'pallet-collator-selection/runtime-benchmarks',31	'pallet-collective/runtime-benchmarks',32	'pallet-common/runtime-benchmarks',33	'pallet-configuration/runtime-benchmarks',34	'pallet-democracy/runtime-benchmarks',35	'pallet-ethereum/runtime-benchmarks',36	'pallet-evm-coder-substrate/runtime-benchmarks',37	'pallet-evm-migration/runtime-benchmarks',38	'pallet-foreign-assets/runtime-benchmarks',39	'pallet-fungible/runtime-benchmarks',40	'pallet-identity/runtime-benchmarks',41	'pallet-inflation/runtime-benchmarks',42	'pallet-maintenance/runtime-benchmarks',43	'pallet-membership/runtime-benchmarks',44	'pallet-nonfungible/runtime-benchmarks',45	'pallet-democracy/runtime-benchmarks',46	'pallet-collective/runtime-benchmarks',47	'pallet-ranked-collective/runtime-benchmarks',48	'pallet-membership/runtime-benchmarks',49	'pallet-referenda/runtime-benchmarks',50	'pallet-scheduler/runtime-benchmarks',51	'pallet-refungible/runtime-benchmarks',52	'pallet-scheduler/runtime-benchmarks',53	'pallet-structure/runtime-benchmarks',54	'pallet-timestamp/runtime-benchmarks',55	'pallet-unique/runtime-benchmarks',56	'pallet-xcm/runtime-benchmarks',57	'sp-runtime/runtime-benchmarks',58	'up-data-structs/runtime-benchmarks',59	'xcm-builder/runtime-benchmarks',60]61state-version-0 = []62std = [63	'codec/std',64	'cumulus-pallet-aura-ext/std',65	'cumulus-pallet-parachain-system/std',66	'cumulus-pallet-xcm/std',67	'cumulus-pallet-xcmp-queue/std',68	'cumulus-primitives-core/std',69	'cumulus-primitives-utility/std',70	'frame-executive/std',71	'frame-support/std',72	'frame-system-rpc-runtime-api/std',73	'frame-system/std',74	'frame-try-runtime/std',75	'pallet-aura/std',76	'pallet-balances/std',77	'pallet-collective/std',78	'pallet-democracy/std',79	'pallet-membership/std',80	'pallet-scheduler/std',81	# 'pallet-contracts/std',82	# 'pallet-contracts-primitives/std',83	# 'pallet-contracts-rpc-runtime-api/std',84	# 'pallet-contract-helpers/std',85	"pallet-authorship/std",86	"pallet-identity/std",87	"pallet-preimage/std",88	"pallet-session/std",89	"pallet-state-trie-migration/std",90	"sp-consensus-aura/std",91	'app-promotion-rpc/std',92	'evm-coder/std',93	'fp-rpc/std',94	'fp-self-contained/std',95	'pallet-app-promotion/std',96	'pallet-balances-adapter/std',97	'pallet-base-fee/std',98	'pallet-charge-transaction/std',99	'pallet-collator-selection/std',100	'pallet-common/std',101	'pallet-configuration/std',102	'pallet-ethereum/std',103	'pallet-evm-coder-substrate/std',104	'pallet-evm-contract-helpers/std',105	'pallet-evm-migration/std',106	'pallet-evm-transaction-payment/std',107	'pallet-evm/std',108	'pallet-fungible/std',109	'pallet-inflation/std',110	'pallet-nonfungible/std',111	'pallet-democracy/std',112	'pallet-collective/std',113	'pallet-ranked-collective/std',114	'pallet-membership/std',115	'pallet-referenda/std',116	'pallet-gov-origins/std',117	'pallet-scheduler/std',118	'pallet-refungible/std',119	'pallet-structure/std',120	'pallet-sudo/std',121	'pallet-timestamp/std',122	'pallet-transaction-payment-rpc-runtime-api/std',123	'pallet-transaction-payment/std',124	'pallet-treasury/std',125	'pallet-unique/std',126	'parachain-info/std',127	'sp-api/std',128	'sp-block-builder/std',129	'sp-core/std',130	'sp-inherents/std',131	'sp-io/std',132	'sp-offchain/std',133	'sp-runtime/std',134	'sp-session/std',135	'sp-std/std',136	'sp-transaction-pool/std',137	'sp-version/std',138	'up-common/std',139	'up-data-structs/std',140	'up-pov-estimate-rpc/std',141	'up-rpc/std',142	'up-sponsorship/std',143	'xcm-builder/std',144	'xcm-executor/std',145	'xcm/std',146147	"orml-tokens/std",148	"orml-traits/std",149	"orml-vesting/std",150	"orml-xcm-support/std",151	"orml-xtokens/std",152	"pallet-foreign-assets/std",153	"pallet-maintenance/std",154]155stubgen = ["evm-coder/stubgen"]156try-runtime = [157	"pallet-authorship/try-runtime",158	"pallet-collator-selection/try-runtime",159	"pallet-identity/try-runtime",160	"pallet-preimage/try-runtime",161	"pallet-session/try-runtime",162	"pallet-state-trie-migration/try-runtime",163	'cumulus-pallet-aura-ext/try-runtime',164	'cumulus-pallet-dmp-queue/try-runtime',165	'cumulus-pallet-parachain-system/try-runtime',166	'cumulus-pallet-xcm/try-runtime',167	'cumulus-pallet-xcmp-queue/try-runtime',168	'fp-self-contained/try-runtime',169	'frame-executive/try-runtime',170	'frame-support/try-runtime',171	'frame-system/try-runtime',172	'frame-try-runtime',173	'orml-tokens/try-runtime',174	'orml-vesting/try-runtime',175	'orml-xtokens/try-runtime',176	'pallet-app-promotion/try-runtime',177	'pallet-aura/try-runtime',178	'pallet-balances-adapter/try-runtime',179	'pallet-balances/try-runtime',180	'pallet-charge-transaction/try-runtime',181	'pallet-collective/try-runtime',182	'pallet-common/try-runtime',183	'pallet-configuration/try-runtime',184	'pallet-democracy/try-runtime',185	'pallet-ethereum/try-runtime',186	'pallet-evm-coder-substrate/try-runtime',187	'pallet-evm-contract-helpers/try-runtime',188	'pallet-evm-migration/try-runtime',189	'pallet-evm-transaction-payment/try-runtime',190	'pallet-evm/try-runtime',191	'pallet-foreign-assets/try-runtime',192	'pallet-fungible/try-runtime',193	'pallet-inflation/try-runtime',194	'pallet-maintenance/try-runtime',195	'pallet-membership/try-runtime',196	'pallet-nonfungible/try-runtime',197	'pallet-democracy/try-runtime',198	'pallet-collective/try-runtime',199	'pallet-ranked-collective/try-runtime',200	'pallet-membership/try-runtime',201	'pallet-referenda/try-runtime',202	'pallet-gov-origins/try-runtime',203	'pallet-scheduler/try-runtime',204	'pallet-refungible/try-runtime',205	'pallet-scheduler/try-runtime',206	'pallet-structure/try-runtime',207	'pallet-sudo/try-runtime',208	'pallet-timestamp/try-runtime',209	'pallet-transaction-payment/try-runtime',210	'pallet-treasury/try-runtime',211	'pallet-unique/try-runtime',212	'pallet-xcm/try-runtime',213	'parachain-info/try-runtime',214]215unique-runtime = ['app-promotion', 'foreign-assets', 'refungible']216217app-promotion = []218collator-selection = []219foreign-assets = []220governance = []221preimage = []222refungible = []223unique-scheduler = []224gov-test-timings = []225226################################################################################227# local dependencies228229[dependencies]230# Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it.231codec = { workspace = true, package = "parity-scale-codec" }232233cumulus-pallet-aura-ext = { workspace = true }234cumulus-pallet-dmp-queue = { workspace = true }235cumulus-pallet-parachain-system = { workspace = true }236cumulus-pallet-xcm = { workspace = true }237cumulus-pallet-xcmp-queue = { workspace = true }238cumulus-primitives-core = { workspace = true }239cumulus-primitives-timestamp = { workspace = true }240cumulus-primitives-utility = { workspace = true }241frame-executive = { workspace = true }242frame-support = { workspace = true }243frame-system = { workspace = true }244frame-system-rpc-runtime-api = { workspace = true }245orml-tokens = { workspace = true }246orml-traits = { workspace = true }247orml-vesting = { workspace = true }248orml-xcm-support = { workspace = true }249orml-xtokens = { workspace = true }250pallet-aura = { workspace = true }251pallet-authorship = { workspace = true }252pallet-balances = { features = ["insecure_zero_ed"], workspace = true }253pallet-preimage = { workspace = true }254pallet-session = { workspace = true }255pallet-state-trie-migration = { workspace = true }256pallet-sudo = { workspace = true }257pallet-timestamp = { workspace = true }258pallet-transaction-payment = { workspace = true }259pallet-transaction-payment-rpc-runtime-api = { workspace = true }260pallet-treasury = { workspace = true }261pallet-xcm = { workspace = true }262parachain-info = { workspace = true }263polkadot-parachain = { workspace = true }264smallvec = { workspace = true }265sp-api = { workspace = true }266sp-arithmetic = { workspace = true }267sp-block-builder = { workspace = true }268sp-consensus-aura = { workspace = true }269sp-core = { workspace = true }270sp-inherents = { workspace = true }271sp-io = { workspace = true }272sp-offchain = { workspace = true }273sp-runtime = { workspace = true }274sp-session = { workspace = true }275sp-std = { workspace = true }276sp-transaction-pool = { workspace = true }277sp-version = { workspace = true }278xcm = { workspace = true }279xcm-builder = { workspace = true }280xcm-executor = { workspace = true }281282app-promotion-rpc = { workspace = true }283derivative = { workspace = true }284log = { workspace = true }285pallet-app-promotion = { workspace = true }286pallet-balances-adapter = { workspace = true }287pallet-collator-selection = { workspace = true }288pallet-common = { workspace = true }289pallet-configuration = { workspace = true }290pallet-fungible = { workspace = true }291pallet-identity = { workspace = true }292pallet-inflation = { workspace = true }293pallet-nonfungible = { workspace = true }294pallet-democracy = { workspace = true }295pallet-collective = { workspace = true }296pallet-ranked-collective = { workspace = true }297pallet-membership = { workspace = true }298pallet-referenda = { workspace = true }299pallet-gov-origins = { workspace = true }300pallet-scheduler = { workspace = true }301pallet-refungible = { workspace = true }302pallet-structure = { workspace = true }303pallet-unique = { workspace = true }304scale-info = { workspace = true }305up-common = { workspace = true }306up-data-structs = { workspace = true }307up-pov-estimate-rpc = { workspace = true }308up-rpc = { workspace = true }309# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }310evm-coder = { workspace = true }311fp-evm = { workspace = true }312fp-rpc = { workspace = true }313fp-self-contained = { workspace = true }314num_enum = { workspace = true }315pallet-base-fee = { workspace = true }316pallet-charge-transaction = { workspace = true }317pallet-ethereum = { workspace = true }318pallet-evm = { workspace = true }319pallet-evm-coder-substrate = { workspace = true }320pallet-evm-contract-helpers = { workspace = true }321pallet-evm-migration = { workspace = true }322pallet-evm-precompile-simple = { workspace = true }323pallet-evm-transaction-payment = { workspace = true }324pallet-foreign-assets = { workspace = true }325pallet-maintenance = { workspace = true }326precompile-utils-macro = { workspace = true }327up-sponsorship = { workspace = true }328329################################################################################330# Optional dependencies331332frame-benchmarking = { workspace = true, optional = true }333frame-system-benchmarking = { workspace = true, optional = true }334frame-try-runtime = { workspace = true, optional = true }335serde = { workspace = true, optional = true }336337################################################################################338# Test dependencies339340pallet-test-utils = { workspace = true }341342################################################################################343# Other Dependencies344345hex-literal = { workspace = true }346impl-trait-for-tuples = { workspace = true }347348[build-dependencies]349substrate-wasm-builder = { workspace = true }