git.delta.rocks / unique-network / refs/commits / 15ea50e38a6d

difftreelog

feat add financial council

Daniel Shiposha2024-03-26parent: #470ffd5.patch.diff
in: master

8 files changed

modifiedpallets/foreign-assets/src/lib.rsdiffbeforeafterboth
--- a/pallets/foreign-assets/src/lib.rs
+++ b/pallets/foreign-assets/src/lib.rs
@@ -68,7 +68,7 @@
 		type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
 
 		/// Origin for force registering of a foreign asset.
-		type ForceRegisterOrigin: EnsureOrigin<Self::RuntimeOrigin>;
+		type ManagerOrigin: EnsureOrigin<Self::RuntimeOrigin>;
 
 		/// The ID of the foreign assets pallet.
 		type PalletId: Get<PalletId>;
@@ -154,7 +154,7 @@
 			token_prefix: CollectionTokenPrefix,
 			mode: ForeignCollectionMode,
 		) -> DispatchResult {
-			T::ForceRegisterOrigin::ensure_origin(origin.clone())?;
+			T::ManagerOrigin::ensure_origin(origin.clone())?;
 
 			let asset_id: AssetId = versioned_asset_id
 				.as_ref()
addedruntime/common/config/governance/financial_council.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/common/config/governance/financial_council.rs
@@ -0,0 +1,56 @@
+use super::*;
+
+parameter_types! {
+	pub FinancialCouncilMaxProposals: u32 = 100;
+	pub FinancialCouncilMaxMembers: u32 = 100;
+}
+
+#[cfg(not(feature = "gov-test-timings"))]
+use crate::governance_timings::financial_council as financial_council_timings;
+
+#[cfg(feature = "gov-test-timings")]
+pub mod financial_council_timings {
+	use super::*;
+
+	parameter_types! {
+		pub FinancialCouncilMotionDuration: BlockNumber = 35;
+	}
+}
+
+pub type FinancialCollective = pallet_collective::Instance3;
+impl pallet_collective::Config<FinancialCollective> for Runtime {
+	type RuntimeOrigin = RuntimeOrigin;
+	type Proposal = RuntimeCall;
+	type RuntimeEvent = RuntimeEvent;
+	type MotionDuration = financial_council_timings::FinancialCouncilMotionDuration;
+	type MaxProposals = FinancialCouncilMaxProposals;
+	type MaxMembers = FinancialCouncilMaxMembers;
+	type DefaultVote = pallet_collective::PrimeDefaultVote;
+	type WeightInfo = pallet_collective::weights::SubstrateWeight<Runtime>;
+	type SetMembersOrigin = EnsureRoot<AccountId>;
+	type MaxProposalWeight = MaxCollectivesProposalWeight;
+}
+
+pub type FinancialCollectiveMembership = pallet_membership::Instance3;
+impl pallet_membership::Config<FinancialCollectiveMembership> for Runtime {
+	type RuntimeEvent = RuntimeEvent;
+	type AddOrigin = RootOrMoreThanHalfCouncil;
+	type RemoveOrigin = RootOrMoreThanHalfCouncil;
+	type SwapOrigin = RootOrMoreThanHalfCouncil;
+	type ResetOrigin = EnsureRoot<AccountId>;
+	type PrimeOrigin = RootOrMoreThanHalfCouncil;
+	type MembershipInitialized = TechnicalCommittee;
+	type MembershipChanged = TechnicalCommittee;
+	type MaxMembers = FinancialCouncilMaxMembers;
+	type WeightInfo = pallet_membership::weights::SubstrateWeight<Runtime>;
+}
+
+pub type FinancialCouncilMember = pallet_collective::EnsureMember<AccountId, FinancialCollective>;
+
+pub type RootOrFinancialCouncilMember =
+	EitherOfDiverse<EnsureRoot<AccountId>, FinancialCouncilMember>;
+
+pub type AllFinancialCouncil =
+	pallet_collective::EnsureProportionAtLeast<AccountId, FinancialCollective, 1, 1>;
+
+pub type RootOrAllFinancialCouncil = EitherOfDiverse<EnsureRoot<AccountId>, AllFinancialCouncil>;
modifiedruntime/common/config/governance/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/governance/mod.rs
+++ b/runtime/common/config/governance/mod.rs
@@ -49,6 +49,9 @@
 pub mod technical_committee;
 pub use technical_committee::*;
 
+pub mod financial_council;
+pub use financial_council::*;
+
 pub mod fellowship;
 pub use fellowship::*;
 
modifiedruntime/common/config/pallets/foreign_asset.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/foreign_asset.rs
+++ b/runtime/common/config/pallets/foreign_asset.rs
@@ -40,10 +40,10 @@
 	type RuntimeEvent = RuntimeEvent;
 
 	#[cfg(feature = "governance")]
-	type ForceRegisterOrigin = governance::RootOrTechnicalCommitteeMember;
+	type ManagerOrigin = governance::RootOrFinancialCouncilMember;
 
 	#[cfg(not(feature = "governance"))]
-	type ForceRegisterOrigin = EnsureRoot<Self::AccountId>;
+	type ManagerOrigin = EnsureRoot<Self::AccountId>;
 
 	type PalletId = ForeignAssetPalletId;
 	type SelfLocation = SelfLocation;
modifiedruntime/common/construct_runtime.rsdiffbeforeafterboth
before · runtime/common/construct_runtime.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#[macro_export]18macro_rules! construct_runtime {19	() => {20		frame_support::construct_runtime! {2122			pub enum Runtime {23				System: frame_system = 0,24				StateTrieMigration: pallet_state_trie_migration = 1,2526				ParachainSystem: cumulus_pallet_parachain_system = 20,27				ParachainInfo: staging_parachain_info = 21,2829				#[cfg(feature = "collator-selection")]30				Authorship: pallet_authorship = 22,3132				#[cfg(feature = "collator-selection")]33				CollatorSelection: pallet_collator_selection = 23,3435				#[cfg(feature = "collator-selection")]36				Session: pallet_session = 24,3738				Aura: pallet_aura = 25,39				AuraExt: cumulus_pallet_aura_ext = 26,4041				Balances: pallet_balances = 30,42				// RandomnessCollectiveFlip = 3143				Timestamp: pallet_timestamp = 32,44				TransactionPayment: pallet_transaction_payment = 33,45				Treasury: pallet_treasury = 34,46				Sudo: pallet_sudo = 35,47				Vesting: orml_vesting = 37,4849				XTokens: orml_xtokens = 38,50				// [REMOVED] Tokens: orml_tokens = 39,51				// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,5253				#[cfg(feature = "governance")]54				Identity: pallet_identity = 40,5556				#[cfg(feature = "preimage")]57				Preimage: pallet_preimage = 41,5859				#[cfg(feature = "governance")]60				Democracy: pallet_democracy = 42,6162				#[cfg(feature = "governance")]63				Council: pallet_collective::<Instance1> = 43,6465				#[cfg(feature = "governance")]66				TechnicalCommittee: pallet_collective::<Instance2> = 44,6768				#[cfg(feature = "governance")]69				CouncilMembership: pallet_membership::<Instance1> = 45,7071				#[cfg(feature = "governance")]72				TechnicalCommitteeMembership: pallet_membership::<Instance2> = 46,7374				#[cfg(feature = "governance")]75				FellowshipCollective: pallet_ranked_collective = 47,7677				#[cfg(feature = "governance")]78				FellowshipReferenda: pallet_referenda = 48,7980				#[cfg(feature = "governance")]81				Scheduler: pallet_scheduler = 49,8283				#[cfg(feature = "governance")]84				Origins: pallet_gov_origins = 99,8586				// XCM helpers.87				XcmpQueue: cumulus_pallet_xcmp_queue = 50,88				PolkadotXcm: pallet_xcm = 51,89				CumulusXcm: cumulus_pallet_xcm = 52,90				DmpQueue: cumulus_pallet_dmp_queue = 53,91				MessageQueue: pallet_message_queue = 54,9293				// Unique Pallets94				Inflation: pallet_inflation = 60,95				Unique: pallet_unique::{Pallet, Call, Storage} = 61,9697				// #[cfg(feature = "scheduler")]98				// UniqueScheduler: pallet_unique_scheduler_v2 = 62,99100				Configuration: pallet_configuration = 63,101102				Charging: pallet_charge_transaction = 64,103				// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,104				Common: pallet_common = 66,105				Fungible: pallet_fungible = 67,106107				#[cfg(feature = "refungible")]108				Refungible: pallet_refungible = 68,109110				Nonfungible: pallet_nonfungible = 69,111				Structure: pallet_structure = 70,112113				// RmrkCore: pallet_proxy_rmrk_core = 71,114115				// RmrkEquip: pallet_proxy_rmrk_equip = 72,116117				#[cfg(feature = "app-promotion")]118				AppPromotion: pallet_app_promotion = 73,119120				#[cfg(feature = "foreign-assets")]121				ForeignAssets: pallet_foreign_assets = 80,122123				// Frontier124				EVM: pallet_evm = 100,125				Ethereum: pallet_ethereum = 101,126127				EvmCoderSubstrate: pallet_evm_coder_substrate = 150,128				EvmContractHelpers: pallet_evm_contract_helpers = 151,129				EvmTransactionPayment: pallet_evm_transaction_payment = 152,130				EvmMigration: pallet_evm_migration = 153,131132				Maintenance: pallet_maintenance = 154,133134				BalancesAdapter: pallet_balances_adapter = 155,135136				Utility: pallet_utility = 156,137138				#[cfg(feature = "pallet-test-utils")]139				TestUtils: pallet_test_utils = 255,140			}141		}142	};143}
modifiedruntime/opal/src/governance_timings.rsdiffbeforeafterboth
--- a/runtime/opal/src/governance_timings.rs
+++ b/runtime/opal/src/governance_timings.rs
@@ -52,3 +52,11 @@
 		pub TechnicalMotionDuration: BlockNumber = 15 * MINUTES;
 	}
 }
+
+pub mod financial_council {
+	use super::*;
+
+	parameter_types! {
+		pub FinancialCouncilMotionDuration: BlockNumber = 15 * MINUTES;
+	}
+}
modifiedruntime/quartz/src/governance_timings.rsdiffbeforeafterboth
--- a/runtime/quartz/src/governance_timings.rs
+++ b/runtime/quartz/src/governance_timings.rs
@@ -52,3 +52,11 @@
 		pub TechnicalMotionDuration: BlockNumber = 3 * DAYS;
 	}
 }
+
+pub mod financial_council {
+	use super::*;
+
+	parameter_types! {
+		pub FinancialCouncilMotionDuration: BlockNumber = 3 * DAYS;
+	}
+}
modifiedruntime/unique/src/governance_timings.rsdiffbeforeafterboth
--- a/runtime/unique/src/governance_timings.rs
+++ b/runtime/unique/src/governance_timings.rs
@@ -52,3 +52,11 @@
 		pub TechnicalMotionDuration: BlockNumber = 3 * DAYS;
 	}
 }
+
+pub mod financial_council {
+	use super::*;
+
+	parameter_types! {
+		pub FinancialCouncilMotionDuration: BlockNumber = 3 * DAYS;
+	}
+}