Skip to content

Commit c9a5b0b

Browse files
committed
[pallet_identity] adapt paritytech/polkadot-sdk#2651
1 parent 773ad07 commit c9a5b0b

File tree

4 files changed

+212
-0
lines changed

4 files changed

+212
-0
lines changed

relay/kusama/src/lib.rs

+12
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,13 @@ impl pallet_identity::Config for Runtime {
936936
type Slashed = Treasury;
937937
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
938938
type RegistrarOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
939+
// TODO:(PR#159) check adds bellow and remove this comment!
940+
type OffchainSignature = Signature;
941+
type SigningPublicKey = <Signature as Verify>::Signer;
942+
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
943+
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
944+
type MaxSuffixLength = ConstU32<7>;
945+
type MaxUsernameLength = ConstU32<32>;
939946
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
940947
}
941948

@@ -1670,6 +1677,9 @@ pub type Migrations = migrations::Unreleased;
16701677
pub mod migrations {
16711678
use super::{parachains_configuration, Runtime};
16721679

1680+
// We don't have a limit in the Relay Chain.
1681+
const IDENTITY_MIGRATION_KEY_LIMIT: u64 = u64::MAX;
1682+
16731683
/// Unreleased migrations. Add new ones here:
16741684
pub type Unreleased = (
16751685
pallet_nomination_pools::migration::versioned::V5toV6<Runtime>,
@@ -1682,6 +1692,8 @@ pub mod migrations {
16821692
pallet_staking::migrations::v14::MigrateToV14<Runtime>,
16831693
parachains_configuration::migration::v10::MigrateToV10<Runtime>,
16841694
pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
1695+
// Migrate Identity pallet for Usernames
1696+
pallet_identity::migration::versioned::V0ToV1<Runtime, IDENTITY_MIGRATION_KEY_LIMIT>,
16851697
);
16861698
}
16871699

relay/kusama/src/weights/pallet_identity.rs

+94
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

relay/polkadot/src/lib.rs

+12
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,13 @@ impl pallet_identity::Config for Runtime {
817817
type Slashed = Treasury;
818818
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
819819
type RegistrarOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
820+
// TODO:(PR#159) check adds bellow and remove this comment!
821+
type OffchainSignature = Signature;
822+
type SigningPublicKey = <Signature as Verify>::Signer;
823+
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
824+
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
825+
type MaxSuffixLength = ConstU32<7>;
826+
type MaxUsernameLength = ConstU32<32>;
820827
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
821828
}
822829

@@ -1691,6 +1698,9 @@ pub type Migrations = migrations::Unreleased;
16911698
pub mod migrations {
16921699
use super::*;
16931700

1701+
// We don't have a limit in the Relay Chain.
1702+
const IDENTITY_MIGRATION_KEY_LIMIT: u64 = u64::MAX;
1703+
16941704
/// Upgrade Session keys to include BEEFY key.
16951705
/// When this is removed, should also remove `OldSessionKeys`.
16961706
pub struct UpgradeSessionKeys;
@@ -1715,6 +1725,8 @@ pub mod migrations {
17151725
pallet_staking::migrations::v14::MigrateToV14<Runtime>,
17161726
parachains_configuration::migration::v10::MigrateToV10<Runtime>,
17171727
pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
1728+
// Migrate Identity pallet for Usernames
1729+
pallet_identity::migration::versioned::V0ToV1<Runtime, IDENTITY_MIGRATION_KEY_LIMIT>,
17181730
);
17191731
}
17201732

relay/polkadot/src/weights/pallet_identity.rs

+94
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)