Make `IdentityInfo` generic in `pallet-identity` (#1661)
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/0105cc03 fixes the issue. --------- Signed-off-by:georgepisaltu <george.pisaltu@parity.io> Co-authored-by:
Sam Johnson <sam@durosoft.com> Co-authored-by:
joe petrowski <25483142+joepetrowski@users.noreply.github.com>
Showing
- polkadot/runtime/rococo/src/lib.rs 2 additions, 0 deletionspolkadot/runtime/rococo/src/lib.rs
- polkadot/runtime/westend/src/lib.rs 2 additions, 0 deletionspolkadot/runtime/westend/src/lib.rs
- substrate/bin/node/runtime/src/lib.rs 2 additions, 0 deletionssubstrate/bin/node/runtime/src/lib.rs
- substrate/frame/alliance/src/lib.rs 1 addition, 1 deletionsubstrate/frame/alliance/src/lib.rs
- substrate/frame/alliance/src/mock.rs 2 additions, 1 deletionsubstrate/frame/alliance/src/mock.rs
- substrate/frame/identity/src/benchmarking.rs 18 additions, 42 deletionssubstrate/frame/identity/src/benchmarking.rs
- substrate/frame/identity/src/lib.rs 63 additions, 100 deletionssubstrate/frame/identity/src/lib.rs
- substrate/frame/identity/src/simple.rs 185 additions, 0 deletionssubstrate/frame/identity/src/simple.rs
- substrate/frame/identity/src/tests.rs 49 additions, 6 deletionssubstrate/frame/identity/src/tests.rs
- substrate/frame/identity/src/types.rs 80 additions, 144 deletionssubstrate/frame/identity/src/types.rs
Please register or sign in to comment