Skip to content
  • georgepisaltu's avatar
    Make `IdentityInfo` generic in `pallet-identity` (#1661) · 91851951
    georgepisaltu authored
    Fixes #179 
    
    # Description
    
    This PR makes the structure containing identity information used in
    `pallet-identity` generic through the pallet `Config`. Additionally, the
    old structure is now available in a separate module called `simple`
    (pending rename) and is compatible with the new interface.
    
    Another change in this PR is that while the `additional` field in
    `IdentityInfo` stays for backwards compatibility reasons, the associated
    costs are stil present in the pallet through the `additional` function
    in the `IdentityInformationProvider` interface. This function is marked
    as deprecated as it is only a temporary solution to the backwards
    compatibility problem we had. In short, we could have removed the
    additional fields in the struct and done a migration, but we chose to
    wait and do it off-chain through the genesis of the system parachain.
    After we move the identity pallet to the parachain, additional fields
    will be migrated into the existing fields and the `additional` key-value
    store will be removed. Until that happens, this interface will provide
    the necessary information to properly account for the associated costs.
    
    Additionally, this PR fixes an unrelated issue; the `IdentityField` enum
    used to represent the fields as bitflags couldn't store more than 8
    fields, even though it was marked as `#[repr(u64)]`. This was because of
    the `derive` implementation of `TypeInfo`, which assumed `u8` semantics.
    The custom implementation of this trait in
    https://github.com/paritytech/polkadot-sdk/commit/0105cc0396b7a53d0b290f48b1225847f6d17321
    
    
    fixes the issue.
    
    ---------
    
    Signed-off-by: default avatargeorgepisaltu <[email protected]>
    Co-authored-by: default avatarSam Johnson <[email protected]>
    Co-authored-by: default avatarjoe petrowski <[email protected]>
    91851951