Skip to content

Commit

Permalink
Identity origins
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed Jul 2, 2024
1 parent 0ad5425 commit 6569fbd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ impl pallet_identity::Config for Runtime {
type RegistrarOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type UsernameAuthorityOrigin = EitherOf<EnsureRoot<Self::AccountId>, GeneralAdmin>;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
Expand Down
10 changes: 8 additions & 2 deletions system-parachains/people/people-kusama/src/people.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ parameter_types! {
pub const SubAccountDeposit: Balance = system_para_deposit(1, 53);
pub RelayTreasuryAccount: AccountId =
parachains_common::TREASURY_PALLET_ID.into_account_truncating();
pub const GeneralAdminBodyId: BodyId = BodyId::Administration;
}

pub type IdentityAdminOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureXcm<IsVoiceOfBody<GovernanceLocation, GeneralAdminBodyId>>,
>;

impl pallet_identity::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
Expand All @@ -52,10 +58,10 @@ impl pallet_identity::Config for Runtime {
type MaxRegistrars = ConstU32<20>;
type Slashed = ToParentTreasury<RelayTreasuryAccount, LocationToAccountId, Runtime>;
type ForceOrigin = EnsureRoot<Self::AccountId>;
type RegistrarOrigin = EnsureRoot<Self::AccountId>;
type RegistrarOrigin = IdentityAdminOrigin;
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type UsernameAuthorityOrigin = IdentityAdminOrigin;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
Expand Down
12 changes: 10 additions & 2 deletions system-parachains/people/people-polkadot/src/people.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ use sp_runtime::{
RuntimeDebug,
};
use sp_std::prelude::*;
use xcm::latest::prelude::BodyId;
use xcm_config::GovernanceLocation;

parameter_types! {
// 27 | Min encoded size of `Registration`
Expand All @@ -39,8 +41,14 @@ parameter_types! {
pub const SubAccountDeposit: Balance = system_para_deposit(1, 53);
pub RelayTreasuryAccount: AccountId =
parachains_common::TREASURY_PALLET_ID.into_account_truncating();
pub const GeneralAdminBodyId: BodyId = BodyId::Administration;
}

pub type IdentityAdminOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureXcm<IsVoiceOfBody<GovernanceLocation, GeneralAdminBodyId>>,
>;

impl pallet_identity::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
Expand All @@ -52,10 +60,10 @@ impl pallet_identity::Config for Runtime {
type MaxRegistrars = ConstU32<20>;
type Slashed = ToParentTreasury<RelayTreasuryAccount, LocationToAccountId, Runtime>;
type ForceOrigin = EnsureRoot<Self::AccountId>;
type RegistrarOrigin = EnsureRoot<Self::AccountId>;
type RegistrarOrigin = IdentityAdminOrigin;
type OffchainSignature = Signature;
type SigningPublicKey = <Signature as Verify>::Signer;
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
type UsernameAuthorityOrigin = IdentityAdminOrigin;
type PendingUsernameExpiration = ConstU32<{ 7 * DAYS }>;
type MaxSuffixLength = ConstU32<7>;
type MaxUsernameLength = ConstU32<32>;
Expand Down

0 comments on commit 6569fbd

Please sign in to comment.