Skip to content

Commit

Permalink
[pallet_identity] adapt paritytech/polkadot-sdk#2651
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur committed Feb 3, 2024
1 parent 808bb4c commit 148ddc9
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 0 deletions.
12 changes: 12 additions & 0 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,13 @@ impl pallet_identity::Config for Runtime {
type Slashed = Treasury;
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type RegistrarOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
// TODO:(PR#159) check adds bellow and remove this comment!
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}

Expand Down Expand Up @@ -1670,6 +1677,9 @@ pub type Migrations = migrations::Unreleased;
pub mod migrations {
use super::{parachains_configuration, Runtime};

// We don't have a limit in the Relay Chain.
const IDENTITY_MIGRATION_KEY_LIMIT: u64 = u64::MAX;

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
pallet_nomination_pools::migration::versioned::V5toV6<Runtime>,
Expand All @@ -1682,6 +1692,8 @@ pub mod migrations {
pallet_staking::migrations::v14::MigrateToV14<Runtime>,
parachains_configuration::migration::v10::MigrateToV10<Runtime>,
pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
// Migrate Identity pallet for Usernames
pallet_identity::migration::versioned::V0ToV1<Runtime, IDENTITY_MIGRATION_KEY_LIMIT>,
);
}

Expand Down
94 changes: 94 additions & 0 deletions relay/kusama/src/weights/pallet_identity.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,13 @@ impl pallet_identity::Config for Runtime {
type Slashed = Treasury;
type ForceOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type RegistrarOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
// TODO:(PR#159) check adds bellow and remove this comment!
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
type WeightInfo = weights::pallet_identity::WeightInfo<Runtime>;
}

Expand Down Expand Up @@ -1691,6 +1698,9 @@ pub type Migrations = migrations::Unreleased;
pub mod migrations {
use super::*;

// We don't have a limit in the Relay Chain.
const IDENTITY_MIGRATION_KEY_LIMIT: u64 = u64::MAX;

/// Upgrade Session keys to include BEEFY key.
/// When this is removed, should also remove `OldSessionKeys`.
pub struct UpgradeSessionKeys;
Expand All @@ -1715,6 +1725,8 @@ pub mod migrations {
pallet_staking::migrations::v14::MigrateToV14<Runtime>,
parachains_configuration::migration::v10::MigrateToV10<Runtime>,
pallet_grandpa::migrations::MigrateV4ToV5<Runtime>,
// Migrate Identity pallet for Usernames
pallet_identity::migration::versioned::V0ToV1<Runtime, IDENTITY_MIGRATION_KEY_LIMIT>,
);
}

Expand Down
94 changes: 94 additions & 0 deletions relay/polkadot/src/weights/pallet_identity.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 148ddc9

Please sign in to comment.