Skip to content

Commit dc2c81d

Browse files
committed
Remove pallet-identity
1 parent 8f94bff commit dc2c81d

File tree

8 files changed

+0
-250
lines changed

8 files changed

+0
-250
lines changed

Cargo.lock

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot
8989
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false }
9090
pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false }
9191
pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false }
92-
pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false }
9392
pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false }
9493
pallet-vesting = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503", default-features = false }
9594
sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", tag = "polkadot-stable2503" }

runtime/common/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ sp-runtime = { workspace = true, default-features = false }
2626
sp-core = { workspace = true, default-features = false }
2727
sp-std = { workspace = true, default-features = false }
2828
pallet-balances = { workspace = true, default-features = false }
29-
pallet-identity = { workspace = true, default-features = false }
3029
xcm = { workspace = true, default-features = false }
3130

3231
parachains-common = { workspace = true, default-features = false }
@@ -40,7 +39,6 @@ account = { workspace = true }
4039
default = ["std"]
4140
std = [
4241
"account/std",
43-
"pallet-identity/std",
4442
"frame-support/std",
4543
"frame-system/std",
4644
"sp-runtime/std",

runtime/common/src/lib.rs

Lines changed: 0 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#![cfg_attr(not(feature = "std"), no_std)]
22

33
extern crate alloc;
4-
use enumflags2::{bitflags, BitFlags};
54
use frame_support::weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight};
6-
use frame_support::{CloneNoBound, EqNoBound, PartialEqNoBound, RuntimeDebugNoBound};
7-
use pallet_identity::{Data, IdentityInformationProvider};
85
use parity_scale_codec::{Decode, DecodeWithMemTracking, Encode, MaxEncodedLen};
96
use scale_info::TypeInfo;
107
use sp_core::{Pair, Public, U256};
11-
use sp_runtime::RuntimeDebug;
12-
#[cfg(feature = "runtime-benchmarks")]
13-
use sp_std::vec;
148

159
use sp_runtime::{
1610
traits::{IdentifyAccount, Verify},
@@ -119,170 +113,3 @@ where
119113
pub fn get_collator_keys_from_seed(seed: &str) -> AuraId {
120114
get_from_seed::<AuraId>(seed)
121115
}
122-
123-
/// The fields that we use to identify the owner of an account with. Each corresponds to a field
124-
/// in the `IdentityInfo` struct.
125-
#[bitflags]
126-
#[repr(u64)]
127-
#[derive(Clone, Copy, PartialEq, Eq, RuntimeDebug)]
128-
pub enum IdentityField {
129-
Display,
130-
Legal,
131-
Web,
132-
Matrix,
133-
Email,
134-
PgpFingerprint,
135-
Image,
136-
Twitter,
137-
GitHub,
138-
Discord,
139-
}
140-
141-
/// Information concerning the identity of the controller of an account.
142-
#[derive(
143-
CloneNoBound,
144-
Encode,
145-
Decode,
146-
DecodeWithMemTracking,
147-
EqNoBound,
148-
MaxEncodedLen,
149-
PartialEqNoBound,
150-
RuntimeDebugNoBound,
151-
TypeInfo,
152-
)]
153-
#[codec(mel_bound())]
154-
pub struct IdentityInfo {
155-
/// A reasonable display name for the controller of the account. This should be whatever the
156-
/// account is typically known as and should not be confusable with other entities, given
157-
/// reasonable context.
158-
///
159-
/// Stored as UTF-8.
160-
pub display: Data,
161-
162-
/// The full legal name in the local jurisdiction of the entity. This might be a bit
163-
/// long-winded.
164-
///
165-
/// Stored as UTF-8.
166-
pub legal: Data,
167-
168-
/// A representative website held by the controller of the account.
169-
///
170-
/// NOTE: `https://` is automatically prepended.
171-
///
172-
/// Stored as UTF-8.
173-
pub web: Data,
174-
175-
/// The Matrix (e.g. for Element) handle held by the controller of the account. Previously,
176-
/// this was called `riot`.
177-
///
178-
/// Stored as UTF-8.
179-
pub matrix: Data,
180-
181-
/// The email address of the controller of the account.
182-
///
183-
/// Stored as UTF-8.
184-
pub email: Data,
185-
186-
/// The PGP/GPG public key of the controller of the account.
187-
pub pgp_fingerprint: Option<[u8; 20]>,
188-
189-
/// A graphic image representing the controller of the account. Should be a company,
190-
/// organization or project logo or a headshot in the case of a human.
191-
pub image: Data,
192-
193-
/// The Twitter identity. The leading `@` character may be elided.
194-
pub twitter: Data,
195-
196-
/// The GitHub username of the controller of the account.
197-
pub github: Data,
198-
199-
/// The Discord username of the controller of the account.
200-
pub discord: Data,
201-
}
202-
203-
impl IdentityInformationProvider for IdentityInfo {
204-
type FieldsIdentifier = u64;
205-
206-
fn has_identity(&self, fields: Self::FieldsIdentifier) -> bool {
207-
self.fields().bits() & fields == fields
208-
}
209-
210-
#[cfg(feature = "runtime-benchmarks")]
211-
fn create_identity_info() -> Self {
212-
let data = Data::Raw(vec![0; 32].try_into().unwrap());
213-
214-
IdentityInfo {
215-
display: data.clone(),
216-
legal: data.clone(),
217-
web: data.clone(),
218-
matrix: data.clone(),
219-
email: data.clone(),
220-
pgp_fingerprint: Some([0; 20]),
221-
image: data.clone(),
222-
twitter: data.clone(),
223-
github: data.clone(),
224-
discord: data,
225-
}
226-
}
227-
228-
#[cfg(feature = "runtime-benchmarks")]
229-
fn all_fields() -> Self::FieldsIdentifier {
230-
use enumflags2::BitFlag;
231-
IdentityField::all().bits()
232-
}
233-
}
234-
235-
impl IdentityInfo {
236-
pub(crate) fn fields(&self) -> BitFlags<IdentityField> {
237-
let mut res = <BitFlags<IdentityField>>::empty();
238-
if !self.display.is_none() {
239-
res.insert(IdentityField::Display);
240-
}
241-
if !self.legal.is_none() {
242-
res.insert(IdentityField::Legal);
243-
}
244-
if !self.web.is_none() {
245-
res.insert(IdentityField::Web);
246-
}
247-
if !self.matrix.is_none() {
248-
res.insert(IdentityField::Matrix);
249-
}
250-
if !self.email.is_none() {
251-
res.insert(IdentityField::Email);
252-
}
253-
if self.pgp_fingerprint.is_some() {
254-
res.insert(IdentityField::PgpFingerprint);
255-
}
256-
if !self.image.is_none() {
257-
res.insert(IdentityField::Image);
258-
}
259-
if !self.twitter.is_none() {
260-
res.insert(IdentityField::Twitter);
261-
}
262-
if !self.github.is_none() {
263-
res.insert(IdentityField::GitHub);
264-
}
265-
if !self.discord.is_none() {
266-
res.insert(IdentityField::Discord);
267-
}
268-
res
269-
}
270-
}
271-
272-
/// A `Default` identity. This is given to users who get a username but have not set an identity.
273-
impl Default for IdentityInfo {
274-
fn default() -> Self {
275-
IdentityInfo {
276-
display: Data::None,
277-
legal: Data::None,
278-
web: Data::None,
279-
matrix: Data::None,
280-
email: Data::None,
281-
pgp_fingerprint: None,
282-
image: Data::None,
283-
twitter: Data::None,
284-
github: Data::None,
285-
discord: Data::None,
286-
}
287-
}
288-
}

runtime/mainnet/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ pallet-timestamp = { workspace = true, default-features = false }
5454
pallet-transaction-payment = { workspace = true, default-features = false }
5555
pallet-transaction-payment-rpc-runtime-api = { workspace = true, default-features = false }
5656
pallet-utility = { workspace = true, default-features = false }
57-
pallet-identity = { workspace = true, default-features = false }
5857
pallet-message-queue = { workspace = true, default-features = false }
5958
pallet-multibatching = { workspace = true, default-features = false }
6059
pallet-multisig = { workspace = true, default-features = false }
@@ -143,7 +142,6 @@ std = [
143142
"pallet-transaction-payment-rpc-runtime-api/std",
144143
"pallet-transaction-payment/std",
145144
"pallet-utility/std",
146-
"pallet-identity/std",
147145
"pallet-xcm/std",
148146
"pallet-proxy/std",
149147
"pallet-myth-proxy/std",
@@ -198,7 +196,6 @@ runtime-benchmarks = [
198196
"pallet-sudo/runtime-benchmarks",
199197
"pallet-timestamp/runtime-benchmarks",
200198
"pallet-utility/runtime-benchmarks",
201-
"pallet-identity/runtime-benchmarks",
202199
"pallet-xcm/runtime-benchmarks",
203200
"pallet-proxy/runtime-benchmarks",
204201
"pallet-myth-proxy/runtime-benchmarks",
@@ -245,7 +242,6 @@ try-runtime = [
245242
"pallet-timestamp/try-runtime",
246243
"pallet-transaction-payment/try-runtime",
247244
"pallet-utility/try-runtime",
248-
"pallet-identity/try-runtime",
249245
"pallet-xcm/try-runtime",
250246
"pallet-proxy/try-runtime",
251247
"pallet-myth-proxy/try-runtime",

runtime/mainnet/src/lib.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,29 +1105,6 @@ parameter_types! {
11051105
pub const MaxRegistrars: u32 = 20;
11061106
}
11071107

1108-
impl pallet_identity::Config for Runtime {
1109-
type RuntimeEvent = RuntimeEvent;
1110-
type Currency = Balances;
1111-
type BasicDeposit = BasicDeposit;
1112-
type ByteDeposit = ByteDeposit;
1113-
type UsernameDeposit = UsernameDeposit;
1114-
type SubAccountDeposit = SubAccountDeposit;
1115-
type MaxSubAccounts = MaxSubAccounts;
1116-
type IdentityInformation = runtime_common::IdentityInfo;
1117-
type MaxRegistrars = MaxRegistrars;
1118-
type Slashed = Treasury;
1119-
type ForceOrigin = RootOrCouncilTwoThirdsMajority;
1120-
type RegistrarOrigin = RootOrCouncilTwoThirdsMajority;
1121-
type OffchainSignature = Signature;
1122-
type SigningPublicKey = <Signature as Verify>::Signer;
1123-
type UsernameAuthorityOrigin = RootOrCouncilTwoThirdsMajority;
1124-
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
1125-
type UsernameGracePeriod = ConstU32<{ 7 * DAYS }>;
1126-
type MaxSuffixLength = ConstU32<7>;
1127-
type MaxUsernameLength = ConstU32<32>;
1128-
type WeightInfo = ();
1129-
}
1130-
11311108
// Create the runtime by composing the FRAME pallets that were previously configured.
11321109
construct_runtime!(
11331110
pub struct Runtime {
@@ -1143,7 +1120,6 @@ construct_runtime!(
11431120
Preimage: pallet_preimage = 6,
11441121
Scheduler: pallet_scheduler = 7,
11451122
Utility: pallet_utility = 8, // was previously 4
1146-
Identity: pallet_identity = 9,
11471123

11481124
// Monetary stuff.
11491125
Balances: pallet_balances = 10,
@@ -1216,7 +1192,6 @@ mod benches {
12161192
[pallet_bounties, Bounties]
12171193
[pallet_vesting, Vesting]
12181194
[pallet_utility, Utility]
1219-
[pallet_identity, Identity]
12201195
[pallet_collator_staking, CollatorStaking]
12211196
[pallet_transaction_payment, TransactionPayment]
12221197
);

runtime/testnet/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ pallet-transaction-payment = { workspace = true, default-features = false }
5656
pallet-treasury = { workspace = true, default-features = false }
5757
pallet-transaction-payment-rpc-runtime-api = { workspace = true, default-features = false }
5858
pallet-utility = { workspace = true, default-features = false }
59-
pallet-identity = { workspace = true, default-features = false }
6059
pallet-message-queue = { workspace = true, default-features = false }
6160
pallet-multisig = { workspace = true, default-features = false }
6261
pallet-nfts = { workspace = true, default-features = false }
@@ -142,7 +141,6 @@ std = [
142141
"pallet-transaction-payment/std",
143142
"pallet-treasury/std",
144143
"pallet-utility/std",
145-
"pallet-identity/std",
146144
"pallet-xcm/std",
147145
"pallet-proxy/std",
148146
"pallet-vesting/std",
@@ -198,7 +196,6 @@ runtime-benchmarks = [
198196
"pallet-transaction-payment/runtime-benchmarks",
199197
"pallet-treasury/runtime-benchmarks",
200198
"pallet-utility/runtime-benchmarks",
201-
"pallet-identity/runtime-benchmarks",
202199
"pallet-xcm/runtime-benchmarks",
203200
"pallet-proxy/runtime-benchmarks",
204201
"pallet-vesting/runtime-benchmarks",
@@ -242,7 +239,6 @@ try-runtime = [
242239
"pallet-transaction-payment/try-runtime",
243240
"pallet-treasury/try-runtime",
244241
"pallet-utility/try-runtime",
245-
"pallet-identity/try-runtime",
246242
"pallet-xcm/try-runtime",
247243
"pallet-proxy/try-runtime",
248244
"pallet-vesting/try-runtime",

0 commit comments

Comments
 (0)