difftreelog
Merge pull request #1033 from UniqueNetwork/fix/enable-gov-on-unique
in: master
10 files changed
.github/workflows/governance.ymldiffbeforeafterboth--- a/.github/workflows/governance.yml
+++ b/.github/workflows/governance.yml
@@ -31,6 +31,7 @@
id: create_matrix
with:
matrix: |
+ network {unique}, wasm_name {unique}
network {quartz}, wasm_name {quartz}
network {opal}, wasm_name {opal}
network {sapphire}, wasm_name {quartz}
runtime/common/config/governance/identity.rsdiffbeforeafterboth--- /dev/null
+++ b/runtime/common/config/governance/identity.rs
@@ -0,0 +1,33 @@
+use frame_support::parameter_types;
+use up_common::constants::{MILLIUNIQUE, UNIQUE};
+
+use crate::{
+ runtime_common::config::governance, Balance, Balances, Runtime, RuntimeEvent, Treasury,
+};
+
+parameter_types! {
+ // These do not matter as we forbid non-gov operations with the identity pallet
+ pub const BasicDeposit: Balance = 10 * UNIQUE;
+ pub const FieldDeposit: Balance = 25 * MILLIUNIQUE;
+ pub const SubAccountDeposit: Balance = 2 * UNIQUE;
+ pub const MaxSubAccounts: u32 = 100;
+ pub const MaxAdditionalFields: u32 = 100;
+ pub const MaxRegistrars: u32 = 20;
+}
+
+impl pallet_identity::Config for Runtime {
+ type RuntimeEvent = RuntimeEvent;
+ type Currency = Balances;
+ type BasicDeposit = BasicDeposit;
+ type FieldDeposit = FieldDeposit;
+ type MaxAdditionalFields = MaxAdditionalFields;
+ type MaxRegistrars = MaxRegistrars;
+ type MaxSubAccounts = MaxSubAccounts;
+ type SubAccountDeposit = SubAccountDeposit;
+
+ type RegistrarOrigin = governance::RootOrTechnicalCommitteeMember;
+ type ForceOrigin = governance::RootOrTechnicalCommitteeMember;
+
+ type Slashed = Treasury;
+ type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;
+}
runtime/common/config/governance/mod.rsdiffbeforeafterboth--- a/runtime/common/config/governance/mod.rs
+++ b/runtime/common/config/governance/mod.rs
@@ -55,6 +55,8 @@
pub mod scheduler;
pub use scheduler::*;
+pub mod identity;
+
impl pallet_gov_origins::Config for Runtime {}
morph_types! {
runtime/common/config/pallets/collator_selection.rsdiffbeforeafterboth--- a/runtime/common/config/pallets/collator_selection.rs
+++ b/runtime/common/config/pallets/collator_selection.rs
@@ -22,14 +22,13 @@
CollatorSelectionLicenseBondOverride,
};
use sp_runtime::Perbill;
-use up_common::constants::{MILLIUNIQUE, UNIQUE};
#[cfg(feature = "governance")]
use crate::config::governance;
use crate::{
config::pallets::{MaxCollators, SessionPeriod, TreasuryAccountId},
Aura, Balance, Balances, BlockNumber, CollatorSelection, Runtime, RuntimeEvent,
- RuntimeHoldReason, Session, SessionKeys, Treasury,
+ RuntimeHoldReason, Session, SessionKeys,
};
parameter_types! {
pub const SessionOffset: BlockNumber = 0;
@@ -59,43 +58,9 @@
}
parameter_types! {
- // These do not matter as we forbid non-sudo operations with the identity pallet
- pub const BasicDeposit: Balance = 10 * UNIQUE;
- pub const FieldDeposit: Balance = 25 * MILLIUNIQUE;
- pub const SubAccountDeposit: Balance = 2 * UNIQUE;
- pub const MaxSubAccounts: u32 = 100;
- pub const MaxAdditionalFields: u32 = 100;
- pub const MaxRegistrars: u32 = 20;
- pub const LicenceBondIdentifier: [u8; 16] = *b"licenceidentifie";
pub LicenseBond: Balance = CollatorSelectionLicenseBondOverride::<Runtime>::get();
pub DesiredCollators: u32 = CollatorSelectionDesiredCollatorsOverride::<Runtime>::get();
pub KickThreshold: BlockNumber = CollatorSelectionKickThresholdOverride::<Runtime>::get();
-}
-
-impl pallet_identity::Config for Runtime {
- type RuntimeEvent = RuntimeEvent;
- type Currency = Balances;
- type BasicDeposit = BasicDeposit;
- type FieldDeposit = FieldDeposit;
- type MaxAdditionalFields = MaxAdditionalFields;
- type MaxRegistrars = MaxRegistrars;
- type MaxSubAccounts = MaxSubAccounts;
- type SubAccountDeposit = SubAccountDeposit;
-
- #[cfg(feature = "governance")]
- type RegistrarOrigin = governance::RootOrTechnicalCommitteeMember;
-
- #[cfg(feature = "governance")]
- type ForceOrigin = governance::RootOrTechnicalCommitteeMember;
-
- #[cfg(not(feature = "governance"))]
- type RegistrarOrigin = EnsureRoot<<Self as frame_system::Config>::AccountId>;
-
- #[cfg(not(feature = "governance"))]
- type ForceOrigin = EnsureRoot<<Self as frame_system::Config>::AccountId>;
-
- type Slashed = Treasury;
- type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;
}
parameter_types! {
runtime/common/construct_runtime.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime.rs
+++ b/runtime/common/construct_runtime.rs
@@ -50,7 +50,7 @@
Tokens: orml_tokens = 39,
// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
- #[cfg(feature = "collator-selection")]
+ #[cfg(feature = "governance")]
Identity: pallet_identity = 40,
#[cfg(feature = "preimage")]
runtime/common/identity.rsdiffbeforeafterboth--- a/runtime/common/identity.rs
+++ b/runtime/common/identity.rs
@@ -16,7 +16,7 @@
use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
-#[cfg(feature = "collator-selection")]
+#[cfg(feature = "governance")]
use sp_runtime::transaction_validity::InvalidTransaction;
use sp_runtime::{
traits::{DispatchInfoOf, SignedExtension},
@@ -59,7 +59,7 @@
_len: usize,
) -> TransactionValidity {
match call {
- #[cfg(feature = "collator-selection")]
+ #[cfg(feature = "governance")]
RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
_ => Ok(ValidTransaction::default()),
}
runtime/common/maintenance.rsdiffbeforeafterboth--- a/runtime/common/maintenance.rs
+++ b/runtime/common/maintenance.rs
@@ -78,9 +78,12 @@
}
#[cfg(feature = "collator-selection")]
- RuntimeCall::CollatorSelection(_)
- | RuntimeCall::Session(_)
- | RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
+ RuntimeCall::CollatorSelection(_) | RuntimeCall::Session(_) => {
+ Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
+ }
+
+ #[cfg(feature = "governance")]
+ RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
#[cfg(feature = "pallet-test-utils")]
RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
runtime/common/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -551,7 +551,7 @@
#[cfg(feature = "collator-selection")]
list_benchmark!(list, extra, pallet_collator_selection, CollatorSelection);
- #[cfg(feature = "collator-selection")]
+ #[cfg(feature = "governance")]
list_benchmark!(list, extra, pallet_identity, Identity);
#[cfg(feature = "foreign-assets")]
@@ -615,7 +615,7 @@
#[cfg(feature = "collator-selection")]
add_benchmark!(params, batches, pallet_collator_selection, CollatorSelection);
- #[cfg(feature = "collator-selection")]
+ #[cfg(feature = "governance")]
add_benchmark!(params, batches, pallet_identity, Identity);
#[cfg(feature = "foreign-assets")]
runtime/unique/Cargo.tomldiffbeforeafterboth1################################################################################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-collective/runtime-benchmarks',33 'pallet-common/runtime-benchmarks',34 'pallet-configuration/runtime-benchmarks',35 'pallet-democracy/runtime-benchmarks',36 'pallet-democracy/runtime-benchmarks',37 'pallet-ethereum/runtime-benchmarks',38 'pallet-evm-coder-substrate/runtime-benchmarks',39 'pallet-evm-migration/runtime-benchmarks',40 'pallet-foreign-assets/runtime-benchmarks',41 'pallet-fungible/runtime-benchmarks',42 'pallet-identity/runtime-benchmarks',43 'pallet-inflation/runtime-benchmarks',44 'pallet-maintenance/runtime-benchmarks',45 'pallet-membership/runtime-benchmarks',46 'pallet-membership/runtime-benchmarks',47 'pallet-nonfungible/runtime-benchmarks',48 'pallet-ranked-collective/runtime-benchmarks',49 'pallet-referenda/runtime-benchmarks',50 'pallet-refungible/runtime-benchmarks',51 'pallet-scheduler/runtime-benchmarks',52 'pallet-scheduler/runtime-benchmarks',53 'pallet-structure/runtime-benchmarks',54 'pallet-timestamp/runtime-benchmarks',55 'pallet-unique/runtime-benchmarks',56 'pallet-utility/runtime-benchmarks',57 'pallet-xcm/runtime-benchmarks',58 'sp-runtime/runtime-benchmarks',59 'staging-xcm-builder/runtime-benchmarks',60 'up-data-structs/runtime-benchmarks',61]62std = [63 'cumulus-pallet-aura-ext/std',64 'cumulus-pallet-parachain-system/std',65 'cumulus-pallet-xcm/std',66 'cumulus-pallet-xcmp-queue/std',67 'cumulus-primitives-core/std',68 'cumulus-primitives-utility/std',69 'frame-executive/std',70 'frame-support/std',71 'frame-system-rpc-runtime-api/std',72 'frame-system/std',73 'frame-try-runtime/std',74 'pallet-aura/std',75 'pallet-balances/std',76 'pallet-collective/std',77 'pallet-democracy/std',78 'pallet-membership/std',79 'pallet-scheduler/std',80 'parity-scale-codec/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-collective/std',101 'pallet-common/std',102 'pallet-configuration/std',103 'pallet-democracy/std',104 'pallet-ethereum/std',105 'pallet-evm-coder-substrate/std',106 'pallet-evm-contract-helpers/std',107 'pallet-evm-migration/std',108 'pallet-evm-transaction-payment/std',109 'pallet-evm/std',110 'pallet-fungible/std',111 'pallet-gov-origins/std',112 'pallet-inflation/std',113 'pallet-membership/std',114 'pallet-nonfungible/std',115 'pallet-ranked-collective/std',116 'pallet-referenda/std',117 'pallet-refungible/std',118 'pallet-scheduler/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 'pallet-utility/std',127 'parachain-info/std',128 'sp-api/std',129 'sp-block-builder/std',130 'sp-core/std',131 'sp-inherents/std',132 'sp-io/std',133 'sp-offchain/std',134 'sp-runtime/std',135 'sp-session/std',136 'sp-std/std',137 'sp-transaction-pool/std',138 'sp-version/std',139 'staging-xcm-builder/std',140 'staging-xcm-executor/std',141 'staging-xcm/std',142 'up-common/std',143 'up-data-structs/std',144 'up-pov-estimate-rpc/std',145 'up-rpc/std',146 'up-sponsorship/std',147148 "orml-tokens/std",149 "orml-traits/std",150 "orml-vesting/std",151 "orml-xcm-support/std",152 "orml-xtokens/std",153 "pallet-foreign-assets/std",154 "pallet-maintenance/std",155]156stubgen = ["evm-coder/stubgen"]157try-runtime = [158 "pallet-authorship/try-runtime",159 "pallet-collator-selection/try-runtime",160 "pallet-identity/try-runtime",161 "pallet-preimage/try-runtime",162 "pallet-session/try-runtime",163 "pallet-state-trie-migration/try-runtime",164 'cumulus-pallet-aura-ext/try-runtime',165 'cumulus-pallet-dmp-queue/try-runtime',166 'cumulus-pallet-parachain-system/try-runtime',167 'cumulus-pallet-xcm/try-runtime',168 'cumulus-pallet-xcmp-queue/try-runtime',169 'fp-self-contained/try-runtime',170 'frame-executive/try-runtime',171 'frame-support/try-runtime',172 'frame-system/try-runtime',173 'frame-try-runtime',174 'orml-tokens/try-runtime',175 'orml-vesting/try-runtime',176 'orml-xtokens/try-runtime',177 'pallet-app-promotion/try-runtime',178 'pallet-aura/try-runtime',179 'pallet-balances-adapter/try-runtime',180 'pallet-balances/try-runtime',181 'pallet-charge-transaction/try-runtime',182 'pallet-collective/try-runtime',183 'pallet-collective/try-runtime',184 'pallet-common/try-runtime',185 'pallet-configuration/try-runtime',186 'pallet-democracy/try-runtime',187 'pallet-democracy/try-runtime',188 'pallet-ethereum/try-runtime',189 'pallet-evm-coder-substrate/try-runtime',190 'pallet-evm-contract-helpers/try-runtime',191 'pallet-evm-migration/try-runtime',192 'pallet-evm-transaction-payment/try-runtime',193 'pallet-evm/try-runtime',194 'pallet-foreign-assets/try-runtime',195 'pallet-fungible/try-runtime',196 'pallet-gov-origins/try-runtime',197 'pallet-inflation/try-runtime',198 'pallet-maintenance/try-runtime',199 'pallet-membership/try-runtime',200 'pallet-membership/try-runtime',201 'pallet-nonfungible/try-runtime',202 'pallet-ranked-collective/try-runtime',203 'pallet-referenda/try-runtime',204 'pallet-refungible/try-runtime',205 'pallet-scheduler/try-runtime',206 'pallet-scheduler/try-runtime',207 'pallet-structure/try-runtime',208 'pallet-sudo/try-runtime',209 'pallet-timestamp/try-runtime',210 'pallet-transaction-payment/try-runtime',211 'pallet-treasury/try-runtime',212 'pallet-unique/try-runtime',213 'pallet-utility/try-runtime',214 'pallet-xcm/try-runtime',215 'parachain-info/try-runtime',216]217unique-runtime = ['app-promotion', 'foreign-assets', 'refungible']218219app-promotion = []220collator-selection = []221foreign-assets = []222gov-test-timings = []223governance = []224preimage = []225refungible = []226session-test-timings = []227228################################################################################229# local dependencies230231[dependencies]232cumulus-pallet-aura-ext = { workspace = true }233cumulus-pallet-dmp-queue = { workspace = true }234cumulus-pallet-parachain-system = { workspace = true }235cumulus-pallet-xcm = { workspace = true }236cumulus-pallet-xcmp-queue = { workspace = true }237cumulus-primitives-core = { workspace = true }238cumulus-primitives-timestamp = { workspace = true }239cumulus-primitives-utility = { workspace = true }240frame-executive = { workspace = true }241frame-support = { workspace = true }242frame-system = { workspace = true }243frame-system-rpc-runtime-api = { workspace = true }244orml-tokens = { workspace = true }245orml-traits = { workspace = true }246orml-vesting = { workspace = true }247orml-xcm-support = { workspace = true }248orml-xtokens = { workspace = true }249pallet-aura = { workspace = true }250pallet-authorship = { workspace = true }251pallet-balances = { features = ["insecure_zero_ed"], workspace = true }252pallet-preimage = { workspace = true }253pallet-session = { workspace = true }254pallet-state-trie-migration = { workspace = true }255pallet-sudo = { workspace = true }256pallet-timestamp = { workspace = true }257pallet-transaction-payment = { workspace = true }258pallet-transaction-payment-rpc-runtime-api = { workspace = true }259pallet-treasury = { workspace = true }260pallet-utility = { workspace = true }261pallet-xcm = { workspace = true }262parachain-info = { workspace = true }263parity-scale-codec = { workspace = true }264polkadot-parachain-primitives = { workspace = true }265smallvec = { workspace = true }266sp-api = { workspace = true }267sp-arithmetic = { workspace = true }268sp-block-builder = { workspace = true }269sp-consensus-aura = { workspace = true }270sp-core = { workspace = true }271sp-inherents = { workspace = true }272sp-io = { workspace = true }273sp-offchain = { workspace = true }274sp-runtime = { workspace = true }275sp-session = { workspace = true }276sp-std = { workspace = true }277sp-storage = { workspace = true }278sp-transaction-pool = { workspace = true }279sp-version = { workspace = true }280staging-xcm = { workspace = true }281staging-xcm-builder = { workspace = true }282staging-xcm-executor = { workspace = true }283284app-promotion-rpc = { workspace = true }285derivative = { workspace = true }286log = { workspace = true }287pallet-app-promotion = { workspace = true }288pallet-balances-adapter = { workspace = true }289pallet-collator-selection = { workspace = true }290pallet-collective = { workspace = true }291pallet-common = { workspace = true }292pallet-configuration = { workspace = true }293pallet-democracy = { workspace = true }294pallet-fungible = { workspace = true }295pallet-gov-origins = { workspace = true }296pallet-identity = { workspace = true }297pallet-inflation = { workspace = true }298pallet-membership = { workspace = true }299pallet-nonfungible = { workspace = true }300pallet-ranked-collective = { workspace = true }301pallet-referenda = { workspace = true }302pallet-refungible = { workspace = true }303pallet-scheduler = { workspace = true }304pallet-structure = { workspace = true }305pallet-unique = { workspace = true }306scale-info = { workspace = true }307up-common = { workspace = true }308up-data-structs = { workspace = true }309up-pov-estimate-rpc = { workspace = true }310up-rpc = { workspace = true }311# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }312evm-coder = { workspace = true }313fp-evm = { workspace = true }314fp-rpc = { workspace = true }315fp-self-contained = { workspace = true }316num_enum = { workspace = true }317pallet-base-fee = { workspace = true }318pallet-charge-transaction = { workspace = true }319pallet-ethereum = { workspace = true }320pallet-evm = { workspace = true }321pallet-evm-coder-substrate = { workspace = true }322pallet-evm-contract-helpers = { workspace = true }323pallet-evm-migration = { workspace = true }324pallet-evm-precompile-simple = { workspace = true }325pallet-evm-transaction-payment = { workspace = true }326pallet-foreign-assets = { workspace = true }327pallet-maintenance = { workspace = true }328precompile-utils-macro = { workspace = true }329up-sponsorship = { workspace = true }330331################################################################################332# Optional dependencies333334frame-benchmarking = { workspace = true, optional = true }335frame-system-benchmarking = { workspace = true, optional = true }336frame-try-runtime = { workspace = true, optional = true }337serde = { workspace = true, optional = true }338339################################################################################340# Test dependencies341342pallet-test-utils = { workspace = true }343344################################################################################345# Other Dependencies346347hex-literal = { workspace = true }348impl-trait-for-tuples = { workspace = true }349350[build-dependencies]351substrate-wasm-builder = { workspace = true }tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -68,7 +68,7 @@
const refungible = 'refungible';
const foreignAssets = 'foreignassets';
const appPromotion = 'apppromotion';
- const collatorSelection = ['authorship', 'session', 'collatorselection', 'identity'];
+ const collatorSelection = ['authorship', 'session', 'collatorselection'];
const preimage = ['preimage'];
const governance = [
'council',
@@ -80,6 +80,7 @@
'scheduler',
'technicalcommittee',
'technicalcommitteemembership',
+ 'identity',
];
const testUtils = 'testutils';
@@ -108,6 +109,8 @@
refungible,
foreignAssets,
appPromotion,
+ ...preimage,
+ ...governance,
);
}
});