This commit is contained in:
Guillaume Thiolliere
2021-07-27 23:02:55 +02:00
committed by GitHub
parent 32fe61306b
commit 988c399983
+2 -8
View File
@@ -152,7 +152,7 @@ impl<Balance: Encode + Decode + MaxEncodedLen + Copy + Clone + Debug + Eq + Part
/// The fields that we use to identify the owner of an account with. Each corresponds to a field
/// in the `IdentityInfo` struct.
#[repr(u64)]
#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, BitFlags, RuntimeDebug)]
#[derive(Clone, Copy, PartialEq, Eq, BitFlags, RuntimeDebug)]
pub enum IdentityField {
Display = 0b0000000000000000000000000000000000000000000000000000000000000001,
Legal = 0b0000000000000000000000000000000000000000000000000000000000000010,
@@ -164,19 +164,13 @@ pub enum IdentityField {
Twitter = 0b0000000000000000000000000000000000000000000000000000000010000000,
}
impl MaxEncodedLen for IdentityField {
fn max_encoded_len() -> usize {
u64::max_encoded_len()
}
}
/// Wrapper type for `BitFlags<IdentityField>` that implements `Codec`.
#[derive(Clone, Copy, PartialEq, Default, RuntimeDebug)]
pub struct IdentityFields(pub(crate) BitFlags<IdentityField>);
impl MaxEncodedLen for IdentityFields {
fn max_encoded_len() -> usize {
IdentityField::max_encoded_len()
u64::max_encoded_len()
}
}