difftreelog
fix enable governance on Unique
in: master
9 files changed
.github/workflows/governance.ymldiffbeforeafterboth30 uses: CertainLach/create-matrix-action@v430 uses: CertainLach/create-matrix-action@v431 id: create_matrix31 id: create_matrix32 with:32 with:33 matrix: |33 matrix: |34 network {quartz}, wasm_name {quartz}34 network {unique}, wasm_name {unique}35 network {quartz}, wasm_name {quartz}35 network {opal}, wasm_name {opal}36 network {opal}, wasm_name {opal}36 network {sapphire}, wasm_name {quartz}37 network {sapphire}, wasm_name {quartz}373838 dev_build_int_tests:39 dev_build_int_tests:39 needs: prepare-execution-marix40 needs: prepare-execution-marixruntime/common/config/governance/identity.rsdiffbeforeafterbothno changes
runtime/common/config/governance/mod.rsdiffbeforeafterboth55pub mod scheduler;55pub mod scheduler;56pub use scheduler::*;56pub use scheduler::*;5758pub mod identity;575958impl pallet_gov_origins::Config for Runtime {}60impl pallet_gov_origins::Config for Runtime {}5961runtime/common/config/pallets/collator_selection.rsdiffbeforeafterboth22 CollatorSelectionLicenseBondOverride,22 CollatorSelectionLicenseBondOverride,23};23};24use sp_runtime::Perbill;24use sp_runtime::Perbill;25use up_common::constants::{MILLIUNIQUE, UNIQUE};262527#[cfg(feature = "governance")]26#[cfg(feature = "governance")]28use crate::config::governance;27use crate::config::governance;29use crate::{28use crate::{30 config::pallets::{MaxCollators, SessionPeriod, TreasuryAccountId},29 config::pallets::{MaxCollators, SessionPeriod, TreasuryAccountId},31 Aura, Balance, Balances, BlockNumber, CollatorSelection, Runtime, RuntimeEvent,30 Aura, Balance, Balances, BlockNumber, CollatorSelection, Runtime, RuntimeEvent,32 RuntimeHoldReason, Session, SessionKeys, Treasury,31 RuntimeHoldReason, Session, SessionKeys,33};32};34parameter_types! {33parameter_types! {35 pub const SessionOffset: BlockNumber = 0;34 pub const SessionOffset: BlockNumber = 0;59}58}605961parameter_types! {60parameter_types! {62 // These do not matter as we forbid non-sudo operations with the identity pallet63 pub const BasicDeposit: Balance = 10 * UNIQUE;64 pub const FieldDeposit: Balance = 25 * MILLIUNIQUE;65 pub const SubAccountDeposit: Balance = 2 * UNIQUE;66 pub const MaxSubAccounts: u32 = 100;67 pub const MaxAdditionalFields: u32 = 100;68 pub const MaxRegistrars: u32 = 20;69 pub const LicenceBondIdentifier: [u8; 16] = *b"licenceidentifie";70 pub LicenseBond: Balance = CollatorSelectionLicenseBondOverride::<Runtime>::get();61 pub LicenseBond: Balance = CollatorSelectionLicenseBondOverride::<Runtime>::get();71 pub DesiredCollators: u32 = CollatorSelectionDesiredCollatorsOverride::<Runtime>::get();62 pub DesiredCollators: u32 = CollatorSelectionDesiredCollatorsOverride::<Runtime>::get();72 pub KickThreshold: BlockNumber = CollatorSelectionKickThresholdOverride::<Runtime>::get();63 pub KickThreshold: BlockNumber = CollatorSelectionKickThresholdOverride::<Runtime>::get();73}64}7475impl pallet_identity::Config for Runtime {76 type RuntimeEvent = RuntimeEvent;77 type Currency = Balances;78 type BasicDeposit = BasicDeposit;79 type FieldDeposit = FieldDeposit;80 type MaxAdditionalFields = MaxAdditionalFields;81 type MaxRegistrars = MaxRegistrars;82 type MaxSubAccounts = MaxSubAccounts;83 type SubAccountDeposit = SubAccountDeposit;8485 #[cfg(feature = "governance")]86 type RegistrarOrigin = governance::RootOrTechnicalCommitteeMember;8788 #[cfg(feature = "governance")]89 type ForceOrigin = governance::RootOrTechnicalCommitteeMember;9091 #[cfg(not(feature = "governance"))]92 type RegistrarOrigin = EnsureRoot<<Self as frame_system::Config>::AccountId>;9394 #[cfg(not(feature = "governance"))]95 type ForceOrigin = EnsureRoot<<Self as frame_system::Config>::AccountId>;9697 type Slashed = Treasury;98 type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;99}10065101parameter_types! {66parameter_types! {102 pub const PotId: PalletId = PalletId(*b"PotStake");67 pub const PotId: PalletId = PalletId(*b"PotStake");runtime/common/construct_runtime.rsdiffbeforeafterboth50 Tokens: orml_tokens = 39,50 Tokens: orml_tokens = 39,51 // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,51 // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,525253 #[cfg(feature = "collator-selection")]53 #[cfg(feature = "governance")]54 Identity: pallet_identity = 40,54 Identity: pallet_identity = 40,555556 #[cfg(feature = "preimage")]56 #[cfg(feature = "preimage")]runtime/common/identity.rsdiffbeforeafterboth161617use parity_scale_codec::{Decode, Encode};17use parity_scale_codec::{Decode, Encode};18use scale_info::TypeInfo;18use scale_info::TypeInfo;19#[cfg(feature = "collator-selection")]19#[cfg(feature = "governance")]20use sp_runtime::transaction_validity::InvalidTransaction;20use sp_runtime::transaction_validity::InvalidTransaction;21use sp_runtime::{21use sp_runtime::{22 traits::{DispatchInfoOf, SignedExtension},22 traits::{DispatchInfoOf, SignedExtension},59 _len: usize,59 _len: usize,60 ) -> TransactionValidity {60 ) -> TransactionValidity {61 match call {61 match call {62 #[cfg(feature = "collator-selection")]62 #[cfg(feature = "governance")]63 RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),63 RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),64 _ => Ok(ValidTransaction::default()),64 _ => Ok(ValidTransaction::default()),65 }65 }runtime/common/maintenance.rsdiffbeforeafterboth78 }78 }797980 #[cfg(feature = "collator-selection")]80 #[cfg(feature = "collator-selection")]81 RuntimeCall::CollatorSelection(_)81 RuntimeCall::CollatorSelection(_) | RuntimeCall::Session(_) => {82 | RuntimeCall::Session(_)82 Err(TransactionValidityError::Invalid(InvalidTransaction::Call))83 }8485 #[cfg(feature = "governance")]83 | RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),86 RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),848785 #[cfg(feature = "pallet-test-utils")]88 #[cfg(feature = "pallet-test-utils")]86 RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),89 RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),runtime/common/runtime_apis.rsdiffbeforeafterboth551 #[cfg(feature = "collator-selection")]551 #[cfg(feature = "collator-selection")]552 list_benchmark!(list, extra, pallet_collator_selection, CollatorSelection);552 list_benchmark!(list, extra, pallet_collator_selection, CollatorSelection);553553554 #[cfg(feature = "collator-selection")]554 #[cfg(feature = "governance")]555 list_benchmark!(list, extra, pallet_identity, Identity);555 list_benchmark!(list, extra, pallet_identity, Identity);556556557 #[cfg(feature = "foreign-assets")]557 #[cfg(feature = "foreign-assets")]615 #[cfg(feature = "collator-selection")]615 #[cfg(feature = "collator-selection")]616 add_benchmark!(params, batches, pallet_collator_selection, CollatorSelection);616 add_benchmark!(params, batches, pallet_collator_selection, CollatorSelection);617617618 #[cfg(feature = "collator-selection")]618 #[cfg(feature = "governance")]619 add_benchmark!(params, batches, pallet_identity, Identity);619 add_benchmark!(params, batches, pallet_identity, Identity);620620621 #[cfg(feature = "foreign-assets")]621 #[cfg(feature = "foreign-assets")]runtime/unique/Cargo.tomldiffbeforeafterboth214 'pallet-xcm/try-runtime',214 'pallet-xcm/try-runtime',215 'parachain-info/try-runtime',215 'parachain-info/try-runtime',216]216]217unique-runtime = ['app-promotion', 'foreign-assets', 'refungible']217unique-runtime = ['app-promotion', 'foreign-assets', 'refungible', 'governance', 'preimage']218218219app-promotion = []219app-promotion = []220collator-selection = []220collator-selection = []