Skip to content

Commit f220edc

Browse files
committed
NODE-161, feat: [Identity] Decouple usernames from identities (paritytech/polkadot-sdk#5554)
1 parent ceec168 commit f220edc

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

runtime/dev/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,10 +702,12 @@ parameter_types! {
702702
pub const BasicDeposit: Balance = 100 * BFC;
703703
pub const ByteDeposit: Balance = 100 * BFC;
704704
pub const SubAccountDeposit: Balance = 100 * BFC;
705+
pub const UsernameDeposit: Balance = 100 * BFC;
705706
pub const MaxSubAccounts: u32 = 100;
706707
pub const MaxAdditionalFields: u32 = 100;
707708
pub const MaxRegistrars: u32 = 20;
708709
pub const PendingUsernameExpiration: u32 = 1 * MINUTES;
710+
pub const UsernameGracePeriod: u32 = 1 * MINUTES;
709711
pub const MaxSuffixLength: u32 = 7;
710712
pub const MaxUsernameLength: u32 = 32;
711713
}
@@ -717,6 +719,7 @@ impl pallet_identity::Config for Runtime {
717719
type BasicDeposit = BasicDeposit;
718720
type ByteDeposit = ByteDeposit;
719721
type SubAccountDeposit = SubAccountDeposit;
722+
type UsernameDeposit = UsernameDeposit;
720723
type MaxSubAccounts = MaxSubAccounts;
721724
type IdentityInformation = IdentityInfo<MaxAdditionalFields>;
722725
type MaxRegistrars = MaxRegistrars;
@@ -727,6 +730,7 @@ impl pallet_identity::Config for Runtime {
727730
type SigningPublicKey = <Signature as traits::Verify>::Signer;
728731
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
729732
type PendingUsernameExpiration = PendingUsernameExpiration;
733+
type UsernameGracePeriod = UsernameGracePeriod;
730734
type MaxSuffixLength = MaxSuffixLength;
731735
type MaxUsernameLength = MaxUsernameLength;
732736
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;

runtime/mainnet/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,12 @@ parameter_types! {
734734
pub const BasicDeposit: Balance = 100 * SUPPLY_FACTOR * BFC;
735735
pub const ByteDeposit: Balance = 100 * SUPPLY_FACTOR * BFC;
736736
pub const SubAccountDeposit: Balance = 100 * SUPPLY_FACTOR * BFC;
737+
pub const UsernameDeposit: Balance = 100 * SUPPLY_FACTOR * BFC;
737738
pub const MaxSubAccounts: u32 = 100;
738739
pub const MaxAdditionalFields: u32 = 100;
739740
pub const MaxRegistrars: u32 = 20;
740741
pub const PendingUsernameExpiration: u32 = 7 * DAYS;
742+
pub const UsernameGracePeriod: u32 = 7 * DAYS;
741743
pub const MaxSuffixLength: u32 = 7;
742744
pub const MaxUsernameLength: u32 = 32;
743745
}
@@ -749,6 +751,7 @@ impl pallet_identity::Config for Runtime {
749751
type BasicDeposit = BasicDeposit;
750752
type ByteDeposit = ByteDeposit;
751753
type SubAccountDeposit = SubAccountDeposit;
754+
type UsernameDeposit = UsernameDeposit;
752755
type MaxSubAccounts = MaxSubAccounts;
753756
type IdentityInformation = IdentityInfo<MaxAdditionalFields>;
754757
type MaxRegistrars = MaxRegistrars;
@@ -759,6 +762,7 @@ impl pallet_identity::Config for Runtime {
759762
type SigningPublicKey = <Signature as traits::Verify>::Signer;
760763
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
761764
type PendingUsernameExpiration = PendingUsernameExpiration;
765+
type UsernameGracePeriod = UsernameGracePeriod;
762766
type MaxSuffixLength = MaxSuffixLength;
763767
type MaxUsernameLength = MaxUsernameLength;
764768
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;

runtime/testnet/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,10 +744,12 @@ parameter_types! {
744744
pub const BasicDeposit: Balance = 100 * BFC;
745745
pub const ByteDeposit: Balance = 100 * BFC;
746746
pub const SubAccountDeposit: Balance = 100 * BFC;
747+
pub const UsernameDeposit: Balance = 100 * BFC;
747748
pub const MaxSubAccounts: u32 = 100;
748749
pub const MaxAdditionalFields: u32 = 100;
749750
pub const MaxRegistrars: u32 = 20;
750751
pub const PendingUsernameExpiration: u32 = 1 * DAYS;
752+
pub const UsernameGracePeriod: u32 = 1 * DAYS;
751753
pub const MaxSuffixLength: u32 = 7;
752754
pub const MaxUsernameLength: u32 = 32;
753755
}
@@ -759,6 +761,7 @@ impl pallet_identity::Config for Runtime {
759761
type BasicDeposit = BasicDeposit;
760762
type ByteDeposit = ByteDeposit;
761763
type SubAccountDeposit = SubAccountDeposit;
764+
type UsernameDeposit = UsernameDeposit;
762765
type MaxSubAccounts = MaxSubAccounts;
763766
type IdentityInformation = IdentityInfo<MaxAdditionalFields>;
764767
type MaxRegistrars = MaxRegistrars;
@@ -769,6 +772,7 @@ impl pallet_identity::Config for Runtime {
769772
type SigningPublicKey = <Signature as traits::Verify>::Signer;
770773
type UsernameAuthorityOrigin = EnsureRoot<Self::AccountId>;
771774
type PendingUsernameExpiration = PendingUsernameExpiration;
775+
type UsernameGracePeriod = UsernameGracePeriod;
772776
type MaxSuffixLength = MaxSuffixLength;
773777
type MaxUsernameLength = MaxUsernameLength;
774778
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;

0 commit comments

Comments
 (0)